kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12401 Topics: 75 Location: San Jose
|
Posted: Mon Feb 29, 2016 11:12 am Post subject: |
|
|
| misi01 wrote: | It didn't occur to me that any references to positions in the IFTHEN had to take into account that 87 bytes had been "inserted" into the file before what I thought were the positions (so pos 5 - with the RDW - is now 5+87 = 92)
|
misi01,
For a better understanding
| Code: |
(WHEN=INIT,BUILD=(1,4,87X,5)),
|
translates to
| Code: |
01 TEMP-RECORD.
05 TEMP-RDW PIC S9(09) COMP.
05 TEMP-KEY PIC X(87) VALUE SPACES.
05 ORIGINAL-REC PIC X(1) OCCURS 124 TIMES.
|
So if you are referring the original fields you need to calculate the length of TEMP-KEY. so your original records starts from 92.
IFTHEN=(WHEN=COND processing in DFSORT is same as EVALUATE in COBOL. So if you can relate the code like this it is much easier to follow and devise solutions.
IFTHEN=(WHEN=INIT and WHEN=GROUP will be executed ALL the time and they should come/processed before your WHEN=COND _________________ Kolusu
www.linkedin.com/in/kolusu |
|