Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Matching 2 Files in SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Mon Oct 01, 2007 2:22 pm    Post subject: Matching 2 Files in SYNCSORT
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: 2150
Location: At my coffee table

PostPosted: Mon Oct 01, 2007 2:44 pm    Post subject:
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: 1187
Location: Bangalore,India

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

Srivatsa,

Topic is already discussed


http://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    Post subject:
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: 500
Location: USA

PostPosted: Mon Oct 01, 2007 9:29 pm    Post subject:
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    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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Matching and unmatching records scdinesh DFSORT/ICETOOL 11 Tue Feb 07, 2017 12:41 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us