MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
entertpa Beginner Joined: 17 Jul 2006 Posts: 3 Topics: 2
Posted: Mon Jul 17, 2006 6:30 am Post subject: Unpaired records from 2 files thru SYNCSORT
Hi,
I am using the below SORT to get the unpaired records from 2 files.I am not able to figure out the mistake that I am doing.Could any body let me know my mistake ?
Code:
//S1 EXEC PGM=SORT
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
----+----1----+----2----+----3----+----4----+----5----+----6--
//SORTJNF1 DD *
35 AN01234512 22
35 AN01234613 99
35 AN01234714 99
//SORTJNF2 DD *
35 AN01234613 23
35 AN01234714 24
35 AN01234815 24
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
JOIN UNPAIRED,F1,F2,ONLY
REFORMAT FIELDS=(F1:1,19,F2:1,19)
SORT FIELDS=COPY
I am expecting the o/p as
Code:
35 AN01234512 22
35 AN01234815 24
where the above SORT is giving the o/p
Code:
35 AN01234512 22
35 AN01234815 24
Thanks&Regards
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 17, 2006 7:50 am Post subject:
entertpa ,
Quote:
REFORMAT FIELDS=(F1:1,19,F2:1,19 )
is the reason for your output. If you want the desired output then try this
Code:
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
JOIN UNPAIRED,F1,F2,ONLY
REFORMAT FIELDS=(F1:1,19,F2:1,19)
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(01,19,CH,EQ,C' '),
OVERLAY=(20,19))
OUTFIL OUTREC=(1,19)
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
bprasanna Beginner Joined: 05 Sep 2003 Posts: 119 Topics: 33 Location: Hyderabad
Posted: Mon Jul 17, 2006 7:54 am Post subject:
Kolusu,
Thanks for the reply.The IF THEN is not working for me.It seems that the latest SYNCSORT version is not available here.
We have the FOR Z/OS 1.2.
Thanks&Regards _________________ ----------------
Thanks&Regards
Bprasanna
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 17, 2006 8:02 am Post subject:
bprasanna ,
bprasanna,
You need SYNCSORT FOR Z/OS 1.2.1.1R which supports IFTHEN. If you don't have that you will need another pass of the data.
or you can try this change command . I am not sure if it is supported in your version
Code:
OUTREC FIELDS=(1,1,CHANGE=(19,C' ',20,19),
NOMATCH=(01,19))
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
entertpa Beginner Joined: 17 Jul 2006 Posts: 3 Topics: 2
Posted: Tue Jul 18, 2006 2:16 am Post subject:
Hi Kolusu,
This also deesn't help in my system.I think SYNCSORT FOR Z/OS 1.2.0.0RI doesn't support this feature as well.
Thanks & Regards
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Jul 18, 2006 8:01 am Post subject:
You would need another pass of data to get the desired results , since the version you have does not support IFTHEN or CHANGE with relative position.
Try this
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
35 AN01234512 22
35 AN01234613 99
35 AN01234714 99
//SORTJNF2 DD *
35 AN01234613 23
35 AN01234714 24
35 AN01234815 24
//SORTOUT DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(01,13,A)
JOINKEYS FILES=F2,FIELDS=(01,13,A)
JOIN UNPAIRED,F1,F2,ONLY
REFORMAT FIELDS=(F1:1,19,F2:1,19)
SORT FIELDS=COPY
OUTFIL OUTREC=(01,19,/,
20,19)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=OLD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(1,19,CH,EQ,C' ')
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum