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
 

 

write matched and unmatched records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Sun Mar 27, 2011 10:49 pm    Post subject: write matched and unmatched records
Reply with quote

Hi,

I am trying the below:

File1 , RecLen:80 and RecFmt:FB.
AA11198
BB78990
CC87690

File2, RecLen:80 and RecFmt:FB.
AA11198
GGG8970
CC87690

I want to compare these two files and write the matching records to one file and unmatched records to other file(Sync Sort).

I tried with the options available in the Forum but could be successful. Any pointers will be greatly helpful.

Thanks...
Back to top
View user's profile Send private message

abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Sun Mar 27, 2011 10:52 pm    Post subject: write matched and unmatched records
Reply with quote

Hi,

(Corrected the Typo)

I am trying the below:

File1 , RecLen:80 and RecFmt:FB.
AA11198
BB78990
CC87690

File2, RecLen:80 and RecFmt:FB.
AA11198
GGG8970
CC87690

I want to compare these two files and write the matching records to one file and unmatched records to other file(Sync Sort).

I tried with the options available in the Forum but could not be successful. Any pointers will be greatly helpful.

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

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Mon Mar 28, 2011 12:46 am    Post subject:
Reply with quote

Quote:
options available in the Forum but could not be successful


Which 'options'. How were you unsuccessful i.e. what errors did you get with what control info?

Mind-reading day was yesterday.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Mar 28, 2011 2:59 am    Post subject:
Reply with quote

Hi,

are there duplicates in either file ? or maybe I should say can there be duplicates in either file ?


Gerry
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Mon Mar 28, 2011 11:37 am    Post subject:
Reply with quote

Hi Gcicchet,

No , there are no duplicates in either file.

Thanks...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Mar 28, 2011 2:38 pm    Post subject:
Reply with quote

Hi,

as you have answered my questions although I don't know why you could not have provided the information requested by Nic, here is a solution

Code:
//S1       EXEC PGM=SYNCTOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN1      DD *                                                     
AA11198                                                             
BB78990                                                             
CC87690                                                             
//         DD *                                                     
AA11198                                                             
GGG8970                                                             
CC87690                                                             
/*                                                                 
//ALLDUPS  DD SYSOUT=*                                             
//NONDUPS  DD SYSOUT=*                                             
//TOOLIN   DD *                                                     
SELECT FROM(IN1) TO(ALLDUPS) ON(1,80,CH) ALLDUPS DISCARD(NONDUPS)   
/*                                                                 


Gerry
Back to top
View user's profile Send private message
abraralum

New User


Joined: 19 Dec 2010
Posts: 42
Location: Bangalore

PostPosted: Wed Mar 30, 2011 3:46 pm    Post subject:
Reply with quote

Hi Gerry,

Thanks for the above. I tried above and working fine.

I couldn't answer Nic as I was not havin access to check and provide the code at that time.

Nic, I am trying below:

Code:

//S1 EXEC PGM=SORT               
//SRTMSG DD SYSOUT=*                 
//SORTJNF1 DD *                       
A123B                         
A222B                         
A333C                         
//SORTJNF2 DD *                       
A111B                         
A222B                         
A333C                 
//SORTOUT DD SYSOUT=*                 
//SORTXSUM DD SYSOUT=*               
//SYSUDUMP DD SYSOUT=*               
//SYSOUT DD SYSOUT=*                 
//SYSIN DD *                         
  JOINKEYS FILES=F1,FIELDS=(1,5,A)   
  JOINKEYS FILES=F2,FIELDS=(1,5,A)   
  REFORMAT FIELDS=(F1:1,5,F2:1,5)     
  SUM FIELDS=NONE,XSUM               
  SORT FIELDS=(1,5,CH,A)             
/*                         



From above , I am getting the matched records, however not getting the unmatched ones (ie, the values to XSUM).

Ideally, I expect the SORTXSUM DD SYSOUT=* to contain unmatched records. Please point me if I am missing anything here...
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1756
Location: UK

PostPosted: Wed Mar 30, 2011 8:39 pm    Post subject:
Reply with quote

Actually I have never used SYNCSORT and do not have access to the manual but there will be an option that you have to specify to enable discards to be kept. Check the index for things like DUPS DISCARDS UNMATCHED.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Mar 31, 2011 11:59 am    Post subject:
Reply with quote

IIRC, the keyword you want to search for is UNPAIRED

Garry.
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 Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am


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