|
View previous topic :: View next topic
|
| Author |
Message |
student_mf
New User

Joined: 15 Jun 2007 Posts: 23 Location: pune
|
|
|
|
Hi krisprems,
i want to compare 2 files based on few keys and if non-matchig record is found it should be outputted in third file .so is it possible to do it with synctool that is ice tool.please suggest.i have posted input files and output files as new topic .please suggest. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
student_mf,
Sorry for a delayed reply, was away from net since some days.
In your JCL you are using multiple WITH & ON, do you want to compare files on differnet keys ?
However, you can try following JCL:
| Code: |
//STEP001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=HLQ.FIRST.FILE,DISP=SHR
//IN2 DD DSN=HLQ.SECOND.FILE,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),
// DISP=(MOD,PASS)
//OUT12 DD DSN=HLQ.MATCHED.OUTPUT,DISP=(NEW,CATLG,DELETE)
//OUT1 DD DSN=HLQ.ONLY.IN.IN1.OUT,DISP=(NEW,CATLG,DELETE)
//OUT2 DD DSN=HLQ.ONLY.IN.IN2.OUT,DISP=(NEW,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT12) ON(1,3,CH) WITH(81,1) -
USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL DD *
INREC OVERLAY=(80:C'11')
/*
//CTL2CNTL DD *
INREC OVERLAY=(80:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT12,INCLUDE=(80,2,CH,EQ,C'12'),BUILD=(1,80)
OUTFIL FNAMES=OUT1,INCLUDE=(80,2,CH,EQ,C'11'),BUILD=(1,80)
OUTFIL FNAMES=OUT2,INCLUDE=(80,2,CH,EQ,C'22'),BUILD=(1,80)
/* |
In above JCL,
HLQ.FIRST.FILE contains
| Code: |
111 $$$$$
222 AAAAA
444 FFFFF
555 GGGGG
888 CCCCC |
HLQ.SECOND.FILE
| Code: |
111 BBBBB
333 DDDDD
444 FFFFF
555 HHHHH |
Both the input files are of LRECL=80, Fixed-Block & there are no duplicate records in an individual file.OUT1 & OUT2 are the desired outpur for your query, OUT12 will have common records of both the files. If the above JCL does not work for you, please provide your both input files. |
|
| Back to top |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
Thanks for redirecting.
By the way, you can call me Anuj.  |
|
| Back to top |
|
 |
loga_nathan_m
New User

Joined: 07 Jun 2007 Posts: 40 Location: India
|
|
|
|
hi all,
i have two files FILE1 and FILE2.
FILE1 contains a list of Telephone numbers(approx 600 records)
FILE2 is of length 200 bytes and contains some data along with Telephone numbers.(approx 33000 records)
Requirement:
If the TN from FILE1 matches with TN in FILE2 i want the entire record from FILE2 to be written on other file.
SUPERC shows me Inserted and Deleted lines but it does not give me the entire 200bytes of FILE2 (only 80 bytes displayed).
i want the entire record.
Kindly reply if u have answers...
thanks in advance. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I believe you will be more satisfied if you use your sort product rather than superc.
If you search in the DFSORT section you may find solutions like what you are looking for. If your system uses Syncsort, there are similar topics in the JCL section. |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| loga_nathan_m wrote: |
Requirement:
If the TN from FILE1 matches with TN in FILE2 i want the entire record from FILE2 to be written on other file. |
This sounds like a great candidate for SyncSort's JOIN feature. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|