Syncsort Comparing different fields from 1 file to 2nd file



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Syncsort Comparing different fields from 1 file to 2nd file

Postby teacher01 » Fri Apr 29, 2011 12:52 am

Hello All,

I have to compare the values from File 1 to File 2. The values of File 1 are

AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
GGGGGGG HHHHHH JJJJJJJJ KKKKKKKKK

The value in File 1 is in 4 different fields, starting from col 1 to 8 and then again from col 10 to 17.

My File 2 has the values that is present in column 1 to 8

AAAAAAAA
BBBBBBBBB
CCCCCCCC
DDDDDDDD
EEEEEEEEE
FFFFFFFFF

So I used the JOINKEY and performed a match on both files. But the match is performed only on col 1 to 8.
Here is the JCL
//PS070 EXEC PGM=SORT
//SORTJNF1 DD DSN=TEST.EVENT.SORT,DISP=SHR
//SORTJNF2 DD DSN=TEST.OCC.SORT,DISP=SHR
//FBOUT DD DSN=TEST.FINAL.OUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(5,20),RLSE),
// DCB=SYS3.DSCB
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
REFORMAT FIELDS=(F1:1,8,F2:1,8)
SORT FIELDS=(1,8,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1,8)
OUTFIL FNAMES=FBOUT
/*


How do i make sure that all the columns from FILE 1 get compared with COLUMN in FILE 2.

I tried specifying

JOINKEYS FILE=F1,FIELDS=(1,8,A,10,8,A,19,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)

But I got an error mentioning the no. of keys need to be equal,

so I changed it to

JOINKEYS FILE=F1,FIELDS=(1,8,A,10,8,A,19,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A,1,8,A,1,8,A)

but I did not get any results...

Any suggestions ....?
teacher01
 
Posts: 2
Joined: Fri Apr 29, 2011 12:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort Comparing different fields from 1 file to 2nd file

 

Re: Syncsort Comparing different fields from 1 file to 2nd

Postby Alissa Margulies » Fri Apr 29, 2011 8:01 pm

Teacher01,

What are you expecting in your output? Please show the desired output based on your sample input data.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Syncsort Comparing different fields from 1 file to 2nd

Postby teacher01 » Sun May 01, 2011 2:43 am

The output file should be in one column that has values matched for all the columns in File 1.

AAAAAAAA
BBBBBBBB
CCCCCCCC
DDDDDDDD
teacher01
 
Posts: 2
Joined: Fri Apr 29, 2011 12:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort Comparing different fields from 1 file to 2nd

Postby Alissa Margulies » Sat May 07, 2011 1:53 am

If the records in File 1 are:

AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
EEEEEEEEE XXXXXXXX YYYYYYYYY ZZZZZZZZZ
GGGGGGG HHHHHH JJJJJJJJ KKKKKKKKK

Should the output include EEEEEEE? Or do all 4 fields need to have a match in File 2?
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post