Page 1 of 1

JOINKEYS output without SORT

PostPosted: Fri Dec 07, 2012 6:36 pm
by ranga_subham
Hi,

I am using below given JCL to pull matching data from FILE2 but getting it in SORTED which I am not able to avoid :(
We use SYNCSORT FOR Z/OS 1.3.2.2R and it does not have NOSEQCK option :shock:

//SORT0001 EXEC PGM=SORT 
//SORTJNF1 DD *           
ABC123
BOL943
MEK035
//SORTJNF2 DD DSN=ANOTHER.MATCH.FILE,DISP=SHR
//SYSOUT   DD SYSOUT=*                                             
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  JOINKEYS FILE=F1,FIELDS=(1,6,A)                                   
  JOINKEYS FILE=F2,FIELDS=(6,6,A)                                   
  REFORMAT FIELDS=(F2:1,80)                                         


How can I get WITHOUT sorted? Please help.

Thanks.

Re: JOINKEYS output without SORT

PostPosted: Fri Dec 07, 2012 7:43 pm
by BillyBoyo
You don't have NOSEQCK, but you still have SORTED which you can put on the JOINKEYS and the file will not be sorted.

  JOINKEYS FILE=F1,FIELDS=(1,6,A),SORTED

Re: JOINKEYS output without SORT

PostPosted: Fri Dec 07, 2012 7:49 pm
by ranga_subham
I tried it but got U0016 abend !!

SYSIN :                                     
  OPTION COPY                               
  JOINKEYS FILE=F1,FIELDS=(1,6,A),SORTED     
  JOINKEYS FILE=F2,FIELDS=(6,6,A),SORTED     
  REFORMAT FIELDS=(F2:1,80)                 
.
.
WER486A  ERROR IN JNF2 PROCESSING
.
.
WER485A  SORTJNF2 OUT OF SEQUENCE, RECORD NUMBER = 3


Thanks.

Re: JOINKEYS output without SORT

PostPosted: Fri Dec 07, 2012 8:00 pm
by enrico-sorichetti
I am using below given JCL to pull matching data from FILE2 but getting it in SORTED which I am not able to avoid


a join process needs the files sorted on the join key .

if the original sequence is different the only way is to resort on the original
if the original is not sorted on <some> key You should add a sequence number as virtual sorting key

Re: JOINKEYS output without SORT

PostPosted: Fri Dec 07, 2012 8:15 pm
by BillyBoyo
You show one file as sorted, the other you don't show, so it is unsorted.

To match on the keys you show, the second file needs to be in key order. If you then need the output in the original order, you are going to have to sort it again, either on a generated sequence number, or on anything on the file which will give you the original order (If you used EQUALS for any original sorting).