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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing data

Status
Not open for further replies.

janegee

Programmer
Mar 16, 2003
4
US
I am a recent convert from Roscoe RPF language- trying to write an OS390 rexx that reads in a pds member consisting of dsn's one line after another. Then the rexx exec would insert two static lines of information after each dsn. So every third line would now be the dsn. I know there is a simple way to edit data. Would someone be willing to send an example. I promise when I master Rexx, I will do the same in kind. Thank you! Joan
 
This is how I do it.

I have a member of a dataset that contains dataset names. Then I do the following

address ISPEXEC "EDIT DATASET('"sysuid".CLIST.MSTR(XMITLIST)')"
"ALLOC F(XMITDSNS) DA('"sysuid".CLIST.MSTR(XMITLIST)') SHR REUSE"
"EXECIO * DISKR XMITDSNS (STEM LINE. FINIS"
DO I = 1 TO line.0
line = strip(line.i)
say line.i
end

Of course instead of the 'say line.i' you replace that with any logic that you need performed against each line. In my case I usually check that the dataset name exists and then I TSO XMIT them for downloading to PC.

Hope this helps
 
Input dataset contains -n- lines; output is all input lines each followed by two lines of static information....

Code:
address TSO
"ALLOC FI($TMP) DA("input_dsn") SHR REU"
"NEWSTACK"
"EXECIO * DISKR $TMP (FINIS"
do queued()
   parse pull line
   queue line
   queue "Static line #1"
   queue "Static line #2"
end  /* queued */
"EXECIO" queued() "DISKW $TMP (FINIS"
"DELSTACK"
"FREE  FI($TMP)"
[\code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top