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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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: 8593
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
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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