IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JOINKEYS - almost done, but slight problem.... Please assist


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Fri May 24, 2013 8:54 pm
Reply with quote

I need to join to update FILE1 with data from FILE2 joining using keys in pos 1-6. If match not found I want to keep FILE1 record intact.
If match found I need to move pos 13-20 from FILE2 to FILE1.
For some reason I'm overriding with blanks unmatched records.

This is my SORT:

Code:
//STEP1 EXEC PGM=SORT                             
//SORTJNF1 DD *                                   
----+----1----+----2----+----3----+----4----+----5
111111FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY         
222222FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY         
333333FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY         
444444FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY         
555555FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY         
666666FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY         
//SORTJNF2 DD *                                   
----+----1----+----2----+----3----+----4----+----5
222222SECONDAAAAAAAAAAAAAAAAAAAABBBBBBBB         
333333SECONDAAAAAAAAAAAAAAAAAAAABBBBBBBB         
555555SECONDAAAAAAAAAAAAAAAAAAAABBBBBBBB         
666666SECONDAAAAAAAAAAAAAAAAAAAABBBBBBBB         
//SORTOF01 DD SYSOUT=*                           
//SYSOUT DD SYSOUT=*                             
//SYSIN    DD    *                               
   JOINKEYS FILES=F1,FIELDS=(1,6,A)               
   JOINKEYS FILES=F2,FIELDS=(1,6,A)               
   JOIN UNPAIRED,F1                         
   REFORMAT FIELDS=(F1:1,40,F2:1,40)       
   SORT FIELDS=COPY                         
   OUTFIL FILES=01,INCLUDE=(1,1,CH,NE,C' '),
   OUTREC=(1,12,53,20,33,8)                 
/*                                         


I get this output - as you see I loose data in the middle...

Code:
----+----1----+----2----+----3----+----4
111111FIRSTF                    YYYYYYYY
222222FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
333333FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
444444FIRSTF                    YYYYYYYY
555555FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
666666FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY


And I need to get this:

Code:
----+----1----+----2----+----3----+----4
111111FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY
222222FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
333333FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
444444FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY
555555FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
666666FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY   
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 24, 2013 9:02 pm
Reply with quote

I believe you are using Syncsort. Can you clarify that?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 24, 2013 9:08 pm
Reply with quote

What is the product are you using DFSORT or SYNCSORT?

And as per your requirement I would expect an output like this

Code:
111111FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY
222222FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
333333FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
444444FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY
555555FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
666666FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Fri May 24, 2013 9:16 pm
Reply with quote

Pandora-Box wrote:
What is the product are you using DFSORT or SYNCSORT?

And as per your requirement I would expect an output like this

Code:
111111FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY
222222FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
333333FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
444444FIRSTFXXXXXXXXXXXXXXXXXXXXYYYYYYYY
555555FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY
666666FIRSTFAAAAAAAAAAAAAAAAAAAAYYYYYYYY


Yes, this is the output I expect.
SYNCSORT
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 24, 2013 9:18 pm
Reply with quote

rmd3003,

You are already advised about posting syncsort questions in the JCL forum and yet you still post in DFSORT forum. Please post your questions in the JCL forum.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri May 24, 2013 9:23 pm
Reply with quote

Ok Please post SYNCSORT questions in JCL forum

And to hint almost done solution

When File 1 key is not present in File 2 ==> 53,20 would be blank
so you need to check for postion 41 and not 1

and Also you might need to add another condition when 41,1 is eq to space all you need is 1,40 from the reformatted data

Please try this using INREC IFTHEN & WHEN=<CONDITION>

If your version of product doesnt support you might need to have two outputfiles with OUTFIL INCLUDE logic
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts z/vm installation problem All Other Mainframe Topics 0
Search our Forums:

Back to Top