Join this group to access featured content and participate in discussions related to all Syncsort Mainframe Products.

112 Members
Join Us!

JOINKEYS Query

Hi Team,

I have a question, I have two files, like to compare and print if matches not found on file2. So I have coded below logic.

//STEP001 EXEC PGM=SORT

//SORTWK01 DD DSN=&&SORT1,UNIT=3390,

// SPACE=(CYL,(100,100))

//SORTWK02 DD DSN=&&SORT2,UNIT=3390,

// SPACE=(CYL,(100,100))

//SORTWK03 DD DSN=&&SORT3,UNIT=3390,

// SPACE=(CYL,(100,100))

//SORTWK04 DD DSN=&&SORT4,UNIT=3390,

// SPACE=(CYL,(100,100))

//SORTJNF1 DD DSN=SYS2.G08.SPMS.DBREC.DETAIL,DISP=SHR

//SORTJNF2 DD DSN=SYS2.G08.SPMS.DMREC.DETAIL,DISP=SHR

//NOMATCH DD DSN=SYS2.G08.SPMS.MCNOMAT,UNIT=3390,DISP=(,CATLG,DELETE)

// SPACE=(CYL,(10,10))

//SYSOUT DD SYSOUT=E

//SORTOUT DD DSN=&&SORTOUT,UNIT=3390,

// SPACE=(CYL,(100,100))

//SYSIN DD *

JOINKEYS FILE=F1,FIELDS=(1,44,A)

JOINKEYS FILE=F2,FIELDS=(1,44,A)

JOIN UNPAIRED,F1,F2

REFORMAT FIELDS=(F1:1,44,F2:1,44),FILL=C'#'

SORT FIELDS=COPY

OUTFIL FNAMES=NOMATCH,

INCLUDE=(01,01,CH,EQ,C'#',AND,45,01,CH,NE,C'#'),BUILD=(45,44)

/*

DB Record Sample: File1:

AOPSTART.D089.T1737207.P3040D49                                2016090
XXX.AGTNYLCV                                                   1994325
XXX.AGTNYLIC                                                   1995058
XXX.AIINA00O                                                   1994325
XXX.AIOLD00O                                                   1994325
XXX.ALAGA001                                                   1995058
XXX.ALAGI001                                                   1995058
XXX.ALMASTER                                                   1994325
XXX.APINA00O                                                   1994325
XXX.APOLD00O                                                   1994325
XXX.CDMASTER                                                   1994325
XXX.CDRMODEL                                                   1994325
XXX.CDRUNIT                                                    1995058
XXX.CGM                                                        1994325
XXX.ELPOL002                                                   1994325
XXX.ELPOL003                                                   1994325
XXX.EPEHS000                                                   1994325
XXX.EPEMP000                                                   1994325
XXX.EPPHS000                                                   1994325
XXX.EPPOL000                                                   1994325
XXX.ESEMP001                                                   1994325
XXX.ESEMP002                                                   1994325

DMREC Sample : File2

AOPSTART.D089.T1737207.P3040D49                    2016334     2016090 16:11:36.829 DEFALTMC 
YYY.AGTNYLCV                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.AGTNYLIC                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.AIINA00O                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.AIOLD00O                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.ALAGA001                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.ALAGI001                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.ALMASTER                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.APINA00O                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.APOLD00O                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.CDMASTER                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.CDRMODEL                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.CDRUNIT                                        2002339     1980852 0:00:00.000 SYSGMC    
YYY.CGM                                            2002339     1980852 0:00:00.000 SYSGMC    
YYY.ELPOL002                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.ELPOL003                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.EPEHS000                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.EPEMP000                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.EPPHS000                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.EPPOL000                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.ESEMP001                                       2002339     1980852 0:00:00.000 SYSGMC    
YYY.ESEMP002                                       2002339     1980852 0:00:00.000 SYSGMC    

I am able to print it if the records are not matched on File2. But I am able to print only 44 Chars(Dataset name alone). Is there a way to print entire record if the records are not matched on File2 after dataset compare ????.

Right now, I am getting only below o/p,

AOPSTART.D089.T1737207.P3040D49   
YYY.AGTNYLCV                      
YYY.AGTNYLIC                      
YYY.AIINA00O                      
YYY.AIOLD00O                      
YYY.ALAGA001                      
YYY.ALAGI001                      
YYY.ALMASTER                      
YYY.APINA00O                      
YYY.APOLD00O                      
YYY.CDMASTER                      
YYY.CDRMODEL                      
YYY.CDRUNIT                       
YYY.CGM                           
YYY.ELPOL002                      
YYY.ELPOL003                      
YYY.EPEHS000                      
YYY.EPEMP000                      
YYY.EPPHS000                      
YYY.EPPOL000                      
YYY.ESEMP001                      
YYY.ESEMP002      

Any help, much appreciated. Thanks.

Kind regards,

Anthony

You need to be a member of Syncsort Community to add comments!

Join Syncsort Community

Email me when people reply –

Replies

  • Hi All,

    Please skip above query., I am able to tidy up using below,

    //SYSIN DD *

    JOINKEYS FILE=F1,FIELDS=(1,44,A)

    JOINKEYS FILE=F2,FIELDS=(1,44,A)

    JOIN UNPAIRED,F1,F2

    REFORMAT FIELDS=(F1:1,44,F2:1,92),FILL=C'#'

    SORT FIELDS=COPY

    OUTFIL FNAMES=NOMATCH,

    INCLUDE=(01,01,CH,EQ,C'#',AND,45,01,CH,NE,C'#'),BUILD=(45,92)

    /*

    Kind regards,

    Anthony

This reply was deleted.

To access Syncsort Knowledge Base, visit:

My Support