Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

merge files after altering the records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Mar 20, 2008 3:17 pm    Post subject: merge files after altering the records
Reply with quote

hi,

i have 2 files one with header and trailer and the other with detailed records..

now i need to merge these 2 files into one so that the detailed records comes
in between the header and trailer.

ie file 1 is 35 bytes with header and trailer

ASHIMER 15:2306/08/200706/08/2007
TRLR000005

and file 2 has the detailed records with record count of 5

now the new output file should have the header as he first record with the format changed as

HASHIMER****06/08/2007 (* is spaces) where date is the first date mentioned in the above original header
then followed by detailed records and
then trailer as

T000005

the LRECL for first file is 35 and 2nd file is 150 ..


kindly help
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 20, 2008 4:00 pm    Post subject:
Reply with quote

Use IDCAMS REPRO -
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Mar 20, 2008 4:07 pm    Post subject:
Reply with quote

expat,

can you pls provide the code ?

thanks,
ashimer
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Thu Mar 20, 2008 4:40 pm    Post subject:
Reply with quote

Here is an Syncsort Job.
Code:

//S1      EXEC PGM=SYNCTOOL         
//TOOLMSG DD SYSOUT=*               
//DFSMSG  DD SYSOUT=*               
//IN1     DD *                     
ASHIMER 15:2306/08/200706/08/2007   
TRLR000005                         
/*                                 
//*                                 
//IN2     DD *                     
RECORD NO 1                         
RECORD NO 2                         
RECORD NO 3                         
RECORD NO 4                         
/*
//OUT1    DD DSN=OUTPUT-FILE-NAME,                 
//      DSORG=PS,RECFM=FB,SPACE=(TRK,(1,1),RLSE), 
//      DISP=(MOD,CATLG,DELETE)                   
//TOOLIN  DD *                                     
    COPY FROM(IN1) TO(OUT1) USING(SRT1)           
    COPY FROM(IN2) TO(OUT1)                       
    COPY FROM(IN1) TO(OUT1) USING(SRT2)           
/*
//SRT1CNTL DD *                                               
    OPTION COPY                                               
    OUTFIL STARTREC=1,ENDREC=1,OUTREC=(C'H',1,7,4X,14,10,128X)
/*                                                             
//SRT2CNTL DD *                                               
    OPTION COPY                                               
    OUTFIL STARTREC=2,OUTREC=(1,1,5,6,143X)                   
/*                                                             


Output:
Code:

HASHIMER    06/08/2007
RECORD NO 1           
RECORD NO 2           
RECORD NO 3           
RECORD NO 4           
RECORD NO 5           
T000005               


--Parag
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Mar 20, 2008 6:07 pm    Post subject:
Reply with quote

thanks for the reply parag


but it is giving problem with LRECL ...
my IN1 is 35 and IN2 is 361 and output file shud be 361 ...

pls help
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Thu Mar 20, 2008 7:26 pm    Post subject:
Reply with quote

Change the sort cards to
Code:

//SRT1CNTL DD *                                               
    OPTION COPY                                               
    OUTFIL STARTREC=1,ENDREC=1,OUTREC=(C'H',1,7,4X,14,10,339X)
/*                                                           
//SRT2CNTL DD *                                               
    OPTION COPY                                               
    OUTFIL STARTREC=2,OUTREC=(1,1,5,6,354X)                   
/*                                                           


--Parag
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us