Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort - File match using Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - File match using Sort
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

Site Director


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

PostPosted: Wed Dec 10, 2008 3:34 am    Post subject:
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: 2285
Location: @my desk

PostPosted: Wed Dec 10, 2008 10:02 am    Post subject:
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    Post subject: Reply to: Syncsort - File match using Sort
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us