View previous topic :: View next topic
Author
Message
Gaurav Bhayawala New User Joined: 17 Apr 2008Posts: 14 Location: Pune
I have two input files...
File1:
AAA
BBB
CCC
DDD
...
...
...
File2:
111
222
333
444
555
In File-1 so many Records & in File-2 only 5 records...
Now I want 1 output file (File-3) in following way
File3:
AAA 111
AAA 222
AAA 333
AAA 444
AAA 555
BBB 111
BBB 222
BBB 333
BBB 444
BBB 555
---
---
---
---
Please provide me solution for these if anyone has faced this situation
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Gaurav Bhayawala,
The following DFSORT JCL will give you the desired results
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your file2 with 5 records,
// DISP=SHR
//SORTOUT DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(C'VALUE',SEQNUM,2,ZD,C',C''',1,3,C'''',80:X)
/*
//STEP0200 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&T1,DISP=SHR
//SORTIN DD DSN=your large input file,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL BUILD=(1,3,X,VALUE01,/,
1,3,X,VALUE02,/,
1,3,X,VALUE03,/,
1,3,X,VALUE04,/,
1,3,X,VALUE05)
/*
Hope this helps...
Cheers
Back to top
Gaurav Bhayawala New User Joined: 17 Apr 2008Posts: 14 Location: Pune
Thanks Skolusu
This approach is working..
Back to top
zawx New User Joined: 28 Feb 2008Posts: 21 Location: china
If every one input file have one million records,
the 'OUTFIL BUILD' in stp0200 write
OUTFIL BUILD=(1,3,X,VALUE01,/,
1,3,X,VALUE02,/,
1,3,X,VALUE03,/,
1,3,X,VALUE04,/,
1,3,X,VALUE05,/,
...
1,3,x,VALUE1000000)
Is it right?
Back to top
Please enable JavaScript!