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 Matched / Unmatched records

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
gkanswa

New User


Joined: 09 Feb 2009
Posts: 5
Location: Pune

PostPosted: Tue Mar 02, 2010 6:28 pm    Post subject: Syncsort Matched / Unmatched records
Reply with quote

I need both matched and unmatched records.

I'm able to get the matched and unmatched records:

Code:

  JOINKEYS FILE=F1,FIELDS=(9,6,A,1,7,A)
  JOINKEYS FILE=F2,FIELDS=(1,6,A,7,7,A)
  JOIN UNPAIRED,F2                     
  REFORMAT FIELDS=(F2:1,80)             
  SORT FIELDS=COPY


Input1 (F1)
Code:

1234567 ABCDEF 1111111111
2222222 BBBBBB 4444444444
5555222 CCCCCC 3333333333
2266622 DDDDDD 4466444444


Input2 (F2)
Code:

ABCDEF1234567 WWWWWWWWW
BBBBBB2222222 YYYYYYYYY
BCCCBB2222242 YYYRYYYYY

output
Code:

ABCDEF1234567 WWWWWWWWW
BBBBBB2222222 YYYYYYYYY
BCCCBB2222242 YYYRYYYYY


I need matched and unmatched records in different files.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 7:02 pm    Post subject:
Reply with quote

DO NOT start a new requirement on the end of an existing one, no matter if you do consider them similar. Start a new topic.

This has been asked so many times, you may also consider performing a search of the forum before posting.

Also, because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT and the topic will be moved to the correct forum. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Mar 02, 2010 9:22 pm    Post subject:
Reply with quote

gkanswa wrote:
Code:

  JOINKEYS FILE=F1,FIELDS=(9,6,A,1,7,A)
  JOINKEYS FILE=F2,FIELDS=(1,6,A,7,7,A)
  JOIN UNPAIRED,F2                     
  REFORMAT FIELDS=(F2:1,80)             
  SORT FIELDS=COPY

.
.
.
I need matched and unmatched records in different files.

If you need two files, why didn't you use two outputs?

You should add the F1 keys in the REFORMAT and use two OUTFILs including/omiting based upon the presence/absence of those keys.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Mar 03, 2010 2:24 am    Post subject: Re: Syncsort Matched / Unmatched records
Reply with quote

gkanswa wrote:
Code:
  JOIN UNPAIRED,F2                     
  REFORMAT FIELDS=(F2:1,80)             
  SORT FIELDS=COPY

That is essentially just a copy of the original F2.

In order to create a file for matched records, and a separate file for unmatched records, try this:
Code:

//S1     EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTJFN1 DD DSN=Input.File1
//SORTJNF2 DD DSN=Input.File2
//SORTOF01 DD DSN=Matched.Records
//SORTOF02 DD DSN=Unmatched.Records
//SYSIN    DD *
  JOINKEYS FILE=F1,FIELDS=(9,6,A,1,7,A)
  JOINKEYS FILE=F2,FIELDS=(1,6,A,7,7,A)
  JOIN UNPAIRED,F2                     
  REFORMAT FIELDS=(F2:1,80,F1:1,13)             
  SORT FIELDS=COPY
  OUTFIL FILES=01,INCLUDE=(81,13,CH,NE,C' '),BUILD=(1,80)
  OUTFIL FILES=02,SAVE,BUILD=(1,80)
/*

This will not include unmatched records from F1. If you also want those records, the above control statements will need to be modified accordingly.
Back to top
View user's profile Send private message
gkanswa

New User


Joined: 09 Feb 2009
Posts: 5
Location: Pune

PostPosted: Fri Mar 05, 2010 11:16 am    Post subject: Reply to: Syncsort Matched / Unmatched records
Reply with quote

Thanks a lot Alissa..!!

This is working for me ..

Hi Expat,
I will take your advise and will make sure will follow the same in all my future posts.
Thanks a lot..!!
Back to top
View user's profile Send private message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 32
Location: India

PostPosted: Wed Nov 08, 2017 9:48 pm    Post subject:
Reply with quote

Hi all,

This was also my requirement. The coding helped me too.

But additionally I have a query. I am getting the unmatch file as desired.

In match file, I want only one record which has "ACTION" starting from second position.

Is there any way to add a condition to the match file.

Thanks!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2034
Location: UK

PostPosted: Wed Nov 08, 2017 10:29 pm    Post subject:
Reply with quote

A) Do NOT tailgate someone else's topic - there is a post in this topic that expressly says this and you ignored it.
B) Do NOT post to old topics.
C) Locked
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 Need Help to Create 4 Output Records ... satish.ms10 DFSORT/ICETOOL 4 Thu Jul 19, 2018 1:55 am
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm

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