Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8617
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us