compare two datasets with jouin keys ?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

compare two datasets with jouin keys ?

Postby samb01 » Fri Jun 14, 2013 7:49 pm

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.
samb01
 
Posts: 236
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare two datasets with jouin keys ?

 

Re: compare two datasets with jouin keys ?

Postby NicC » Fri Jun 14, 2013 8:36 pm

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: compare two datasets with jouin keys ?

Postby skolusu » Fri Jun 14, 2013 9:44 pm

Samb01,

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

http://www.ibm.com/support/docview.wss? ... g3T7000094
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: compare two datasets with jouin keys ?

Postby dick scherrer » Fri Jun 14, 2013 11:44 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: compare two datasets with jouin keys ?

Postby samb01 » Sat Jun 15, 2013 1:01 pm

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...
samb01
 
Posts: 236
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post