In this post, I have given logic to define VB files using the OCCURS clause.
When you want simplified code always better use OCCURS clause,
I am giving here two usages. These two styles save your precious time.
USAGE 1:
FD Varaiable-File. 01 Variable-rec. 02 ACCT-NUMB PIC X(8). 02 PAYMENTS OCCURS 1 TO 5 TIMES DEPENDING ON NO-OF-PAYMENTS INDEXED BY INX. 03 DATE PIC 9(6). 03 AMOUNT PIC 9(5)V99.
USAGE 2:
The other way of coding VB files:
FD Variable-file-2. 01 rec-1. 02 General-info Pic x(6). 01 Rec-2 02 Special-info Pic X(8).
Key Points to Developers
- The “depending on” clause can not be used to redefine other variables.
- The values “NO-OF-PAYMENTS” and “INX” must be equal, or, INX value less than NO-OF-PAYMENTS value (this applies to both Index and Subscript).
Related Posts