| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| ranjit5311 Beginner
 
 
 Joined: 27 Nov 2005
 Posts: 27
 Topics: 14
 
 
 | 
			
				|  Posted: Mon Jan 23, 2006 11:17 pm    Post subject: allocating the PDS memeber  through REXX |   |  
				| 
 |  
				| I have allocated a PDS through the REXX. Could you please tell me 1. How to allocate a new members for the PDS.
 2. if the member already exist, I want to over write the contents in that member.
 thanks,
 Ranjit
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| imdaboss Beginner
 
 
 Joined: 10 Jan 2006
 Posts: 3
 Topics: 1
 
 
 | 
			
				|  Posted: Tue Jan 24, 2006 5:52 am    Post subject: |   |  
				| 
 |  
				| Supposing the PDS's name is 'THISIS.ANAME', doing: 
 
  	  | Code: |  	  | address TSO
 "ALLOC DD(TEST) DSN('THISIS.ANAME(NEWMEMBR)') SHR"
 
 | 
 
 This will allocate a new member in the PDS, or overwrite an existing one.
 If you prefer to append to the member instead of overwriting it, use MOD disposition instead of SHR.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| superk Advanced
 
  
 Joined: 19 Dec 2002
 Posts: 684
 Topics: 5
 
 
 | 
			
				|  Posted: Tue Jan 24, 2006 7:03 am    Post subject: |   |  
				| 
 |  
				|  	  | imdaboss wrote: |  	  | If you prefer to append to the member instead of overwriting it, use MOD disposition instead of SHR. | 
 Nope, you can't ever MOD to a member of a PDS. It's either SHR or OLD.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ofer71 Intermediate
 
 
 Joined: 12 Feb 2003
 Posts: 358
 Topics: 4
 Location: Israel
 
 | 
			
				|  Posted: Tue Jan 24, 2006 8:04 am    Post subject: |   |  
				| 
 |  
				| And here is the quote from the fine manual: 
  	  | Quote: |  	  | Do not use the MOD attribute when allocating a member of a PDS to which you want to append information. You can use MOD only when appending information to a sequential data set. To append information to a member of a PDS, rewrite the member with the additional records added. | 
 
 O.
 ________
 trichomes pictures
 
 Last edited by ofer71 on Sat Feb 05, 2011 11:29 am; edited 1 time in total
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Dibakar Advanced
 
  
 Joined: 02 Dec 2002
 Posts: 702
 Topics: 64
 Location: USA
 
 | 
			
				|  Posted: Tue Jan 24, 2006 10:57 pm    Post subject: |   |  
				| 
 |  
				| you can use sysdsn to check if member exists or not. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ranjit5311 Beginner
 
 
 Joined: 27 Nov 2005
 Posts: 27
 Topics: 14
 
 
 | 
			
				|  Posted: Fri Jan 27, 2006 6:57 am    Post subject: |   |  
				| 
 |  
				| address TSO "ALLOC DD(TEST) DSN('THISIS.ANAME(NEWMEMBR)') SHR"
 
 If i am replacing the member name by a temp variables(i.e. putting any variables let say VAR1 in place of the 'THISIS.ANAME(NEWMEMBR)),  then i am getting RC = 12 . why i am geting RC=12 ,Can we use variable which have the member name for allocating?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| superk Advanced
 
  
 Joined: 19 Dec 2002
 Posts: 684
 Topics: 5
 
 
 | 
			
				|  Posted: Fri Jan 27, 2006 7:03 am    Post subject: |   |  
				| 
 |  
				| Could you post the results of your TRACE of the ALLOC step? Something to check for - make sure there are no imbedded blanks in either the dataset or member name. 
 If VAR1 is 'NEWMEMBR', then you can allocate the DD as:
 
 
  	  | Code: |  	  | "ALLOC DD(TEST) DSN('THISIS.ANAME("VAR1")') SHR"
 
 | 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ranjit5311 Beginner
 
 
 Joined: 27 Nov 2005
 Posts: 27
 Topics: 14
 
 
 | 
			
				|  Posted: Fri Jan 27, 2006 7:23 am    Post subject: |   |  
				| 
 |  
				| Thanks every body for pouring valuble information, now I can allocate the the member for the PDS. _________________
 One should move lightly through the life, carrying no excess baggage.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |