22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SETA Instruction<br />

| The result of C2A is the same as would be obtained from<br />

| &value SETA C'charstring'<br />

| except that C2A gives a zero result for null strings, and does not pair<br />

| apostrophes or ampersands before conversion.<br />

| Example<br />

| C2A('') has value <br />

| C2A('+') has value 78<br />

| C2A('1') has value 241<br />

| C2A('') has value -252645136<br />

| D2A<br />

| Format: Function-invocation<br />

| Operands: Character<br />

| Output: D2A('decstring') converts a character string argument containing an<br />

| optional leading plus or minus sign followed by decimal digits to an arithmetic<br />

| value. Error conditions are detected if<br />

| the argument contains invalid characters<br />

| no digits are present following a sign<br />

| the argument length exceeds 11 characters<br />

| the resulting value is too large<br />

| the argument string is null.<br />

| The result of the D2A function is the same as<br />

| &value SETA decstring<br />

| except that SETA does not allow leading plus or minus signs.<br />

| Examples<br />

| D2A('') indicates an error condition<br />

| D2A('') has value <br />

| D2A('1') has value 1<br />

| D2A('+1') has value 1<br />

| D2A('-5') has value -5<br />

| DCLEN<br />

| Format: Function-invocation<br />

| Operands: Character<br />

| Output: DCLEN('cexpr') returns the length of its argument string after pairs of<br />

| apostrophes and ampersands have been internally replaced by single<br />

| occurrences. No change is made to the argument. Such pairing occurs only<br />

| once; that is, three successive occurrences of an apostrophe or ampersand<br />

| will result in two occurrences, not one.<br />

| Examples<br />

| DCLEN('') has value (null string)<br />

| DCLEN('''') has value 1 (argument is a single apostrophe)<br />

| DCLEN('''''') has value 2 (argument is two apostrophes)<br />

| DCLEN('&&') has value 1 (argument is two ampersands)<br />

| DCLEN('a''''b') has value 3 (DCVAL string would be "a'b")<br />

| DCLEN('a''''b&&c') has value 5 (DCVAL string would be "a'b&c")<br />

| DCLEN('&&&''''''') has value 4 (DCVAL string would be "&&''")<br />

| Note: DCLEN is similar to DCVAL, except that DCLEN returns only the length<br />

| of the result, not the paired string.<br />

354 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!