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
 
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: 1894
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: 1894
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: 998
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

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