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 

Append records between header & trailer

 
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: Tue Jan 18, 2011 11:11 pm    Post subject: Append records between header & trailer Reply with quote

Hi,



I have two files file01 & file02. I need to concatenate both files and output should be in the format of file03. In each input file the trailer record indicate the no of records in the file.

Could someone please provide the sortcard?



file01

Code:


header

rec1

rec2

rec3

tralier3





file02

Code:


header

rec4

rec5

rec6

tralier3





file03

Code:


header

rec1

rec2

rec3

rec4

rec5

rec6

tralier6





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 Jan 19, 2011 11:36 am    Post subject: Reply with quote

sivafdms,

You have been a member for close to 4 years now and you still haven't provided complete details.

1. What is the LRECL and RECFM of file 1 and file2?
2. Is there anything that distinguishes the header and trailer records in both files?
3. Is the final count on the trailer record just 1 byte? what is the format of the count?
4. Did you misspell the word TRAILER?
5. What sort product are you using?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Jan 19, 2011 11:55 am    Post subject: Reply with quote

Hi Kolusu,

Sorry for not providing all the details. Please find them below

1.The LRECL=80 & RECFM=FB of all the three files.
2.Header is identifiled by HDR & Trailer by TLR.
3.The maximum count can be of 9999999. Format is numeric.
4.Yes.
5.DFSORT.

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 Jan 19, 2011 12:01 pm    Post subject: Reply with quote

sivafdms,

Use the following DFSORT JCL
Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                     
HDR                                                                 
REC1                                                               
REC2                                                               
REC3                                                               
TLR                                                                 
//         DD *                                                     
HDR                                                                 
REC1                                                               
REC2                                                               
REC3                                                               
TLR                                                                 
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                 
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
  IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),OVERLAY=(89:SEQNUM,1,ZD,START=0)),
  IFTHEN=(WHEN=(1,3,CH,EQ,C'TLR'),                                 
  OVERLAY=(4:81,8,ZD,SUB,+4,M11,LENGTH=8,89:SEQNUM,1,ZD))           
                                                                   
  OUTFIL BUILD=(1,80),OMIT=(1,3,SS,EQ,C'HDR,TLR',AND,89,1,ZD,EQ,1) 
//*


The output from this job is

Code:

HDR         
REC1       
REC2       
REC3       
REC1       
REC2       
REC3       
TLR00000006

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Feb 02, 2011 12:10 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