IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is there a way of creating multiple members in a PDS ?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
marlm

New User


Joined: 08 Apr 2008
Posts: 2
Location: Brazil

PostPosted: Wed Feb 12, 2014 12:56 am
Reply with quote

I need to write lines one by one and I am getting same error as in post:
ibmmainframes.com/viewtopic.php?t=57113&highlight=rexx+pds+allocation

Allocation Error, saying that the dataset is already allocated


using FINIS it closes the file, therefore on next iteration it will not add a new line on member but delete the previous line and overwrite it. Any other suggestion ? Any way of write a member without allocate the dataset?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Wed Feb 12, 2014 1:07 am
Reply with quote

Yes, but one member at a time. You cannot create multiple members in parallel in a PDS. You can create multiple members in parallel in a PDSE.
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Feb 12, 2014 10:06 am
Reply with quote

Did you try the ISPEXEC LMM* functions?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Wed Feb 12, 2014 11:10 am
Reply with quote

I don't do Rexx, but here's a CLIST that creates 5 members.
Code:
PROC 0                                           
CONTROL LIST                                     
LISTDSI MC.PDS                                   
SET RC = &LASTCC                                 
IF &RC NE 0 THEN +                               
 DO                                             
  ALLOC F(PDS) SP(1 1) TRA RECFM(F B) LRECL(80) +
     BLKSIZE(800) DIR(1) REUS DA(MC.PDS)         
  FREE F(PDS)                                   
 END                                             
DO &I = 1 TO 5                                   
 ALLOC F(PDS) DA(MC.PDS(M&I)) REUS               
 OPENFILE PDS OUTPUT                             
 SET PDS = &STR(MEMBER &I)                       
 PUTFILE PDS                                     
 CLOSFILE PDS                                   
END                                             
LISTDS MC.PDS ME
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Feb 12, 2014 2:33 pm
Reply with quote

marlm wrote:
using FINIS it closes the file, therefore on next iteration it will not add a new line on member but delete the previous line and overwrite it. Any other suggestion ? Any way of write a member without allocate the dataset?


Post the code you are working on, then we may be able to identify the exact problem and help you with a solution.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top