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 

Adding Header & Trailer records to the details records

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


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Feb 02, 2011 12:42 pm    Post subject: Adding Header & Trailer records to the details records Reply with quote

Hi,

Can someone help me to add the header & trailer to an input file. Below is the input file with lrecl = 200 & recfm=fb.

Code:

20VISA         20000      1982 
20MASTERCARD   50000      1980 
20DISCOVER     10000      1988 
20AMEX         90000      1970 


I want the output in the following way.The fifth & sixth column of the trailer should give no of detail records & total volume.

Code:

10CARD       SEQ0001      02022011   JOBNAME                           
20VISA         20000      1982                                         
20MASTERCARD   50000      1980                                         
20DISCOVER     10000      1988                                         
20AMEX         90000      1970                                         
90CARD       SEQ0001      02022011   JOBNAME      0000004      001700000



Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 02, 2011 1:06 pm    Post subject: Reply with quote

Sivafdms,

Your total is wrong. The total of values in pos 16 is only 170,000. The following DFSORT JCL will give you the desired results.


Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *
----+----1----+----2----+----3----+----4--                                               
20VISA         20000      1982                                 
20MASTERCARD   50000      1980                                 
20DISCOVER     10000      1988                                 
20AMEX         90000      1970                                 
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,                                             
  HEADER1=('10CARD',14:'SEQ0001',27:DATENS=(MD4),38:'JOBNAME'),
  TRAILER1=('90CARD',14:'SEQ0001',27:DATENS=(MD4),38:'JOBNAME',
            50:COUNT=(M11,LENGTH=7),                           
            64:TOT=(16,5,ZD,M11,LENGTH=9))                     
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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