Professional Documents
Culture Documents
Figure 135 shows an ILE COBOL program that uses indicators in the record area but does not
use the INDICATORS phrase in any I/O statement. Figure 134 shows the associated DDS for
the file.
Figure 136 shows an ILE COBOL program that uses indicators in the record area and the
INDICATORS phrase in the I/O statements. The associated DDS for Figure 136 is Figure 134.
Figure 138 shows an ILE COBOL program that uses indicators in a separate indicator area,
defined in the WORKING-STORAGE SECTION by using the Format 2 COPY statement. Figure
137 shows the associated DDS for the file.
Figure 139 shows an ILE COBOL program that uses indicators in a separate indicator area,
defined in a table in the WORKING-STORAGE SECTION. The associated DDS for the file is the
same as Figure 137.
Figure 134. Example of a Program Using Indicators in the Record Area without Using the
INDICATORS Phrase in the I/O Statement—DDS
....+....1....+....2....+....3....+....4....+....5....+....6....+....7...
A* DISPLAY FILE DDS FOR INDICATOR EXAMPLES - INDICATORS IN RECORD ARE
A* DSPFILEX 1
A 2 R FORMAT1 3 CF01(99 'END OF PROGRAM')
A CF05(51 'DAILY REPORT')
A CF09(52 'MONTHLY REPORT')
1
The INDARA keyword is not used; indicators are stored in the record area with the data
fields.
2
Record format FORMAT1 is specified.
3
Three indicators are associated with three function keys. Indicator 99 will be set on when
you press F1, and so on.
4
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzase/sc092540641.htm 2/15
10/5/2019 Examples of Using Indicators in ILE COBOL Programs
1
The separate indicator area attribute, SI, is not coded in the ASSIGN clause. As a result, the
indicators form part of the record area.
2
The Format 2 COPY statement defines data fields and indicators in the record area.
3
Because the file indicators form part of the record area, response and option indicators are
defined in the order in which they are used in the DDS, and the indicator numbers are
treated as documentation.
4
All indicators used by the program are defined with meaningful names in data description
entries in the WORKING-STORAGE SECTION. Indicator numbers are omitted here because
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzase/sc092540641.htm 5/15
10/5/2019 Examples of Using Indicators in ILE COBOL Programs
10
FORMAT1, including both data and indicators, is read from the display.
11
The response indicators for FORMAT1 are copied from the record area to the data
description entries in the WORKING-STORAGE SECTION.
12
If F5 has been pressed, a program call is processed.
Figure 136. Example of Program Using Indicators in the Record Area and the INDICATORS
1
The separate indicator area attribute, SI, is not coded in the ASSIGN clause.
2
The Format 2 COPY statement defines data fields and indicators in the record area
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzase/sc092540641.htm 8/15
10/5/2019 Examples of Using Indicators in ILE COBOL Programs
The Format 2 COPY statement defines data fields and indicators in the record area.
3
Because the file does not have a separate indicator area, response and option indicators are
defined in the order in which they are used in the DDS, and the indicator numbers are
treated as documentation.
4
All indicators used by the program are defined with meaningful names in data description
entries in the WORKING-STORAGE SECTION. Indicator numbers are omitted here because
they have no effect. Indicators should be defined in the order needed by the display file.
5
IN01 in the WORKING-STORAGE SECTION is set on if it is the first day of the month.
6
FORMAT1 is written to the workstation display:
• The INDICATORS phrase causes the contents of the variable OPTION-INDICS to be
copied to the beginning of the record area.
• Data and indicator values are written to the workstation display.
7
FORMAT1, including both data and indicators, is read from the work station display.
8
The INDICATORS phrase causes bytes to be copied from the beginning of the record area to
RESPONSE-INDICS.
9
If F5 has been pressed, a program call is processed.
Figure 137. Example of a Program Using Indicators in a Separate Indicator Area, Defined in
WORKING-STORAGE by Using the COPY Statement ** DDS
1
The INDARA keyword is specified; indicators are stored in a separate indicator area, not in
h d E f hi ifi i h DDS f
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzase/sc092540641.htm hi fil i h h h 9/15
10/5/2019 Examples of Using Indicators in ILE COBOL Programs
the record area. Except for this specification, the DDS for this file is the same as that shown
in Figure 134.
Figure 138. COBOL Listing Using Indicators in a Separate Indicator Area
5722WDS V5R4M0 060210 LN
IBM ILE COBOL CBLGUIDE/INDIC1
S o u r c e
STMT PL SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6...
1 000100 IDENTIFICATION DIVISION.
2 000200 PROGRAM-ID. INDIC3.
000300* SAMPLE PROGRAM - FILE WITH SEPERATE INDICATORS AREA
000400
3 000500 ENVIRONMENT DIVISION.
4 000600 CONFIGURATION SECTION.
5 000700 SOURCE-COMPUTER. IBM-ISERIES
6 000800 OBJECT-COMPUTER. IBM-ISERIES
7 000900 INPUT-OUTPUT SECTION.
8 001000 FILE-CONTROL.
9 001100 SELECT DISPFILE
10 001200 ASSIGN TO WORKSTATION-DSPFILE-SI 1
11 001300 ORGANIZATION IS TRANSACTION
12 001400 ACCESS IS SEQUENTIAL.
001500
13 001600 DATA DIVISION.
14 001700 FILE SECTION.
15 001800 FD DISPFILE.
16 001900 01 DISP-REC.
002000 COPY DDS-ALL-FORMATS OF DSPFILE. 2
Please note that DISQUS operates this forum. When you sign in to comment, IBM will provide your
email, first name and last name to DISQUS. That information, along with your comments, will be
governed by DISQUS’ privacy policy. By commenting, you are accepting the DISQUS terms of service.
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzase/sc092540641.htm 14/15
10/5/2019 Examples of Using Indicators in ILE COBOL Programs
Sign In
Comments
Find a technical tutorial in IBM Developer Explore, learn and succeed with training on
the IBM Skills Gateway
English
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzase/sc092540641.htm 15/15