DBCS literals
The formats and rules for DBCS literals are listed in this section.
Format for DBCS literals |
---|
|
G"
,G'
,N"
, orN'
- Opening delimiters.
N"
andN'
identify a DBCS literal when the NSYMBOL(DBCS) compiler option is in effect. They identify a national literal when the NSYMBOL(NATIONAL) compiler option is in effect, and the rules specified in National literals apply. "
or'
- The closing delimiter. If a quotation mark is used in the opening delimiter, a quotation mark must be used as the closing delimiter. Similarly, if an apostrophe is used in the opening delimiter, an apostrophe must be used as the closing delimiter.
- DBCS-characters
- Any DBCS character.
- Maximum length
- The maximum length is limited by the available space on one source line.
- Continuation rules
- Cannot be continued across lines
DBCS literals with the SOSI compiler option
When the SOSI compiler option is in effect, workstation shift-out (SO) and shift-in (SI) control characters delimit DBCS characters in source text. The following section is for DBCS literals with shift-out and shift-in delimiters:
Format for DBCS literals |
---|
|
- <
- Represents the shift-out control character (X'1E')
- >
- Represents the shift-in control character (X'1F')
Rules for DBCS characters, literal delimiters, maximum length, and continuation are the same as for DBCS literals without the SOSI compiler option. See SOSI in the COBOL for Linux on x86 Programming Guide for details of the SOSI compiler option.
Where DBCS literals can be used
DBCS literals can be used in the following places:
- DATA DIVISION
- In the VALUE clause of data description entries that define a data item of class DBCS.
- In the VALUE OF clause of file description entries.
- PROCEDURE DIVISION
- In a relation condition when the comparand is a DBCS data item, an elementary data item of class national, a national group item, or an alphanumeric group item
- As an argument passed BY CONTENT in a CALL statement
- In the DISPLAY and EVALUATE statements
- In
the following statements:
- INITIALIZE; for details, see INITIALIZE statement.
- INSPECT; for details, see INSPECT statement.
- MOVE; for details, see MOVE statement.
- STRING; for details, see STRING statement.
- UNSTRING, for details, see UNSTRING statement.
- In figurative constant ALL
- As an argument to the NATIONAL-OF intrinsic function
- Compiler-directing statements COPY, REPLACE, and TITLE