Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort Joinkey

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
nartcr

New User


Joined: 06 Jun 2007
Posts: 73
Location: Chicago

PostPosted: Thu Jun 02, 2016 3:46 am    Post subject: Syncsort Joinkey
Reply with quote

I am trying to code something with Syncsort.

Code:
FILE1                  FILE 2
COLUMNS                COLUMNS
12345678901234567890   12345678901234567890
--------------------   --------------------
R1TEST1  NARA          TEST1 REC1 NARA   HOME
R2TEST1  NARA          TEST2 REC1 NARA   LIBRA
R2AMER1  NARA          TEST2 REC1 AMAR   GROUN
R2AMER2  RAJE          AMER1 REC1 NARA   MOVIE
R2TEST1  AMAR

FILE 3
COLUMNS
12345678901234567890
--------------------
R1TEST1  NARA  HOME
R2TEST1  NARA  HOME
R2AMER1  NARA  MOVIE
R2AMER2  RAJE  NMTCH
R2TEST1  AMAR  NMTCH


I have 2 input files of same length - 20 bytes. Field1 ( File 1, position 3 onwards for 5 bytes ) have to be compared with Field1 ( file 2, position 1 onwards for 5 bytes ). If they match, i want the field2 ( file 1, position 10 onwards for 4 bytes ) have to be matched with field 2 ( file 2, position 12 onwards for 4 bytes ). If i have a perfect match, i willl update the output file with last 5 bytes of output file, with contents of file 2.

output will have 1-15 contents copied from file 1. 16-20 contents from file 2. If there is match on field1 and field2, 16-20 should contain contents from file 2, otherwise it should contains the letters 'NMTCH'.

I have been reading the manuals, and i am kind of confused with sort keys. Especially since key is not unique here. i tried coding with sequence number. Is this even possible to code wih syncsort or icetool? Or should i code using programs instead?
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Jun 02, 2016 10:30 am    Post subject:
Reply with quote

why to make it difficult? you have to add these two fields (what you explained above) in the JOINKEYS then reformat fields as per what you want once you have that then make a use of parameter marker (?) to set NMATCH by using IFTHEN WHEN in the OUTREC
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Thu Jun 02, 2016 11:17 am    Post subject: Reply to: Syncsort Joinkey
Reply with quote

The keys are the things you are going to match on. Multiple key elements give you one logical key. If your logical keys can be duplicate, on one file or both, then you need some code in SORT to deal with that. There's a question form last week or so, perhaps in the DFSORT part of the forum, which goes into this. It is not difficult.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Syncsort version supporting FINDREP c... juares castro SYNCSORT 9 Tue Aug 09, 2016 6:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us