Page 1 of 1

compare two datasets with jouin keys ?

PostPosted: Fri Jun 14, 2013 7:49 pm
by samb01
hello,

i have to compare two datasets.

If the keys from dataset 2 match whith the keys from the first dataset, i remove them from the second dataset .

I have to compare the entire line (lrecl=133)

For example :

File -1:
1111111xxxx
2222222yyyy
4444444zzzz


File-2:
1111111aaaa
1111111xxxx
2222222yyyy
4444444zzzz
3333333aaaa


In the file 3 (result) i would like to have :

File-3:
1111111aaaa
3333333aaaa

The LRECL is 133 et FB.

Thank's for your help.

Re: compare two datasets with jouin keys ?

PostPosted: Fri Jun 14, 2013 8:36 pm
by NicC
So looking in the forum at the many examples that are similar to your requirement what did you come up with and what problems are you having?

Re: compare two datasets with jouin keys ?

PostPosted: Fri Jun 14, 2013 9:44 pm
by skolusu
Samb01,

Look at the Smart DFSORT trick "Create files with matching and non-matching records" here

http://www.ibm.com/support/docview.wss? ... g3T7000094

Re: compare two datasets with jouin keys ?

PostPosted: Fri Jun 14, 2013 11:44 pm
by dick scherrer
Hello,

As has been mentioned before, you are beyond the point where you should need to be spoon-fed.

Clone one of the other processes that do similar to what you want, make the changes you need and post back here if there any problems.

Re: compare two datasets with jouin keys ?

PostPosted: Sat Jun 15, 2013 1:01 pm
by samb01
skolusu wrote:Samb01,

Look at the Smart DFSORT trick "Create files with matching and non-matching records" here

http://www.ibm.com/support/docview.wss? ... g3T7000094


Hello skolusu and thank's for your link. It is really useful.

I found this :

//JK3 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/25)
//IN2 DD DSN=... input file2 (FB/15)
//SORTOUT DD DSN=... output file (FB/15)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(7,9,A)
JOINKEYS F2=IN2,FIELDS=(1,9,A)
JOIN UNPAIRED,F1,ONLY
OPTION COPY
/*


I will try it on Monday.

The exampe with icetool is a little bit less easy to anderstand...


//SEL3 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/25)
//IN2 DD DSN=... input file2 (FB/15)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//** USE MOD FOR T1
// DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/25)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(7,9,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(26:C'1')
/*
//CTL2CNTL DD *
INREC BUILD=(7:1,9,26:C'2')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(26,1,CH,EQ,C'1'),
BUILD=(1,25)


I prefer the sort method...