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

Syncsort - File match using Sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Wed Dec 10, 2008 3:32 am
Reply with quote

Hi All,

I have 2 files and i match both of them based on key fields using the join function. In the reformat fields I fetch specific fields from both the files and write it in the ouput. Following is the sort card that i am using:

Code:
//SYSIN    DD *                                                 

  JOINKEYS FILE=F1,FIELDS=(1,19,A)                               

  JOINKEYS FILE=F2,FIELDS=(1,19,A)                               

  JOIN UNPAIRED,F1                                     

  REFORMAT FIELDS=(F1:1,19,F2,5,4)                                     

  SORT FIELDS=COPY                                               

/*         


I am using unpaired F1 there by fetching all the fields from the 1st file and only the matching from F2. Whenever there is a match I get the value from file 2 , but if there is no match spaces are populated in the fields positions that need to be populated from F2. But I want to change the logic in such a way that if we find match we need to fetch the value from positions 5,4 of F2 else we need to fetch the value from positions 25,4 in F1. Is there a way to do this? Can somebody help on this
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 10, 2008 3:34 am
Reply with quote

Hello,

If you are using JOINKEYS, you are running Syncsort rather than DFSORT.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 10, 2008 10:02 am
Reply with quote

Quote:
Is there a way to do this?
rarvins,

Yes, you can modify your card like this to achieve the same.
Code:
//SYSIN    DD *
  JOINKEYS FILE=F1,FIELDS=(1,19,A)
  JOINKEYS FILE=F2,FIELDS=(1,19,A)
  JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,19,F1:25,4,F2,5,4)
  INREC IFTHEN=(WHEN=(24,4,CH,NE,C' '),OVERLAY=(20:24,4))
  SORT FIELDS=COPY
  OUTREC BUILD=(1,23)
/*
Back to top
View user's profile Send private message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Thu Dec 11, 2008 3:49 am
Reply with quote

Thanks a lot , it worked
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top