Comparation between 2 datasets



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

Comparation between 2 datasets

Postby vegafacundodaniel » Tue Aug 30, 2011 7:51 pm

I want to match keys of a field in a dataset with keys of a field in another dataset.
vegafacundodaniel
 
Posts: 61
Joined: Tue Jul 20, 2010 4:27 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Comparation between 2 datasets

 

Re: Comparation between 2 datasets

Postby Frank Yaeger » Tue Aug 30, 2011 11:31 pm

vegafacundodaniel,

For examples with DFSORT, see the "Create files with matching and non-matching records" Smart DFSORT Trick at:

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

If you need more specific help, please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Comparation between 2 datasets

Postby Mainframe_bhing » Wed May 22, 2013 1:29 am

Thanks Frank ! I also have same open thread on ibmmainframes.com.

I have 2 files like (Sample data)

FILE-1 : VB 133. KEY : 1st 4 position.

0001 ABCD 2013-05-01
0005 SDSA 2013-05-01
0004 SDAD 2013-05-01
0002 DASD 2013-05-01

FILE-2 : VB 133. KEY : 1st 4 position.

0006 ADAS 2013-05-02
0001 ABCD 2013-05-02
0008 DSDA 2013-05-02
0007 SDAW 2013-05-02
0002 DASD 2013-05-01

Need to compare the Keys in the FILE-1 and FILE-2 and created the 3rd file which will have all non matching records and if we have matching key records then copy the record from FILE-B to the output file.

FILE-OUT may look like this:

0001 ABCD 2013-05-02
0002 DASD 2013-05-01
0004 SDAD 2013-05-01
0005 SDSA 2013-05-01
0006 ADAS 2013-05-02
0007 SDAW 2013-05-02
0008 DSDA 2013-05-02

By looking at the manual I tried many things yesterday but was only able to create the matching key files, but when I replace the key lengths in REFORMAT with entire record length the jobs fails "Error:REFORMAT FIELD OUTSIDE RANGE".

By reading manual I came up with following card :

//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(5,15,A)
JOINKEYS FILE=F2,FIELDS=(5,15,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:5,129,F2:5,129),FILL=C'$'
SORT FIELDS=COPY
OUTFIL INCLUDE=(130,1,CH,NE,C'$',AND,1,1,CH,NE,C'$'),
BUILD=(130,129)
/*


COuld you please help to know if this can be achieved using JOINKEYS with the VB file lengths which I have ? Or do I need to try some different approach ?

THanks !
Mainframe_bhing
 
Posts: 3
Joined: Wed May 22, 2013 12:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparation between 2 datasets

Postby Akatsukami » Wed May 22, 2013 1:31 am

Mr. Yaeger retired a year ago, kusomushi.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Comparation between 2 datasets

Postby Mainframe_bhing » Wed May 22, 2013 2:02 am

I know I can achieve this by Easytrieve and have also tested it with sample file.

But I need to implement the solution for 300 files thus exploring if there is any other way by which it would be faster execution and easily customized for 300 different files with different keys.

If I had time to learn try and research using manual then I would have never come to the forum for solution. I will sure read manual and do trial and errors once my project is implemented and I can devote some time to this learning then.

If you can help to address the raised issue it will be appreciated.

Sarcasm is good to boost one's ego but not good for any solution.

Thanks !
Mainframe_bhing
 
Posts: 3
Joined: Wed May 22, 2013 12:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: Comparation between 2 datasets

Postby Akatsukami » Wed May 22, 2013 2:37 am

That wasn't sarcasm, kusomushi; Mr. Yaeger did retire a year ago. Moreover, he was (and Mr Kolusu is) a DFSORT developer; you apparently use Syncsort, a competitive product.

I wrote the job you're whining about on our sister board in 50 minutes...without a manual (I don't have one written in this century), but by searching and reading fora on the two boards. Judging by your join date on the other board, you have about one-fifth the experience that I do; you are therefore permitted to take five times as long to come up with a solution. Get. To. Work.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post