Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2287
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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us