View previous topic :: View next topic
|
Author |
Message |
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
Hi,
I need to merge two files into an output filoe.
For Ex: I have the following records in the First Input file
File 1:
KEY
ABCD XXXX
ABCE XXXX Key starts from 1 to 4
ABCF XXXX <<= We can assure that the file is sorted on KEY
File 2:
KEY
YYYYYYYY ABCD
FFFFFF ABCE Ket starts from 30 34
GGG ABCF <<= The file is sorted on the Key
I Expect the output as follows:
ABCD XXXX
YYYYYYYY ABCD
ABCE XXXX
FFFFFF ABCE
ABCF XXXX
GGG ABCF <<< All keys should be sorted
Please let me know how to code using ICETOOL??
~Vamsi |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
ABCD XXXX
ABCE XXXX
ABCF XXXX
/*
//IN2 DD *
YYYYYYYY ABCD
FFFFFF ABCE
GGG ABCF
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SORT FROM(T1) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:1,4)
/*
//CTL2CNTL DD *
INREC OVERLAY=(81:30,4)
/*
//CTL3CNTL DD *
OPTION EQUALS
SORT FIELDS=(81,4,CH,A)
OUTREC BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
Hi Frank,
Ur code worked exactly whatz required,
Thanks alot
~Vamsi |
|
Back to top |
|
|
|