Page 1 of 1

Compare flat file with partial key

PostPosted: Thu Apr 18, 2013 7:23 pm
by Sudh_varma
I Have two flat files with LREC as 10. Fixed Block files. If account number matches then it should check status, if any mismatch in status then create an output file with account number and status field from both files.

Input File 1:

ACCT-Number Status
---------------- --------
111111111 A
222222222 C
333333333 A
555555555 P

Input File 2:

ACCT-Number Status
---------------- --------
111111111 A
222222222 A
333333333 A
444444444 P
555555555 S
666666666 R


OUTPUT

ACCT-Number Status from inputfile-1 Status from inputfile 2
---------------- --------------------------- -------------------------
222222222 C A
555555555 P S

Could any one help please me with SORT card for this...

Thanks,
Sudh

Re: Compare flat file with partial key

PostPosted: Thu Apr 18, 2013 9:16 pm
by BillyBoyo
Looks like a JOINKEYS is needed.

Can you please run this step and post the full sysout so that we can determine whether your level of SORT supports JOINKEYS.

//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
JUST SOME ARBITRARY TEXT
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*

Re: Compare flat file with partial key

PostPosted: Thu Apr 18, 2013 9:31 pm
by Sudh_varma
SYNCSORT LICENSED FOR CPU SERIAL
SYSIN :
OPTION COPY
WER276B SYSDIAG= 491388, 935929, 935929, 1652025
WER164B 6,384K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 332K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER073I SORTIN : DSNAME=AVE9182.AVE91821.JOB28951.D0000101.?
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER074I SORTOUT : DSNAME=NULLFILE
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 216K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN

Re: Compare flat file with partial key

PostPosted: Thu Apr 18, 2013 9:41 pm
by BillyBoyo
Thanks.

OK, so you have SyncSort and your chopped off the release details. Can you post the part which says 1.3.something or 1.4.something, please. The topic will be moved to the SyncSort part of the forum shortly.

Re: Compare flat file with partial key

PostPosted: Thu Apr 18, 2013 9:46 pm
by Sudh_varma
SYNCSORT FOR Z/OS 1.4.0.1R U.S. PATENTS: 4210961, 5117495 (C) 2010 SYNCSO

SYNCSORT LICENSED FOR CPU SERIAL NUMBER C3E92, MODEL 2097 406 LICEN
SYSIN :
OPTION COPY
WER276B SYSDIAG= 491388, 935929, 935929, 1652025
WER164B 6,384K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 332K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER073I SORTIN :
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER074I SORTOUT : DSNAME=NULLFILE
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 216K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN

Re: Compare flat file with partial key

PostPosted: Thu Apr 18, 2013 10:08 pm
by BillyBoyo
OK, you are quite current.

Have a search for JOINKEYS. You can specify the key from your two files, and then produce a REFORMAT with the data you need, then OUTFIL INCLUDE and BUILD for selecting the data and producing your final output.