Hi,
How can one allocate a member of a PDS to a file using Rexx? The purpose is - a new member has to be created in an already existing PDS & that member should be written to (from possibly a stem). Please respond.
Many people use the 'execio' routines to read and write to files in REXX. I have done this in the past, but lately have gone to the Library Manager routines. These are native to ISPF and are very useful. I have just a reference summary at hand called 'ISPF Reference Summary OS/390 Version 1 Release 2.0' SC28-1308-00. You must have 'address ispexec' in your REXX exec. Sample program would look like this:
/*rexx*/
address ispexec
/* lminit is the allocate */
'lminit dataid(outpds) dataset('outdsn') ...
/* lmopen opens the pds */
'lmopen dataid('outpds') option(output) ...
...
format the record
...
/* lmput writes the record */
'lmput dataid('outdsn') mode(invar) dataloc(outline) ...
...
after your through writing all the records
...
/* lmmadd adds a new member to the pds */
Note: when the member already exists, you'll get an error with lmmadd, you can use lmmrep to replace it. The manual can explain it better than I can; if you don't have a manual, use this site of IBM'S:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.