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 

File Matching

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


Joined: 14 Sep 2005
Posts: 18
Topics: 8

PostPosted: Mon Sep 19, 2005 4:30 am    Post subject: File Matching Reply with quote

Hi,

I have tried searching a lot on this forum but could not find the suitable solution without SPLICE/DFSORT.

My requirement is

File 1 (record length 80 FB key is 9(5) pos 1- 5 no duplicates)
(Key) (FieldA)
12345 Y
11111 N
22222 N
33333 N
12346 Y
55555 N
66666 N
77777 N



File 2 (record length 80 FB key is 9(5) pos 6- 10 with duplicates)
(Key)
test1 12345
test2 12346
test3 77777
test9 77777
test4 66666
test5 99999
test6 12346
test7 11111



Final Output file

test1 12345 Y
test7 11111 N
test2 12346 Y
test4 66666 N
test3 77777 N
test9 77777 N


If File1 key matches with File 2 Key then File 2 should be written to output file by appending fieldA from File1 in File1 sequence.

Does anyone have a non-SPLICE solution using SYNCSORT.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Sep 19, 2005 4:48 am    Post subject: Reply with quote

Suresh05,

Please do not open several threads for the same/similar question. I had asked you a question in this thread.

http://www.mvsforums.com/helpboards/viewtopic.php?t=4836

How many unique entries do you have in your key ? Since your version of sort does not support SPLICE, matching using INCLUDE is possible but limited to the number of unique entries.

Thanks,
Phantom
Back to top
View user's profile Send private message
suresh05
Beginner


Joined: 14 Sep 2005
Posts: 18
Topics: 8

PostPosted: Mon Sep 19, 2005 4:52 am    Post subject: Reply with quote

Phantom,

File 2 will have about a million records out of which around 100 records will have duplicate key fields.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Sep 19, 2005 5:36 am    Post subject: Reply with quote

Suresh05,

I am sorry. you cannot achieve your output using your version of sort. You can MATCH records from File1 and File 2 and extract all matching records from FILE2 but cannot include FILE1's contents in the output.

The code below will match 2 files and extract matching records from file 2.
Code:

//R010  EXEC  PGM=SYNCTOOL             
//INPUT1  DD  *                       
12345 Y                               
11111 N                               
22222 N                               
33333 N                               
12346 Y                               
55555 N                               
66666 N                               
77777 N                               
/*                                     
//INPUT2  DD  *                       
TEST1 12345                           
TEST2 12346                           
TEST3 77777                           
TEST9 77777                           
TEST4 66666                           
TEST5 99999                           
TEST6 12346                           
TEST7 11111                           
/*                                     
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//CTL2CNTL DD DSN=&&TEMP1,DISP=(,PASS)                               
//OUTPUT   DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  COPY FROM(INPUT1)  TO(CTL2CNTL) USING(CTL1)                         
  COPY FROM(INPUT2)  TO(OUTPUT)   USING(CTL2)                         
/*                                                                   
//CTL1CNTL DD *                                                       
  OUTFIL HEADER1=(' INCLUDE COND=(7,5,CH,EQ,C''',1,5,''',OR,',80:X), 
         OUTREC=(C'               7,5,CH,EQ,C''',1,5,C''',OR,',80:X),
        TRAILER1=('               7,5,CH,EQ,C''',1,5,''')',80:X)     
/*                                                                   


Thanks,
Phantom
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: Mon Sep 19, 2005 8:05 am    Post subject: Reply with quote

Suresh05,

You need to code a program. Your version of syncsort does not support JOIN function.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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