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!

write to a PDS member from QUEUE

Status
Not open for further replies.

mnellutla

Vendor
Nov 26, 2003
15
US
Hi,
I am new to rexx and ....
I am writing a small utility to generate a tree structure of one program calling another, up to 5 levels.

I create the tree and put it in the QUEUE. when i write it to a flat file it is fine. But when i write it to a PDS it gives me errors.

Here is part of my code....
Code:
/*rexx   */
..
pull TEMP1
..
..
DS.OUT_5='LV5NS0CN.UTIL.TREE('temp1')' 

CALL TSO "ALLOC F( OUTDD5 ) DA( "DS.OUT_5" ) shr "

DD_OUT.1 = FULL_ASTERISK
QUEUE DD_OUT.1          
DD_OUT.2 = ' /*  THE FOLLOWING FLOW IS GENERATED FROM REXX EXEC',
           || '' TEMPTREE'       */'                             
QUEUE DD_OUT.2                                                   
...
...

CALL TSO,                                    
     "EXECIO" queued() "DISKW OUTDD5 (FINIS"
...........................................

The above code gives me the following error


System abend code 013, reason code 00000020.
Abend in host command EXECIO or address environment routine TSO.
EXECIO error while trying to GET or PUT a record.


C-list or exec TEMPIM failed at line 343.
TSO command returned an unexpected return code. Command:

EXECIO 130 DISKW OUTDD5 (FINIS

................................

Thanks in advance for the help.
Manu
(boston)
 
The abend code S013 means the member name was not supplied to a partitioned dataset read or write attempt, so it looks like 'TEMP1' is not being passed / initialised. I suggest you put in something like say 'Member name = 'temp1 to see what is happening.
 
#1 problem I see is the syntax for writing. I use
"EXECIO * DISKR indd (STEM REC. FINIS)"
where "REC." is the stem variable that holds all the data to be written.

#2 problem I do not see where the member name in the PDS is.
 
Stanleyrx, with #1, there are 2 methods for reading / writing from / to datasets. The method you use is stem variables (which is also my preferred method), and the method used by mnellutla is a data stack.

The advantage of a data stack is it is easy to add records to the start or end of the stack using QUEUE and PUSH, but the disadvantage is you can only use the stack once, and need to queue a blank to signify the end of input - this means you can't put blanks into your output file.

With #2, you're right, that was the problem. :)
 
Yes, you can "only use the stack once" but it's pretty easy to refresh it, too:
Code:
"EXECIO" queued() "DISKW $TMP (FINIS"
"EXECIO    *       DISKR $TMP (FINIS"
and your stack is reloaded. Also for processing:
Code:
do queued()
   pull line
   queue line
   /* use the contents of 'line' */
end
and the queue is intact, as if you had never processed it.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Hi all, thanks for the replies.

The reason you don't see any member names is because,
DS.OUT_5 takes in TEMP1 from the line command as member name.

I reason why my code previously not working was because

DS.OUT_5='LV5NS0CN.UTIL.TREE('temp1')'

quotes were giving me the problem.

I bypassed the problem when i broke the whole Dataset into variables

"ALLOC DA('"DA""DS.OP""TEMP1""DS.CL"') F(indd) SHR REUSE"


Manu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top