Joined: 20 Jun 2003 Posts: 112 Topics: 48 Location: Bangalore
Posted: Tue Jul 27, 2004 2:43 am Post subject: Merge different LRECL files to a single file
Hi All,
I have 3 files, one with lrecl 20, the 2nd one with lrecl 65 the third with lrecl = 30. I need to merge all these files into one with lrecl = 65.
This can be done by first converting lrecl 20 file to lrecl =65 by padding spaces in the end of each record and so on...but then this involves multiple steps.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Jul 27, 2004 4:45 am Post subject:
Deepesh,
The following DFSORT/ICETOOL JCL will give you desired results. If you syncsort at your shop then change the pgm name to synctool.Make sure that you have DISP=MOD for the Output dataset.
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=YOUR LRECL OF 20 FILE,
// DISP=SHR
//IN2 DD DSN=YOUR LRECL OF 30 FILE,
// DISP=SHR
//IN3 DD DSN=YOUR LRECL OF 65 FILE,
// DISP=SHR
//OUT DD DSN=output file,
// DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL2)
COPY FROM(IN3) TO(OUT)
//CTL1CNTL DD *
OUTREC FIELDS=(1,20, $ COPY 20 BYTES AS IS FROM IN1
65:X) $ PAD SPACES UPTO 65 BYTES
//CTL2CNTL DD *
OUTREC FIELDS=(1,30, $ COPY 30 BYTES AS IS FROM IN2
65:X) $ PAD SPACES UPTO 65 BYTES
/*
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