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:one file contails duplicates and requires all rec's

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


Joined: 16 Sep 2005
Posts: 4
Topics: 2

PostPosted: Fri Sep 16, 2005 3:52 am    Post subject: SPLICE:one file contails duplicates and requires all rec's Reply with quote

HI,
I could find the post which suits for my requirement before posting.

I have 2 files FILEA and FILEB.
1)FILEA can have duplicates,FILEB is not having any duplicates.
2)FILEA can contains records which are not matched in FILEB and vice versa.

I want all the matched records from FILEA and also all unmatched records from FILEA.
I don't want unmatched records from FILEB.so OUTPUT file record count should be equal to the FILEA record count


This is what i have done
1. I use file B as Base file and file A as overlay file as i have multiple file A records for certain records of file B.

2. Arrange the records from file to have the keys in the same columns. Also append a character to eliminate excess file B records.

3. SPLICE the records ON the Key with WITHALL to create multiple records with KEEPNODUPS to keep excess file A records.

But the SPLICE removes duplicates even from file A. i.e. if i have no record in file B for a key and 10 records in file A then it keeps the last 9 records of file A (due to KEEPNODUPS)
but i still lose one record. If i dont specify this, it will keep only one record.

Is there a way in which i can preserve all the duplicates of file A.


I used below SPLICE stsmt:
SPLICE FROM(BIWCMR) TO(AFFLOUT1) ON(144,7,CH) WITHALL WITH(1,143) -
WITH(218,694) KEEPNODUPS USING(AFCM)


I am getting very few less records which i am expecting.

if need any further info,plz let me know..

Thanks,
Guttu
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: Fri Sep 16, 2005 4:01 am    Post subject: Reply with quote

Guttu2005,

Please search before posting. Check these links which discusses about splice with duplicates.

http://www.mvsforums.com/helpboards/viewtopic.php?t=2951&highlight=duplicate+splice

http://www.mvsforums.com/helpboards/viewtopic.php?t=680&highlight=duplicate+splice

If the above links does not solve your problem, then you need to provide us the follwing details.

1. Lrecl and recfm of both files
2. Position and format of the fields to be treated as keys
3. sample input and desired output

Hope this helps...

Cheers

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


Joined: 16 Sep 2005
Posts: 4
Topics: 2

PostPosted: Fri Sep 16, 2005 5:22 am    Post subject: Reply with quote

Hi

as u said i have seen and fallowd,but i am not getting the exact num out put recordas what i wanted..i.e output rec's and CMRIN rec's num shud match.
Code:

//STEP010  EXEC PGM=ICETOOL,REGION=4M                           
//BIWIN    DD DSN=LOOKUP FILE,DISP=SHR         
//CMRIN    DD DSN=MAINFILE,DISP=SHR
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
 SELECT FROM(CMRIN) TO(TEMP) ON(144,7,CH) FIRSTDUP USING(CTLX) 
 COPY FROM(CMRIN) TO(TEMP1) USING(CMRF)                         
 COPY FROM(BIWIN) TO(TEMP2) USING(BIWF)                         
/*                                                             
//CTLXCNTL  DD *                                               
 OUTREC FIELDS=(1,150,67X,151,691,C'DUP')                       
/*                                                             
//CMRFCNTL  DD *                                               
 OUTREC FIELDS=(1,150,67X,151,691,C'CMR')                       
/*                                                             
//BIWFCNTL  DD *                                               
 OUTREC FIELDS=(143X,1,74,694X)                                 
/*                                                             
//TEMP     DD DSN=&&TEMP,                                       
//         DISP=(NEW,PASS),UNIT=TAPE90,                         
//         DCB=(RECFM=FB,LRECL=911,BLKSIZE=0)                   
//         DCB=(RECFM=FB,LRECL=911,BLKSIZE=0)                         
//TEMP1    DD DSN=&&TEMP1,                                           
//         DISP=(NEW,PASS),UNIT=TAPE90,                               
//         DCB=(RECFM=FB,LRECL=911,BLKSIZE=0)                         
//TEMP2    DD DSN=&&TEMP2,                                           
//         DISP=(NEW,PASS),UNIT=TAPE90,                               
//         DCB=(RECFM=FB,LRECL=911,BLKSIZE=0)                         
//STEP020  EXEC PGM=ICETOOL,REGION=4M                                 
//BIWCMR   DD DSN=&&TEMP2,DISP=(OLD,PASS)                             
//         DD DSN=&&TEMP,DISP=(OLD,PASS)                             
//         DD DSN=&&TEMP1,DISP=(OLD,PASS)                             
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
 SPLICE FROM(BIWCMR) TO(AFFLOUT1) ON(144,7,CH)  WITHALL WITH(1,143) -
 WITH(218,694)   KEEPNODUPS USING(AFCM)                               
/*                                                                   
//AFCMCNTL  DD *                                                     
 SORT FIELDS=(1,7,CH,A)                                               
 OUTFIL FNAMES=AFFLOUT2,INCLUDE=(909,3,CH,EQ,C'   ')                 
 OUTFIL FNAMES=OUT3,INCLUDE=(909,3,CH,EQ,C'CMR') 
/*



Can you please let me know,whr i am doing mistake.

Thanks,
Guttu
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Sep 22, 2005 6:39 pm    Post subject: Reply with quote

Guttu,

Kolusu said:

Quote:
If the above links does not solve your problem, then you need to provide us the follwing details.

1. Lrecl and recfm of both files
2. Position and format of the fields to be treated as keys
3. sample input and desired output


You said:
Quote:
Can you please let me know,whr i am doing mistake.


Kolusu asked for that information so we can help you. If you don't supply it, then you can't expect us to help. We can't read your mind or look over your shoulder at your input or output records.

Specifically, we don't know what your input looks like or what you want the output to look like.

I also don't know what you mean by:

Quote:
as u said i have seen and fallowd,but i am not getting the exact num out put recordas what i wanted..i.e output rec's and CMRIN rec's num shud match.


Show us what you're getting and explain how it differs from what you want.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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