Joinkey without SORTING



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Joinkey without SORTING

Postby rockstar2020 » Mon Jun 30, 2014 3:59 pm

I am looking for solution to my requirement any help would be appreciated.

FIle 1 -
ALEX A 55000
BOB  B 25000
JOHN A 45000
MECH C 12000
ZETA D 11000


File -2
MECH WWWWWW
ZETA XXXXXX
BOB  EEEEEE
ALEX RRRRRR


Required O/P FILE-
MECH WWWWWW 12000
ZETA XXXXXX 11000
BOB  EEEEEE 25000
ALEX RRRRRR 55000


Code -
//SYSIN DD *                                 
  JOINKEYS FILE=F1,FIELDS=(1,4,A)             
  JOINKEYS FILE=F2,FIELDS=(1,4,A)             
  JOIN UNPAIRED,F2                           
  REFORMAT FIELDS=(F1:1,4,x,F2:13,6)
  OPTION COPY                                 
    OUTFIL FILES=01                           
/*   


Problem I am facing is the o/p gets sorted out of FILE 2 and am getting o/p as below.
ALEX RRRRRR 55000
BOB  EEEEEE 25000
MECH WWWWWW 12000
ZETA XXXXXX 11000


I dont want to sort FILE 2 and instead i just want to join and produce an o/p file without sorting from FILE 2 and looking for o/p as shown in REQUIRED o/p code. Thank you.
rockstar2020
 
Posts: 32
Joined: Wed Jan 08, 2014 3:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Joinkey without SORTING

 

Re: Joinkey without SORTING

Postby BillyBoyo » Mon Jun 30, 2014 5:02 pm

If file 1 is already in sequence, specify SORT,NOSEQCK on the JOINKEYS statement for file 1.

To get the result back into the file 2 sequence, you will need to SORT it (again, it will be sorted for the JOINKEYS).

In JNF2CNTL, append a sequence number (use INCREC OVERLAY or INREC BUILD depending on whether fixed- or variable-length records.

Then in the main task (so after everything for the join in SYSIN) SORT on the sequence number, then OUTREC BUILD to drop off the sequence number.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post