Please help me out in coding this in a single sort step...
Input file:
----------
Header record
data
Trailer ( actually trailer holds the count of data records and sum of an amount filed in the record)
my requirement is to filter the data records based on condition and update the trailer record with the updated count and summed values of the amount in trailer record.
first digit wil indicate the type of record(header, trailer, data)
output file should be like:
header record
data record(filetered)
Trailer(with modified counts and sum)
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:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
H header
D key1 0100
D key2 0200
D key1 0300
T 3 0600
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(3,4,CH,EQ,C'key1'),
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'T'),
TRLUPD=(3:COUNT=(EDIT=(IT)),
13:TOT=(10,4,ZD,EDIT=(TTTT))))
/*
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see: