HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Concatenation of strings containing double-byte data

HLASM Language Reference
SC26-4940-06

If the assembler is invoked with the DBCS option, then the following additional considerations apply:
  • When a variable symbol adjoins double-byte data, the SO delimiting the double-byte data is not a valid delimiter of the variable symbol. The variable symbol must be terminated by a period.
  • The assembler checks for SI and SO at concatenation points. If the byte to the left of the join is SI and the byte to the right of the join is SO, then the SI/SO pair is considered redundant and are removed.
  • To create redundant SI/SO pairs at concatenation points, use the substring notation and SETC expressions to create additional SI and SO characters. By controlling the order of concatenation, you can leave a redundant SI/SO pair at a concatenation point.
    Instead of substring notation, you can use the BYTE function to create additional SI and SO characters:
    &SO   SETC (BYTE 14)
    &SI   SETC (BYTE 15)
Examples:
&DBDA    SETC            '<Da>'
&SO      SETC            BYTE(X'0E')
&SI      SETC            BYTE(X'0F')
&DBCS1A  SETC            '&DBDA.<Db>'
&DBCS1E  SETC            '&DBDA<Db>'
&DBCS2   SETC            '&DBDA'.'<Db>'
&DBCS2A  SETC            '&DBDA'.'<Db>'.'&DBDA'
&DBCS3   SETC            '&DBDA'.'&SI'.'&SO'.'<Db>'
&DBCS3P  SETC            '&DBDA'.'&SI'
&DBCS3Q  SETC            '&SO'.'<Db>'
&DBCS3R  SETC            '&DBCS3P'.'&DBCS3Q'

These examples use the BYTE function to create variables &SO and &SI, which have the values of SO and SI. The variable &DBCS1A is assigned the value <DaDb> with the SI/SO pair at the join removed. The assignment to variable &DBCS1E fails with error ASMA035E Invalid delimiter, because the symbol &DBDA is terminated by SO and not by a period. The variable &DBCS2 is assigned the value <DaDb>. The variable &DBCS2A is assigned the value <DaDbDa>. As with &DBCS1A, redundant SI/SO pairs are removed at the joins. The variable &DBCS3 is assigned the value <DaDb>. Although SI and SO have been added at the join, the concatenation operation removes two SI and two SO characters, since redundant SI/SO pairs are found at the second and third concatenations. However, by using intermediate variables &DBCS3P and &DBCS3Q to change the order of concatenation, the string <Da><Db> can be assigned to variable &DBCS3R. Substituting the variable symbol &DBCS3R in the nominal value of a G-type constant results in removal of the SI/SO pair at the join.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014