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


Character self-defining term

HLASM Language Reference
SC26-4940-06

A character self-defining term consists of 1-to-4 characters enclosed in apostrophes, and must be preceded by the letter C. All letters, decimal digits, and special characters can be used in a character self-defining term. In addition, any of the remaining EBCDIC characters can be designated in a character self-defining term. Examples of character self-defining terms are:
C'/'
C' ' (space)
C'ABC'
C'13'
Because of the use of apostrophes in the assembler language and ampersands in the macro language as syntactic characters, the following rule must be observed when using these characters in a character self-defining term:
  • For each apostrophe or ampersand you want in a character self-defining term, two apostrophes or ampersands must be written. For example, the character value A'# is written as 'A''#', while a single apostrophe followed by a space and another apostrophe is written as ''' '''.

For C-type character self-defining terms, each character in the character sequence is assembled as its 8 bit code equivalent (see Standard character set code table). The two apostrophes or ampersands that must be used to represent an apostrophe or ampersand within the character sequence are assembled as an apostrophe or ampersand. Double-byte data can appear in a character self-defining term, if the DBCS assembler option is specified. The assembled value includes the SO and SI delimiters. Hence a character self-defining term containing double-byte data is limited to one double-byte character delimited by SO and SI. For example, C'<.A>'.

Since the SO and SI are stored, the null double-byte character string, C'<>', is also a valid character self-defining term.

Note: The assembler does not support character self-defining terms of the form CU'x' because self-defining terms are required by definition of the Assembler Language to have fixed values.
There are many EBCDIC code pages; some characters have different encodings in different code pages. To be sure that your character constants and self-defining terms have the representations and value, use just these 82 invariant characters:
  • space
  • decimal digits
  • upper-case and lower-case letters A through Z
  • these special characters:
    + < = > % & * " ' ( ) , _ - . / : ; ?
These characters have the same binary representation across all single-byte EBCDIC code pages. If you use any other character, the Assembler uses its bit pattern as its value, so it might not display as the same character in environments where a different code page is used by default.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014