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 

Get common records using Syncsort

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


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Dec 18, 2003 12:43 am    Post subject: Get common records using Syncsort Reply with quote

Hi,

I have two sorted files, FILE1 and FILE2 and I want to get records that are common to both. It seems there are many solutions using DFSORT but I couldn't search any using syncsort.

Thanks,
Diba.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 18, 2003 6:21 am    Post subject: Reply with quote

Dibakar,

If you are just interested to know the matched records , then use SUM FIELDS=NONE With SORT FIELDS=entire LRECL

You can also change the pgm name from ICETOOL to synctool and run the same JCL. However not all solutions will work( ex: splice...)

Why don't you post your requirement ?

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


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Fri Dec 19, 2003 1:58 am    Post subject: Reply with quote

Here is my requirement -

FILEIN1, FILEIN2 and FILEOUT are FB of LRECL 10.

Contents, FILEIN1:
Code:

A
DIBA
LOVES
MVS


Contents, FILEIN2:
Code:

A         
COMMUNITY
FOR       
MVS       
PROGRAMMER


Output in FILEOUT should be:
Code:

A
MVS


FIELDS=NONE is giving
Code:

A         
COMMUNITY
DIBA     
FOR       
LOVES     
MVS       
PROGRAMMER


I tried to use ICEMAN methods but I am having problem with SELECT clause. Does SELECT work with SYNCTOOL?


Thanks,
Diba.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Dec 19, 2003 6:23 am    Post subject: Reply with quote

Dibakar,

The following JCL will give you desired results.
Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
A                                                                   
DIBA                                                                 
LOVES                                                               
MVS                                                                 
A                                                                   
COMMUNITY                                                           
FOR                                                                 
MVS                                                                 
PROGRAMMER                                                           
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
 INREC FIELDS=(1,10,C'1')               $ TOTLA LRECL + CONSTANT 1   
 SORT FIELDS=(1,10,CH,A)                $ SORT ON KEY               
 SUM FIELDS=(11,1,ZD)                   $ SUM ON CONSTANT           
 OUTFIL INCLUDE=(11,1,ZD,GT,1)          $ INCLUDE WHEN SUM GT > 1   
 OUTREC=(1,10)                          $ STRIP THE CONSTANT         
/*                                                                   


Hope this helps...

cheers

kolusu

PS: You can use Select statement with Syncsort's synctool, but it might not work with older versions of syncsort.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Fri Dec 19, 2003 7:04 am    Post subject: Reply with quote

Thanks! Smile
Back to top
View user's profile Send private message Send e-mail
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Mon Jan 05, 2004 5:57 am    Post subject: Reply with quote

Dibakar,

Try this.
Code:

//STEP010 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN    DD DSN=INPUT.FILE1,DISP=SHR                                                     
//                     DSN=INPUT.FILE2,DISP=SHR
//SORTOUT  DD DUMMY
//SORTXSUM DD DSN=OUTPUT.FILE,
//             DISP=(NEW,CATLG,DELETE),                 
//             SPACE=(CYL,(1,1),RLSE),                 
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A)
  SUM FIELDS=NONE,XSUM
/*

Thanks,
Ravikumar
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