kalyan.v
New User
Joined: 04 Feb 2008 Posts: 65 Location: Hyd
|
|
|
|
Hi,
I have two input files which are in VB format. I need to format those inputs into output file.
Here is the example:
Code: |
1(6) 15(4) 21(5) 66(8)
111111 1234 aaaaa 3
222222 4567 bbbbb 5
1(5) 33(4) 39(8)
aaaaa 1234 1
bbbbb 4567 2
Output :
1234 aaaaa 3 1
2222 bbbbb 5 2
|
Input format is LRECL = 100, RECFM=VB
How can i get the above output using SORT JCL??
Thanks,
Kalyan |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
kalyan.v,
I assumed that you did not consider the RDW when you gave the positions of the fields in the files. ie. you said the keys start 15 for 4 and 21 for 5 bytes in file1. Since it is a vb file , you need to add 4 bytes of rdw which makes the key positions 19 and 25 respectively
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=your input file 1,DISP=SHR
//IN2 DD DSN=your input file 2,DISP=SHR
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) USING(CTL1)
COPY FROM(IN1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITH(19,8)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,VTOF,BUILD=(37,4,X,5,5,9X,43,8)
//CTL2CNTL DD *
OUTFIL FNAMES=T1,VTOF,BUILD=(19,4,X,25,5,X,70,8,8X)
/* |
The output file is FB and lrecl of 27
Code: |
1234 AAAAA 3 1
4567 BBBBB 5 2
|
|
|