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 

Merge two files using icetool

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Mon Jan 22, 2007 11:17 pm    Post subject: Merge two files using icetool Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
hareshh
Beginner


Joined: 13 Dec 2006
Posts: 16
Topics: 0

PostPosted: Tue Jan 23, 2007 5:57 am    Post subject: Reply with quote

Hi amit4u79,

Related solution is discussed in below thread:

http://www.mvsforums.com/helpboards/viewtopic.php?t=7181&highlight=merge+icetool

Regards,
Haresh
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: Tue Jan 23, 2007 12:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
amit4u79
Beginner


Joined: 24 Oct 2005
Posts: 109
Topics: 36
Location: India

PostPosted: Tue Jan 23, 2007 11:13 pm    Post subject: Reply with quote

Fantastic sir. thanks a lot haresh and frank. it's done. I just now have to understand the control card that you have sent Smile
_________________
I did not fail; I have found 10,000 ways that would not work - Albert Einstein.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
pravinba
Beginner


Joined: 05 Apr 2007
Posts: 4
Topics: 1

PostPosted: Thu May 03, 2007 1:13 am    Post subject: Thanks Reply with quote

The information in this post was really useful.. Was really able to understand splice easily..
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 -> Job Control Language(JCL) 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