Special Registers
Special registers are reserved words that name storage areas generated by the compiler. Their primary use is to store information produced through specific COBOL features. Each such storage area has a fixed name, and must not be further defined within the program.
In the general formats of this specification, a special register can be used, unless otherwise restricted, wherever a data-name or identifier is specified provided that the special register is the same category as the data-name or identifier. If qualification is allowed, special registers can be qualified as necessary to provide uniqueness.
- Whenever the CANCEL statement is invoked to initialize a referenced subprogram
- For programs that possess the INITIAL attribute
- For programs that possess the RECURSIVE attribute
You can specify an alphanumeric register in a function wherever an alphanumeric argument is allowed, unless specifically prohibited.
You can specify a numeric special register in a function wherever a numeric argument is allowed, unless specifically prohibited.
Each special register is discussed in the section beginning on the indicated page.
This register is syntax checked only.
- Special Register
- Page
- DEBUG-ITEM
- This register is syntax checked only.
- LINAGE-COUNTER
- LINAGE-COUNTER Special Register
- ADDRESS OF
- ADDRESS OF Special Register
- DB-FORMAT-NAME
- DB-FORMAT-NAME Special Register
- LENGTH OF
- LENGTH OF Special Register
- LOCALE OF
- LOCALE OF Special Register
- FORMAT OF
- FORMAT OF Special Register
- RETURN-CODE
- RETURN-CODE Special Register
- SORT-RETURN
- SORT-RETURN Special Register
- WHEN-COMPILED
- WHEN-COMPILED Special Register
- XML-CODE
- XML-CODE Special Register
- XML-EVENT
- XML-EVENT Special Register
- XML-NTEXT
- XML-NTEXT Special Register
- XML-TEXT
- XML-TEXT Special Register