MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
amit4u79 Beginner Joined: 24 Oct 2005 Posts: 109 Topics: 36 Location: India
Posted: Mon Jan 22, 2007 11:17 pm Post subject: Merge two files using icetool
i am trying to merge two files and do some processing using icetool but failing. please help.
it has two input files:
input1: (contains unqiue jobnames and some data)
Code:
PTUMSG1D xxx
PTUAM04D xxx
PTUNA81D xxx
input2: (contains duplicate jobnames and some data also)
Code:
PTUMSG9D yyy
PTUMSG9D yyy
PTUMSG9D yyy
PTUMSG1D yyy
PTUAM04D yyy
PTUAM04D yyy
PTUAM04D yyy
PTUAM04D yyy
PTUNA91D yyy
desired output: (should be from input2 with all duplicates but only those records with jobnames which are in input1)
Code:
PTUMSG1D yyy
PTUAM04D yyy
PTUAM04D yyy
PTUAM04D yyy
PTUAM04D yyy
the jcl icetool card that i am using is: (fyi. 1-8 is jobname and 35 is the totlal length of both the input files)
Code:
COPY FROM(INPUT1) TO(FILEMRGE)
COPY FROM(INPUT2) TO(FILEMRGE)
SPLICE FROM(FILEMRGE) TO(MERGESP) ON(1,8,CH) WITHALL WITH(36,35)
I believe, the WITHALL option should work but it's not working.
Please suggest.
thanks a lot. _________________ I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
hareshh Beginner Joined: 13 Dec 2006 Posts: 16 Topics: 0
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jan 23, 2007 12:06 pm Post subject:
amit,
Your job is missing some key pieces. 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 (FB/35)
//IN2 DD DSN=... input file2 (FB/35)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/35)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) -
WITHALL WITH(1,36) USING(CTL3)
/*
//CTL1CNTL DD *
INREC OVERLAY=(36:C'BB')
/*
//CTL2CNTL DD *
INREC OVERLAY=(36:C'VV')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(36,2,CH,EQ,C'VB'),
BUILD=(1,35)
/*
For more information on matching with SPLICE, see the "Create files with matching and non-matching records" Smart DFSORT Trick at:
http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ _________________ 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
amit4u79 Beginner Joined: 24 Oct 2005 Posts: 109 Topics: 36 Location: India
Posted: Tue Jan 23, 2007 11:13 pm Post subject:
Fantastic sir. thanks a lot haresh and frank. it's done. I just now have to understand the control card that you have sent _________________ I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
pravinba Beginner Joined: 05 Apr 2007 Posts: 4 Topics: 1
Posted: Thu May 03, 2007 1:13 am Post subject: Thanks
The information in this post was really useful.. Was really able to understand splice easily..
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