View previous topic :: View next topic
|
Author |
Message |
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
Hi Team - I have a input file VB file containing trailer with incorrect record count. Input has different RDW for different records based on the record length.
Using the SORT card shown below, I am updating the count value I need in trailer.
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(2000:SEQNUM,7,PD)),
IFTHEN=(WHEN=(141,3,CH,EQ,C'TRL'),
OVERLAY=(543:2000,7,PD,SUB,+1,TO=PD,LENGTH=7)) |
Unfortunately, the SORTOUT file has incorrect RDW value, 1999 for all the records. I have given the record length in JCL DCB parameter as 1999.
The record length of the output is per need but seems like the OVERLAY is messing up the RDW for SORTOUT.
Any constructive feedback appreciated. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
It is not OVERLAY, but yourself who is messing up the RDW for SORTOUT.
You MUST take into account the RDW in each record as if it was a part of your record. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
|
|
Try the following instead:
Code: |
OPTION COPY
OUTFIL IFTRAIL=(TRLID=(141,3,CH,EQ,C'TRL'),
TRLUPD=(543:COUNT=(PD,LENGTH=7)))
END |
|
|
Back to top |
|
|
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
It worked fine. Thanks! |
|
Back to top |
|
|
|