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


Evaluation of character expressions

HLASM Language Reference
SC26-4940-06

The value of a character expression is the character string within the enclosing apostrophes, after the assembler carries out any substitution for variable symbols.

Character strings, including variable symbols, can be concatenated to each other within a character expression. The resultant string is the value of the expression.
Notes:
  1. Use two apostrophes to generate a single apostrophe as part of the value of a character expression.
    The following statement assigns the character value L'SYMBOL to the SETC symbol &LENGTH.
    &LENGTH  SETC            'L''SYMBOL'
  2. A double ampersand generates a double ampersand as part of the value of a character expression. To generate a single ampersand in a character expression, use the substring notation; for example:
    &AMP     SETC            '&&'(1,1)
    Note: A quoted single ampersand '&' is not a valid character string.
    The following statement assigns the character value HALF&& to the SETC symbol &AND.
    &AND     SETC            'HALF&&'
    This is the only instance when the assembler does not pair ampersands to produce a single ampersand. However, if you substitute a SETC symbol with such a value into the nominal value in a DC instruction operand, or the operand of an MNOTE instruction, when the assembler processes the DC or MNOTE instruction, it pairs the ampersands and produces a single ampersand.
  3. To generate a period, two periods must be specified after a variable symbol.
    For example, if &ALPHA has been assigned the character value AB%4, the following statement can be used to assign the character value AB%4.RST to the variable symbol &GAMMA.
    &GAMMA   SETC            '&ALPHA..RST'
  4. To generate a period, the variable symbol must have a period as part of its value. For example:
    &DOT    SETC  '.'
    &DELTA  SETC  'A&DOT.&DOT'    &DELTA has value 'A..'
  5. Double-byte data can appear in the character string if the assembler is invoked with the DBCS option. The double-byte data must be bracketed by the SO and SI delimiters, and the double-byte data must be valid.
  6. The DBCS ampersand and apostrophe are not recognized as delimiters.
  7. A double-byte character that contains the value of an EBCDIC ampersand or apostrophe in either byte is not recognized as a delimiter when enclosed by SO and SI.
  8. Duplication (replication) factors are permitted before character built-in functions.
  9. Releases of HLASM prior to Version 1 Release 4 permitted predefined absolute symbols in character expressions. To remove inconsistencies when handling character and arithmetic expressions such usage is no longer permitted and results in message ASMA137S if attempted. The built-in function BYTE can be used to convert a numeric value in a character expression as shown.
      RPTDS      EQU     X'01'
      &RPTC1     SETC    'SEND  '.(BYTE RPTDS)

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014