Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
Hi All,
I have a requirement to eliminate duplicate records from a flat file, I know it can be done by giving SUM FIELDS = NONE in a sort job, but in my case I have a header record and a trailer record in my input file, and the trailer record consists of the number of records present in the file , pls find the sample file below
The above would be my data inside my file and the trailer record as specified contains the number of records in the file, I have to remove the duplicate in my file but also modify the number of records in my trailer record accordingly, I don;t want to use a COBOL pgm for the sam e , can it be done by SORT, If so please share the sort card. Thanks in advance
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
Hi Murali,
The header record would be identified by '0' in the first byte and the data record would be havin '1' in the 1st byte and the trailer record would be havin '9' in the 1 st byte, the DCB parameters are 80 lrecl and 800 blk and FB format, the header record and trailer record remains constant
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Thamilzan,
Here's a DFSORT job that will handle varying header and trailer records. It creates DFSORT Symbols for the header and trailer information and then uses those Symbols in HEADER1 and TRAILER1.
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
Hi Frank,
I got the JCL but as per my requirements (Which changes Often!!!!!), I need to add 2 to my record count at my trailer record, say if there are 5 data records , the downstream PGM expects the record count as 7 (5 data recs and 1 header and 1 trailer record), could you please suggest how this can be done. Thanks in advance.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010), you can now use DFSORT's new IFTRAIL function to do this more easily like this: