Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allocating a member of a PDS to a file

Status
Not open for further replies.

MVS

IS-IT--Management
Jan 18, 2001
1
US
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 */

"lmmadd dataid("outdsn") member("mbr")"

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:





Then theres 'lmclose' and 'lmfree' which do the opposite of open and init.




PhiloVance
Other hobbies, interests: Travel, Model RR (HO Gauge), Genealogy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top