Aham
New User
Joined: 24 Oct 2007 Posts: 42 Location: chennai
|
|
|
|
I have 4 files with same number of records in order in it with different record lengths as provided below:
FILEN - Record Length of 100
FILE1 - Record Length of 10
FILE2 - Record Length of 10
FILE3 - Record Length of 10
The data present in the 3 files FILE1, FLE2, FILE3 need to be overlayed into the following positions of the file FILEN respectively:
FILE1 data should be overlayed at position 21-30 in file FILEN
FILE2 data should be overlayed at position 41-50 in file FILEN
FILE3 data should be overlayed at position 61-70 in file FILEN
Records in all the files are in proper order such that data from first record of all the 3 files (FILE1,FILE2,FILE3) into the first record of the final file (FILEN) and so on till the last record. |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Aham,
The following DFSORT/ICETOOL JCL will give you the desired results. The working of the job is explained in detail here
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13.2.2?
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEN DD *
ABC 09544 DFH
XYZ 12345 ROI
CYX 43844 AKL
//FILE1 DD *
AAAAAAAAAA
BBBBBBBBBB
CCCCCCCCCC
//FILE2 DD *
DDDDDDDDDD
EEEEEEEEEE
FFFFFFFFFF
//FILE3 DD *
GGGGGGGGGG
HHHHHHHHHH
IIIIIIIIII
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(FILEN) USING(CTL1)
COPY FROM(FILE1) USING(CTL2)
COPY FROM(FILE2) USING(CTL3)
COPY FROM(FILE3) USING(CTL4)
SPLICE FROM(T1) TO(OUT) ON(131,8,PD) WITHEACH -
WITH(101,10) WITH(111,10) WITH(121,10) USING(CTL5)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(101:30X,SEQNUM,8,PD)
//CTL2CNTL DD *
OUTFIL FNAMES=T1,BUILD=(101:1,10,20X,SEQNUM,8,PD)
//CTL3CNTL DD *
OUTFIL FNAMES=T1,BUILD=(101:10X,1,10,10X,SEQNUM,8,PD)
//CTL4CNTL DD *
OUTFIL FNAMES=T1,BUILD=(101:20X,1,10,SEQNUM,8,PD)
//CTL5CNTL DD *
OUTFIL FNAMES=OUT,
BUILD=(01,20,101,10,31,10,111,10,51,10,121,10,71,30)
/* |
The output from this job is
Code: |
ABC 09544 DFH AAAAAAAAAA DDDDDDDDDD GGGGGGGGGG
XYZ 12345 ROI BBBBBBBBBB EEEEEEEEEE HHHHHHHHHH
CYX 43844 AKL CCCCCCCCCC FFFFFFFFFF IIIIIIIIII
|
Hope this helps... |
|