MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
krishna72 Beginner Joined: 25 Feb 2006 Posts: 2 Topics: 1
Posted: Sat Feb 25, 2006 5:54 am Post subject: SPLICE or SELECT Help
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
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
prakal Beginner Joined: 14 Mar 2003 Posts: 22 Topics: 1
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Sat Feb 25, 2006 11:41 am Post subject:
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
krishna72 Beginner Joined: 25 Feb 2006 Posts: 2 Topics: 1
Posted: Tue Feb 28, 2006 12:27 pm Post subject:
Sorry could not get back to you for this long. But it works for me, great help.
Thank you all.
Back to top
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