Basic alphanumeric literals
Basic alphanumeric literals can contain any character in a single-byte EBCDIC character set.
The following format is for a basic alphanumeric literal:
Format 1: Basic alphanumeric literals |
---|
|
The enclosing quotation marks or apostrophes are excluded from the literal when the program is compiled.
An
embedded quotation mark or apostrophe must be represented by a pair
of quotation marks (""
) or a pair of apostrophes
(''
), respectively, when it is the character used
as the opening delimiter. For example:
"THIS ISN""T WRONG"
'THIS ISN''T WRONG'
The delimiter character used as the opening delimiter for a literal must be used as the closing delimiter for that literal. For example:
'THIS IS RIGHT'
"THIS IS RIGHT"
'THIS IS WRONG"
You can use apostrophes or quotation marks as the literal delimiters independent of the APOST/QUOTE compiler option.
Any punctuation characters included within an alphanumeric literal are part of the value of the literal.
The maximum length of an alphanumeric literal is 160 bytes. The minimum length is 1 byte.
Alphanumeric literals are in the alphanumeric data class and category. (Data classes and categories are described in Classes and categories of data.)