View previous topic :: View next topic
|
Author |
Message |
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Use IDCAMS REPRO - |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
expat,
can you pls provide the code ?
thanks,
ashimer |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
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 |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
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 |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
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 |
|
|
|