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.

Concatenation of strings containing double-byte data: If the assembler is invoked<br />

with the DBCS option, then the following additional considerations apply:<br />

When a variable symbol adjoins double-byte data, the SO delimiting the<br />

double-byte data is not a valid delimiter of the variable symbol. The variable<br />

symbol must be terminated by a period.<br />

The assembler checks for SI and SO at concatenation points. If the byte to the<br />

left of the join is SI and the byte to the right of the join is SO, then the SI/SO<br />

pair are considered redundant and are removed.<br />

To create redundant SI/SO pairs at concatenation points, use the substring<br />

notation and SETC expressions to create additional SI and SO characters. By<br />

controlling the order of concatenation, you can leave a redundant SI/SO pair at<br />

a concatenation point.<br />

Instead of substring notation, you can use the BYTE function to create<br />

additional SI and SO characters:<br />

&SO SETC (BYTE 14)<br />

&SI SETC (BYTE 15)<br />

Examples:<br />

&DBDA SETC ''<br />

&SO SETC BYTE(X'E')<br />

&SI SETC BYTE(X'F')<br />

&DBCS1A SETC<br />

'&DBDA.'<br />

&DBCS1E SETC<br />

'&DBDA'<br />

&DBCS2 SETC '&DBDA'.''<br />

&DBCS2A SETC<br />

'&DBDA'.''.'&DBDA'<br />

&DBCS3 SETC '&DBDA'.'&SI'.'&SO'.''<br />

&DBCS3P SETC<br />

'&DBDA'.'&SI'<br />

&DBCS3Q SETC<br />

'&SO'.''<br />

&DBCS3R SETC<br />

'&DBCS3P'.'&DBCS3Q'<br />

These examples use the BYTE function to create variables &SO and &SI, which<br />

have the values of SO and SI, respectively. The variable &DBCS1A is assigned the<br />

value with the SI/SO pair at the join removed. The assignment to variable<br />

&DBCS1E fails with error ASMA35E Invalid delimiter, because the symbol &DBDA is<br />

terminated by SO and not by a period. The variable &DBCS2 is assigned the value<br />

. The variable &DBCS2A is assigned the value . As with &DBCS1A,<br />

redundant SI/SO pairs are removed at the joins. The variable &DBCS3 is assigned<br />

the value . Although SI and SO have been added at the join, the<br />

concatenation operation removes two SI and two SO characters, since redundant<br />

SI/SO pairs are found at the second and third concatenations. However, by using<br />

intermediate variables &DBCS3P and &DBCS3Q to change the order of concatenation,<br />

the string can be assigned to variable &DBCS3R. Note that substituting the<br />

variable symbol &DBCS3R in the nominal value of a G-type constant results in<br />

removal of the SI/SO pair at the join.<br />

Using SETC Symbols<br />

The character value assigned to a SETC symbol is substituted for the SETC<br />

symbol when it is used in the name, operation, or operand field of a statement.<br />

For example, consider the following macro definition, macro instruction, and<br />

generated statements:<br />

384 <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!