IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Matching 2 Files in SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Mon Oct 01, 2007 2:22 pm
Reply with quote

File 1
LRECL=80

76938 23
76310 21
74424 22
71292 23
70397 22

File2
LRECL=80

76938 ABCD
78990 ASSKA
76310 EFGT
58172 FGSA
74424 DHT
71292 DTY
47385 WRHFC
70397 DTYL

OUTPUT REQUIRED

ONLY MATCHED AGENT-ID(I.E FIRST 5 BYTES)

THANKS IN ADVANCE
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Oct 01, 2007 2:44 pm
Reply with quote

Looks like fairly standard JOIN matching, search for an example....
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Oct 01, 2007 3:13 pm
Reply with quote

Srivatsa,

Topic is already discussed


www.ibmmainframes.com/viewtopic.php?t=15955&highlight=
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Oct 01, 2007 3:16 pm
Reply with quote

shrivatsa

Code:
//******************************************************************** 
//SORT1    EXEC PGM=SYNCSORT                                           
//SORTJNF1 DD *                                                         
76938 23                                                               
76310 21                                                               
74424 22                                                               
71292 23                                                               
70397 22                                                               
//SORTJNF2 DD *                                                         
76938 ABCD                                                             
78990 ASSKA                                                             
76310 EFGT                                                             
58172 FGSA                                                             
74424 DHT                                                               
71292 DTY                                                               
47385 WRHFC                                                             
70397 DTYL                                                             
//SORTOUT  DD DSN=&&TEMP,DISP=(,PASS),UNIT=SYSDA                       
//SORTOF01 DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  JOINKEYS FILE=F1,FIELDS=(1,5,A)                                       
  JOINKEYS FILE=F2,FIELDS=(1,5,A)                                       
  REFORMAT FIELDS=(F1:1,5)                                             
  SORT FIELDS=COPY                                                     
  OUTFIL FILES=01                                                       
//*                                                                     

O/p SORTOF01 contains:
Code:
70397
71292
74424
76310
76938
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Oct 01, 2007 9:29 pm
Reply with quote

krisprems' application should give the desired output, as long as you are running SyncSort for z/OS 1.2 or later.

But to make it even simpler, the SORTOF01 DD and OUTFIL statements are not necessary in this case -- a SORTOUT DD is sufficient here.

Regards,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top