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.