View previous topic :: View next topic
|
Author |
Message |
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
need to compare two files.
Here is my requirement:
I have two input files
input 1: length 80
input 2: length 268
I need to compare the (1,8,ch) of both the files. The first 8 characters in both the file are the keys (file 2 has duplicates allowed). For those keys available in file 1 I need to find a match in file 2. If match (duplicates should be included) is found I need to write into 3rd file.
Regarding duplicates, there will be duplicates only in file 2. I "do not" want to ignore the duplicates, because each line of duplicate is worth important data. |
|
Back to top |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
hi,
You can use the following DFSORT/ICETOOL code:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (keys in 1-8)
//IN2 DD DSN=... input file2 (FB/268) - keys in 1-8
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/268)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(1,8,CH) -
WITHALL WITH(1,269) WITH(271,8) USING(CTL3)
SORT FROM(T2) TO(OUT) USING(CTL4)
/*
//CTL1CNTL DD *
INREC OVERLAY=(269:C'BB',271:8X)
/*
//CTL2CNTL DD *
INREC OVERLAY=(269:C'AA',271:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=T2,INCLUDE=(269,2,CH,EQ,C'AB')
/*
//CTL4CNTL DD *
SORT FIELDS=(271,8,ZD,A)
OUTREC BUILD=(1,268)
/* |
|
|
Back to top |
|
|
AnjaniK
New User
Joined: 26 Feb 2008 Posts: 2 Location: Hyderabad
|
|
|
|
How to write the same code using DFSORT? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
AnjaniK wrote: |
How to write the same code using DFSORT? |
Why do you ask? DFSORT and ICETOOL are literally one and the same...... |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
hi rajatbagga
Thanks a lot... it worked well
Thanks |
|
Back to top |
|
|
AnjaniK
New User
Joined: 26 Feb 2008 Posts: 2 Location: Hyderabad
|
|
|
|
CICS Guy wrote: |
AnjaniK wrote: |
How to write the same code using DFSORT? |
Why do you ask? DFSORT and ICETOOL are literally one and the same...... |
Sorry for being naive here. You see, they may share the same architecture, though the syntax would be different, right? I just wanted similar syntax for SORT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ICETOOL has been part of DFSORT since 1991 and is fully documented and supported. The ICETOOL operators add functions to DFSORT that can't be performed with just the DFSORT control statements. The ICETOOL operators have their own syntax but use DFSORT control statements as well. So when you ask for "similar syntax for SORT", you're asking a meaningless question. The solution here is to use ICETOOL operators, not just DFSORT control statements. |
|
Back to top |
|
|
|