EXHIBIT NAMED Statement
The EXHIBIT NAMED
statement provides a way to extract the value of a named variable and write it to an error file.
Note
Set the runtime environment variable COB_ERROR_FILE
, when running a program with the EXHIBIT
Statement.
General Format:
EXHIBIT [NAMED] [element-1]
Syntax:
element-1
is a numeric or alphanumeric data item.
General Rules:
When the EXHIBIT NAMED
statement is applied to a variable, output is written to the Console in the following format:[element-1] = [value]
.
In the example below:ELEMENT-1 = 1
Code Sample:
IDENTIFICATION DIVISION.
PROGRAM-ID. EXHIBIT-1.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 ELEMENT-1 PIC 9 VALUE 1.
77 DUMMY PIC X.
PROCEDURE DIVISION.
MAIN.
DISPLAY “EXHIBIT NAMED EXAMPLE” LINE 2 COL 2.
EXHIBIT NAMED ELEMENT-1.
ACCEPT DUMMY LINE 10 COL 10.
STOP RUN..