Page 2 of 4

Re: Have to compare two datasets

PostPosted: Mon Apr 02, 2012 9:13 pm
by dick scherrer
Hello,

Is there some reason you have not looked in the documentation. . . :(

The "x" is the length.

There are many examples in the forum so even if you are unwilling to look in the manual, everything you need is available here.

Re: Have to compare two datasets

PostPosted: Mon Apr 02, 2012 10:57 pm
by BillyBoyo
Find from a colleague which sort product you are using. If they don't know, ask them to show the messages out of a sort step. ICE messages are DFSORT. WER messages are Syncsort.

Go to the appropriate forum here.

In the search box put JOINKEYS. That'll show you some examples for your sort product.

If you experiment with the fuller search option, you may even find examples matching records.

You should discover that you will need to know RECFM and LRECL for the sort of thing you have described, so far, as what you want.

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 7:36 am
by deva_048
Thanks billy.....

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 11:58 am
by BillyBoyo
No problem. If you want more detail, or get stuck, you have to come back to use with more detail :-) Good luck, and please show your solution to assist others facing the same problem.

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 12:12 pm
by enrico-sorichetti
why post in the JCL section ?
You should have noticed that there are two sections expressly for <SORT> related questions
find out which <SORT> flavor You are running ...
( ICE... messages indicate DFSORT, WER... messages indicate SYNCSORT )
and post Your questions there
both DFSORT and SYNCSORT sections are followed by TOP experts from the relative companies
so just by asking in the right place You will get answers directly for the best!

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 2:49 pm
by deva_048
//OPT EXEC PGM=SORT
//SORTJNF1 DD *
11111
22222
//SORTJNF2 DD *
11111
33333
//SORTOUT DD DSN=ARXA2M.DPAK100.OUT,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,10,A)
JOINKEYS FILE=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F1,ONLY
SORT FIELDS=COPY
/*

Problem is now it is not displaying the result in dataset which mentioned in sortout

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 3:35 pm
by deva_048
NF1 contains 9lakh records
NF2 contains 7 lakh records
Used above posted jcl in control cards (1,21,a) I need to obtain remaining 2 lakhs records
i/p strucuture WILL BE LIKE THIS:
APLU027951387 ,161524310 ,1803565,179 ,04/07/2012,8 ,00992501102000506963 ,0400646871093,0400646871093,4,147020074 ,03/29/2012,C,ICM11300,2012-03-29-20.04.54.439028

SORTJNF1 : RCD IN= 982245,OMITTED= 0,PAIRED= 982245,UNPAIRED= 0
SORTJNF2 : RCD IN= 742926,OMITTED= 0,PAIRED= 742926,UNPAIRED= 0

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 3:52 pm
by BillyBoyo
deva_048 wrote://OPT EXEC PGM=SORT
//SORTJNF1 DD *
11111
22222
//SORTJNF2 DD *
11111
33333
//SORTOUT DD DSN=ARXA2M.DPAK100.OUT,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,10,A)
JOINKEYS FILE=F2,FIELDS=(1,10,A)
JOIN UNPAIRED,F1,ONLY
SORT FIELDS=COPY
/*

Problem is now it is not displaying the result in dataset which mentioned in sortout


Please use the Code tags, it preserves the spacing.

Is this resolved? If not, post the output messages from the step please.

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 3:56 pm
by BillyBoyo
deva_048 wrote:NF1 contains 9lakh records
NF2 contains 7 lakh records
Used above posted jcl in control cards (1,21,a) I need to obtain remaining 2 lakhs records
i/p strucuture WILL BE LIKE THIS:
APLU027951387 ,161524310 ,1803565,179 ,04/07/2012,8 ,00992501102000506963 ,0400646871093,0400646871093,4,147020074 ,03/29/2012,C,ICM11300,2012-03-29-20.04.54.439028

SORTJNF1 : RCD IN= 982245,OMITTED= 0,PAIRED= 982245,UNPAIRED= 0
SORTJNF2 : RCD IN= 742926,OMITTED= 0,PAIRED= 742926,UNPAIRED= 0


This shows that all of the records on both files were matched.

So, you have 742,926 on JNF2, unknown whether there are duplicates. 982,245 on JNF1 which consist of the 742,926 keys (you have specified) on JNF2 plus around 240,000 duplicates of keys on JNF2.

I don't know what you mean by "I need to obtain remaining 2 lakhs records".

You will get no output on your SORTOUT, as you have no unmatched records on JNF1.

Check that your keys are defined correctly, including taking account of RDW for variable-length records if you have them.

Re: Have to compare two datasets

PostPosted: Tue Apr 03, 2012 4:42 pm
by deva_048
Billy,

i want to 982245-742926= 239319
i need to get 239319 records in new dataset. I dont have any unique key in NF1 and NF2 dataset. These 239319 are unmatching records only know . Then why it is not showing in output dataset.Please help me