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 or SELECT Help

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


Joined: 25 Feb 2006
Posts: 2
Topics: 1

PostPosted: Sat Feb 25, 2006 5:54 am    Post subject: SPLICE or SELECT Help Reply with quote

Hello All,

Can I use icetool solution(splice/select) instead of writing cobol pgm, to match 2 files, and keep duplicates from 1st file where it matched to 2nd file.
Ex:- FILEA
Code:

1111 test1 date1
1111 test2 date2
1111 test3 date3
1112 test1 date1
1113 test1 date1
1113 test2 date2

FILEB
Code:

1111
1113

OUTPUT
Code:

1111 test1 date1
1111 test2 date2
1111 test3 date3
1113 test1 date1
1113 test2 date2

I tried with job but not getting what I want.
Code:

//STEP0001 EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD DSN=FILEA,DISP=SHR                             
//IN2      DD DSN=FILEB,DISP=SHR                             
//T1       DD DSN=&T1,UNIT=DISK,SPACE=(CYL,(5,5),RLSE),                 
//            DISP=(,PASS)                                             
//T2       DD DSN=&T2,UNIT=DISK,SPACE=(CYL,(5,5),RLSE),                 
//            DISP=(,PASS)                                             
//CON      DD DSN=&T1,VOL=REF=*.T1,DISP=(OLD,PASS)                     
//         DD DSN=&T2,VOL=REF=*.T2,DISP=(OLD,PASS)                     
//OUT      DD SYSOUT=*                                                 
//OUT1     DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
  COPY FROM(IN1) TO(T1) USING(CTL1)                                     
  COPY FROM(IN2) TO(T2) USING(CTL2)                                     
  SPLICE FROM(CON) TO(OUT) ON(1,4,CH) WITHALL WITH(15,1) USING(CTL3)
/*                                                                     
//CTL1CNTL DD *                                                         
  SORT FIELDS=(1,4,CH,A)                                             
  OUTREC FIELDS=(1,15,C'11')                                           
//CTL2CNTL DD *                                                         
  SORT FIELDS=COPY                                                     
  OUTREC FIELDS=(1,4,11XC'22')                       
//CTL3CNTL DD *                                                         
  OUTFIL FNAMES=OUT                                                     
  OUTREC FIELDS=(1,17)

I did not omit any records, as I want to see where the records are from FILEA OR FILEB.
Back to top
View user's profile Send private message
prakal
Beginner


Joined: 14 Mar 2003
Posts: 22
Topics: 1

PostPosted: Sat Feb 25, 2006 10:57 am    Post subject: Reply with quote

Please go through the below links


http://www.mvsforums.com/helpboards/viewtopic.php?t=11&highlight=match

http://www.mvsforums.com/helpboards/viewtopic.php?p=18917#18917
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: Sat Feb 25, 2006 11:41 am    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,4,CH) WITHALL WITH(1,16) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,4,16:C'AA')
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,15,16:C'BB')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(16,2,CH,EQ,C'BA'),
    OUTREC=(1,15)
/*



OUT will have:

Code:

1111 test1 date   
1111 test2 date   
1111 test3 date   
1113 test1 date   
1113 test2 date   

_________________
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
krishna72
Beginner


Joined: 25 Feb 2006
Posts: 2
Topics: 1

PostPosted: Tue Feb 28, 2006 12:27 pm    Post subject: Reply with quote

Sorry could not get back to you for this long. But it works for me, great help.

Thank you all.
Back to top
View user's profile Send private message
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