| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| haseen_mohammed Beginner
 
 
 Joined: 20 Feb 2006
 Posts: 27
 Topics: 14
 
 
 | 
			
				|  Posted: Tue Jul 08, 2008 11:37 am    Post subject: Merging two VSAM file |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Tue Jul 08, 2008 12:53 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Frank Yaeger Sort Forum Moderator
 
  
 
 Joined: 02 Dec 2002
 Posts: 1618
 Topics: 31
 Location: San Jose
 
 | 
			
				|  Posted: Tue Jul 08, 2008 2:25 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| vkphani Intermediate
 
  
 Joined: 05 Sep 2003
 Posts: 483
 Topics: 48
 
 
 | 
			
				|  Posted: Thu Jul 10, 2008 1:17 am    Post subject: Re: Merging two VSAM file |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Frank Yaeger Sort Forum Moderator
 
  
 
 Joined: 02 Dec 2002
 Posts: 1618
 Topics: 31
 Location: San Jose
 
 | 
			
				|  Posted: Thu Jul 10, 2008 11:30 am    Post subject: |   |  
				| 
 |  
				|  	  | 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 |  | 
	
		|  | 
	
		| vkphani Intermediate
 
  
 Joined: 05 Sep 2003
 Posts: 483
 Topics: 48
 
 
 | 
			
				|  Posted: Fri Jul 11, 2008 4:21 am    Post subject: |   |  
				| 
 |  
				|  	  | 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 |  | 
	
		|  | 
	
		|  | 
	
		|  |