MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Processing only detail records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
oneofspace
Beginner


Joined: 18 Nov 2008
Posts: 33
Topics: 14

PostPosted: Wed Nov 10, 2010 1:20 pm    Post subject: Processing only detail records Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Nov 10, 2010 1:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
oneofspace
Beginner


Joined: 18 Nov 2008
Posts: 33
Topics: 14

PostPosted: Thu Nov 11, 2010 12:20 pm    Post subject: Reply with quote

Thanks Kolusu!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group