Page 1 of 1

duplicate records from which file?

PostPosted: Fri Jul 30, 2010 11:45 pm
by ranga_subham
Hi,

I use below JCL to find unique and duplicate records.......

//SYSIN    DD  *       
 SORT FIELDS=(1,4,CH,A)
 SUM FIELDS=NONE,XSUM 
//SORTOUT  DD SYSOUT=*        <-- UNIQUE RECORDS
//SORTXSUM DD SYSOUT=*       <-- DUPLICATE RECORDS
//SYSOUT   DD SYSOUT=*


I request you to help me the SORT card using Joinkeys feature to achieve the same.

Please help.

Thanks.

Re: duplicate records from which file?

PostPosted: Sat Jul 31, 2010 12:12 am
by Alissa Margulies
Your SUM statement does not identify solely the unique records and print them to SORTOUT. It prints the unique records AND the first of equally keyed records to SORTOUT. SORT with a SUM statement can be used with a single or multiple input data sets.

The JOIN feature is used to compare records from two input files, not within a single input file.

What exactly are you trying to do?

Re: duplicate records from which file?

PostPosted: Mon Aug 02, 2010 1:08 pm
by arcvns
The application has to be designed based on the requirement. You seem to have decided to use JOINKEYS, whatsoever the requirement may be! :o

Re: duplicate records from which file?

PostPosted: Mon Aug 02, 2010 8:29 pm
by ranga_subham
I used REFORMAT FIELDS with joinkeys statement to achieve same purpose..... :D

//SYSIN    DD *                   
  JOINKEYS FILE=F1,FIELDS=(1,4,A)
  JOINKEYS FILE=F2,FIELDS=(1,4,A)
  REFORMAT FIELDS=(F1:1,4)       
  SORT FIELDS=COPY               


Thanks.

Re: duplicate records from which file?

PostPosted: Tue Aug 03, 2010 12:22 pm
by arcvns
ranga_subham wrote:I used REFORMAT FIELDS with joinkeys statement to achieve same purpose..... :D

//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,4,A)
JOINKEYS FILE=F2,FIELDS=(1,4,A)
REFORMAT FIELDS=(F1:1,4)
SORT FIELDS=COPY


Thanks.
The above job is nowhere related/equivalent to the one which you showed first. Which purpose you have achieved in common?!!!