File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
COBOL Programming Course #1 - Getting Started/Labs/cbl Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 2424 05 TABLE-MAX PIC S9 (4 ) COMP VALUE 45 .
2525 *
2626 01 ACCT-TABLE.
27- 05 ACCT-TABLE-ITEM OCCURS 45 TIMES INDEXED BY TABLE-IDX.
27+ 05 ACCT-TABLE-ITEM OCCURS 45 TIMES ASCENDING KEY IS ACCT-NO
28+ INDEXED BY TABLE-IDX.
2829 10 ACCT-NO PIC X (8 ).
2930 10 ACCT-LIMIT PIC S9 (7 )V99 COMP-3 .
3031 10 ACCT-BALANCE PIC S9 (7 )V99 COMP-3 .
5354 *
5455 SEARCH-RECORD.
5556 SET TABLE-IDX TO 1 .
56- SEARCH ACCT-TABLE-ITEM VARYING TABLE-IDX
57+ SEARCH ALL ACCT-TABLE-ITEM
5758 AT END DISPLAY " Not Found"
58- WHEN LAST-NAME (TABLE-IDX) = " ROOSEVELT "
59- DISPLAY " Roosevelt is found!" .
59+ WHEN ACCT-NO (TABLE-IDX) = 18011809
60+ DISPLAY " User with Acct No 18011809 is found!" .
6061 *
6162 CLOSE-STOP.
6263 CLOSE ACCT-REC.
Original file line number Diff line number Diff line change 2424 05 TABLE-MAX PIC S9 (4 ) COMP VALUE 45 .
2525 *
2626 01 ACCT-TABLE.
27- 05 ACCT-TABLE-ITEM OCCURS 45 TIMES ASCENDING KEY IS ACCT-NO
28- INDEXED BY TABLE-IDX.
27+ 05 ACCT-TABLE-ITEM OCCURS 45 TIMES INDEXED BY TABLE-IDX.
2928 10 ACCT-NO PIC X (8 ).
3029 10 ACCT-LIMIT PIC S9 (7 )V99 COMP-3 .
3130 10 ACCT-BALANCE PIC S9 (7 )V99 COMP-3 .
5453 *
5554 SEARCH-RECORD.
5655 SET TABLE-IDX TO 1 .
57- SEARCH ALL ACCT-TABLE-ITEM
56+ SEARCH ACCT-TABLE-ITEM VARYING TABLE-IDX
5857 AT END DISPLAY " Not Found"
59- WHEN ACCT-NO (TABLE-IDX) = 18011809
60- DISPLAY " User with Acct No 18011809 is found!" .
58+ WHEN LAST-NAME (TABLE-IDX) = " ROOSEVELT "
59+ DISPLAY " Roosevelt is found!" .
6160 *
6261 CLOSE-STOP.
6362 CLOSE ACCT-REC.
You can’t perform that action at this time.
0 commit comments