Posted: Fri Jul 16, 2004 7:06 am Post subject: Count Records on Trailer
I would like to sort an input file and split it into 3 output files (header, detail with duplicate record removed, trailer with count from detail output file):
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Jul 16, 2004 7:47 am Post subject:
Wallace,
If you don't need the detail records in the TRAILER file, all you need is to add NODETAIL parm to SOTOF3 outfil. You also don't require the SORTMSG, SYSPRINT, SYSDUMP dd names.
But to get the updated count excluding the header record is a little bit tricky. The following JCL will give you the desired results.I assumed that your input file LRECL is 80 and is of FB recfm.
We add a seqnum on OUTREC FIELDS which starts from zero. By doing so, the header record is not counted as part of the records. And we use this on the trailer for getting the total detail records after you are done with eliminating the dups.
Hi ALL,
The following Sort Card can be used to have a single output file (header, detail with duplicate record removed, trailer with count from detail output file)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum