Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Join datasets using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Thu Mar 04, 2010 12:21 am    Post subject: Join datasets using Syncsort
Reply with quote

How can I code this sort statement using SYNCSORT.
I have 4 similar SORT joins (4 Steps) in my job and I am planning to bring them into one single step using SYNCSORT.

Code:

//CS98S110  EXEC  PGM=SORT
//SORTJNF1 DD DSN=&&TEMP2,DISP=SHR
//SORTJNF2 DD DSN=&&TEMP1,DISP=SHR
//*
//SYSIN    DD *
   JOINKEYS FILE=F1,
             FIELDS=(1,26,A)
    JOINKEYS FILE=F2,
             FIELDS=(1,26,A)
    JOIN UNPAIRED
    REFORMAT FIELDS=(F1:1,26,F2:1,26)
    SORT     FIELDS=COPY
    OUTFIL   FNAMES=MTCH01,
             INCLUDE=(1,9,CH,NE,C'         ',AND,
                     27,9,CH,NE,C'         ')
//MTCH01   DD DSN=&&MTCH1,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,SPACE=(CYL,(20,5),RLSE)

Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Mar 04, 2010 12:35 am    Post subject:
Reply with quote

Quote:
I have 4 similar SORT joins (4 Steps) in my job and I am planning to bring them into one single step using SYNCSORT.
Might help if more was understood on how the eight inputs related to each other and how the join keys related......In other words, more info......
Back to top
View user's profile Send private message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Thu Mar 04, 2010 1:03 am    Post subject: Reply to: Join datasets using Syncsort
Reply with quote

Code:
//S110  EXEC  PGM=SORT
//SORTJNF1 DD DSN=&&TEMP2,DISP=SHR
//SORTJNF2 DD DSN=&&TEMP1,DISP=SHR
//*
//SYSIN    DD *
   JOINKEYS FILE=F1,
             FIELDS=(1,26,A)
    JOINKEYS FILE=F2,
             FIELDS=(1,26,A)
    JOIN UNPAIRED
    REFORMAT FIELDS=(F1:1,26,F2:1,26)
    SORT     FIELDS=COPY
    OUTFIL   FNAMES=MTCH01,
             INCLUDE=(1,9,CH,NE,C'         ',AND,
                     27,9,CH,NE,C'         ')
//MTCH01   DD DSN=&&MTCH1,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,SPACE=(CYL,(20,5),RLSE)
//***************************************************
//S120  EXEC  PGM=SORT
//SORTJNF1 DD DSN=&&MTCH1,DISP=SHR
//SORTJNF2 DD DSN=&&TEMP3,DISP=SHR
//*
//SYSIN    DD *
   JOINKEYS FILE=F1,
             FIELDS=(1,26,A)
    JOINKEYS FILE=F2,
             FIELDS=(43,26,A)
    JOIN UNPAIRED
    REFORMAT FIELDS=(F1:1,26,F2:2,14,43,26)
    SORT     FIELDS=COPY
    OUTFIL   FNAMES=MTCH01,
             INCLUDE=(1,9,CH,NE,C'         ',AND,
                     41,9,CH,NE,C'         ')
//MTCH01   DD DSN=&&MTCH2,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,SPACE=(CYL,(20,5),RLSE)
//*************************************************
//S130  EXEC  PGM=SORT
//SORTJNF1 DD DSN=&&MTCH2,DISP=SHR
//SORTJNF2 DD DSN=&&TEMP4,DISP=SHR
//*
//SYSIN    DD *
   JOINKEYS FILE=F1,
             FIELDS=(1,26,A)
    JOINKEYS FILE=F2,
             FIELDS=(1,26,A)
    JOIN UNPAIRED
    REFORMAT FIELDS=(F1:1,40,F2:27,49)
    SORT     FIELDS=COPY
    OUTFIL   FNAMES=MTCH01,
             INCLUDE=(1,9,CH,NE,C'         ',AND,
                     40,9,CH,NE,C'         ')
//MTCH01   DD DSN=&&MTCH3,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,SPACE=(CYL,(10,5),RLSE)
//*************************************************
//S140  EXEC  PGM=SORT
//SORTJNF1 DD DSN=&&TEMP3,DISP=SHR
//SORTJNF2 DD DSN=&&TEMP5,DISP=SHR
//*
//SYSIN    DD *
   JOINKEYS FILE=F1,
             FIELDS=(43,26,A)
    JOINKEYS FILE=F2,
             FIELDS=(1,26,A)
    JOIN UNPAIRED
    REFORMAT FIELDS=(F1:43,27,3,13,F2:27,49)
    SORT     FIELDS=COPY
    OUTFIL   FNAMES=MTCH01,
             INCLUDE=(1,9,CH,NE,C'         ',AND,
                     41,9,CH,NE,C'         ')
//MTCH01   DD DSN=&&MTCH4,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,SPACE=(CYL,(10,5),RLSE)
//***************************************************
Back to top
View user's profile Send private message
sudhakarraju

New User


Joined: 05 May 2005
Posts: 29

PostPosted: Thu Mar 04, 2010 2:30 am    Post subject: Reply to: Join datasets using Syncsort
Reply with quote

I have figured out how to handle this. Thanks for coming forward to help me.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Mar 04, 2010 2:33 am    Post subject:
Reply with quote

Fine, but how about sharing?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Thu Mar 04, 2010 6:10 am    Post subject:
Reply with quote

sudhakarraju,

Your INCLUDEs seem to allow ONLY the PAIRED records, Then why would you need a JOIN UNPAIRED statement here?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us