MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Matching & Non-matching records problem in Syncsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Thu Apr 12, 2007 7:26 am    Post subject: Matching & Non-matching records problem in Syncsort Reply with quote

Hello,

I have a requirement to create output file using two different files such a way that for the matching key record should come from first file. All non-matching records from both the files should come in output file.

Find below the scenario.

E.g.

File 1
523AAAAM01
524BBBBM01
525CCCCM01

File 2
523XXXXM01
523RRRRM01
524YYYYM01
526DDDDM01

Expected Output File :

523AAAAM01
524BBBBM01
525CCCCM01
526DDDDM01

Here the key field is pos 1 to pos 3. I am using below control card

SORT FIELDS=(1,3,ZD,A) --> To sort the records in ascending order
SUM FIELDS=NONE --> To remove the duplicates in output

I am getting the below output which is not expected.

523AAAAM01 --> Correct
524YYYYM01 --> Wrong!! it should be from File 1 i.e. 524BBBBM01
525CCCCM01 --> Correct
526DDDDM01 --> Correct

Please help me out!!....Also note that I have supplied huge input records !!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 12, 2007 8:01 am    Post subject: Reply with quote

mahesh_chv,

you need to concatenate file 1 first in the concatenation list and also use EQUALS option so that you have the record from file1

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DSN=your file1,disp=shr
//         DD DSN=your file2,disp=shr
//SORTOUT  DD DSN=your output file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD * 
  OPTION EQUALS       
  SORT FIELDS=(1,3,ZD,A)
  SUM FIELDS=NONE
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Thu Apr 12, 2007 9:43 am    Post subject: Reply with quote

Thanks Kolusu!
your solution worked fine.....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group