View previous topic :: View next topic
|
Author |
Message |
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
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 |
|
|
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
are there duplicates in either file ? or maybe I should say can there be duplicates in either file ?
Gerry |
|
Back to top |
|
|
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
Hi Gcicchet,
No , there are no duplicates in either file.
Thanks... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
abraralum
New User
Joined: 19 Dec 2010 Posts: 42 Location: Bangalore
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
IIRC, the keyword you want to search for is UNPAIRED
Garry. |
|
Back to top |
|
|
|