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 

SPLICE problem

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


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Tue Jul 05, 2011 7:44 pm    Post subject: SPLICE problem Reply with quote

Hi,

I am using SPLICE to get unmatched records from two files.
but in unmatched output files duplicate records are getting eliminated on the keys on which I am splicing. I am using KEEPNODUPS even then duplicate record which are unmatched are written output file.

For example
Inputs files
Filein1:
1111
2222
2222
3333

Filein2:
1111
4444
4444
4444
5555

Actual Output:
File1(matching records):
1111

File2(unmatched records from Filein1):
2222
3333

File3(unmatched records from Filein2):
4444
5555

Desired Output:
File1(matching records):
1111

File2(unmatched records from Filein1):
2222
2222
3333

File3(unmatched records from Filein2):
4444
4444
4444
5555

I have tried with all possible keywords like WITHALL, KEEPNODUPS but I am not getting desired result. Please help me in getting above result.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue Jul 05, 2011 8:57 pm    Post subject: Reply with quote

Suggest you consider JOINKEYS. . . rather than SPLICE. . .
_________________
All the best,

di
Back to top
View user's profile Send private message
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Wed Jul 06, 2011 3:14 am    Post subject: Reply with quote

Start from here: http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094 and look at "Create files with matching and non-matching records".
_________________
Regards,
Anuj
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: Wed Jul 06, 2011 10:56 am    Post subject: Reply with quote

psmadhusudhan,

As others mentioned, Joinkeys is the ideal solution for this. You also need to clarify what the output is when you have matching duplicate keys in both files

ex:
Code:

//IN1      DD *       
1111  - F1 KEY1       
1111  - F1 KEY2       
2222  - F1 KEY1       
2222  - F1 KEY2       
3333  - F1 KEY1     



Code:
 
//IN2      DD *       
1111  - F2 KEY1       
1111  - F2 KEY2       
1111  - F2 KEY3       
4444  - F2 KEY1       
4444  - F2 KEY2       
4444  - F2 KEY3       
5555  - F2 KEY1       


What is the expected output from the above? You have 2 duplicates for 1111 key in file 1 and 3 duplicates for 1111 key in file 2. What is the expected output in this case? Is it (2 X3 = 6 ) records for 1111 key? or just (2+3 =5) matching keys?

Also is the data already sorted on the key?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Fri Jul 08, 2011 10:57 pm    Post subject: Reply with quote

Sorry for late reply. I have tried with joinkeys. But it seems I need two steps to get two unmatched files, can this be done in one single step.

Kolusu,
My requirement is only to get unmatched file, so even if there are duplicates in match keys it is not so important, only thing they should not come into output of unmatched files. My input is some times sorted and sometimes not sorted.
_________________
Thanks
Madhu Sudhan
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: Sat Jul 09, 2011 11:58 am    Post subject: Reply with quote

psmadhusudhan wrote:
Sorry for late reply. I have tried with joinkeys. But it seems I need two steps to get two unmatched files, can this be done in one single step.


You don't need 2 steps. answer the following questions

1. what is the lrecl and recfm of the both input files?
2. what is the lrecl and recfm of output files?
3. Show us a sample of your input and desired output with duplicates on both match and nonmatch keys.
_________________
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