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 

Merging two VSAM file

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


Joined: 20 Feb 2006
Posts: 27
Topics: 14

PostPosted: Tue Jul 08, 2008 11:37 am    Post subject: Merging two VSAM file Reply with quote

Hi,

I need to merge two VSAM files by a job.

Can you please provide me any sample sort card for getting this done.

Many Thanks

Haseen
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12383
Topics: 75
Location: San Jose

PostPosted: Tue Jul 08, 2008 12:53 pm    Post subject: Reply with quote

haseen_mohammed,

You canNOT concatenate VSAM clusters. So you need 2 steps . First step create the file copying the vsam file and the next step code Disp=MOD for appending the contents of the second vsam cluster.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Jul 08, 2008 2:25 pm    Post subject: Reply with quote

Haseen,

It depends on what you mean by "merge".

If you are talking about a real MERGE where each input file is already ordered on a key and you want to produce an output file ordered on that key, then you can use a one pass DFSORT MERGE job.

If you are talking about appending the files one after the other in an output data set, then you need two passes with two COPY operations (you could do this in one step with ICETOOL).

Please clarify what you want to do.
_________________
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
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Jul 10, 2008 1:17 am    Post subject: Re: Merging two VSAM file Reply with quote

haseen_mohammed,

You can use the below job.


Code:
//STEP001  EXEC PGM=ICETOOL
//DFSMSG  DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN1   DD DSN=first file,DISP=SHR
//IN2   DD DSN=second file,DISP=SHR
//OUT   DD DSN=output file,
//             DISP=(MOD,CATLG,DELETE),
//             SPACE=(CYL,(3,3),RLSE)
//TOOLIN    DD *
COPY FROM(IN1) TO(OUT) VSAMTYPE(V)
COPY FROM(IN2) TO(OUT) VSAMTYPE(V)
/*
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Jul 10, 2008 11:30 am    Post subject: Reply with quote

Quote:
You can use the below job


if you want to append the files. See my post above about append vs merge.
_________________
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
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Jul 11, 2008 4:21 am    Post subject: Reply with quote

Frank Yaeger wrote:
Quote:
You can use the below job


if you want to append the files. See my post above about append vs merge.


Yes Frank, the job I gave is to append the files.
Back to top
View user's profile Send private message Send e-mail
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