MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
oneofspace Beginner Joined: 18 Nov 2008 Posts: 33 Topics: 14
Posted: Wed Nov 10, 2010 1:20 pm Post subject: Processing only detail records
Hi,
I am having a file of length 80 and FB. I have a report in that file and i need to sum a field only in data records and have that value in trailer.
INPUT:
Code: HEADER-*CURR DATE*CYCLE DATE*
DA01$$$$$RMX22222101010AA
DA02$$$$$AGY22222101010AA
DA03$$$$$SRT22222101010AA
DA04$$$$$RMX22222101010AA
TRAILER-*CYCLE DATE*
OUTPUT:
Code: HEADER-*CURR DATE*CYCLE DATE*
DA01$$$$$RMX22222101010AA
DA02$$$$$AGY22222101010AA
DA03$$$$$SRT22222101010AA
DA04$$$$$RMX22222101010AA
TRAILER-*CYCLE DATE*4040*
I want to add the 4 bytes from position 20 and have the total value in the trailer after the cycle date. Date fields are 10 bytes (YYYY/MM/DD).
Thanks!
One.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Nov 10, 2010 1:48 pm Post subject:
oneofspace ,
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 update the trailer record and not consider the header record like shown below
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HEADER-*CURR DATE*CYCLE DATE*
DA01$$$$$RMX22222101010AA
DA02$$$$$AGY22222101010AA
DA03$$$$$SRT22222101010AA
DA04$$$$$RMX22222101010AA
TRAILER-*CYCLE DATE*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTRAIL=(HD=YES,TRLID=(1,7,CH,EQ,C'TRAILER'),
TRLUPD=(21:TOT=(20,4,ZD,M11,LENGTH=4)))
//*
The output from this job is
Code:
HEADER-*CURR DATE*CYCLE DATE*
DA01$$$$$RMX22222101010AA
DA02$$$$$AGY22222101010AA
DA03$$$$$SRT22222101010AA
DA04$$$$$RMX22222101010AA
TRAILER-*CYCLE DATE*4040
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:
http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
oneofspace Beginner Joined: 18 Nov 2008 Posts: 33 Topics: 14
Posted: Thu Nov 11, 2010 12:20 pm Post subject:
Thanks Kolusu!
Back to top
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