Page 1 of 1

QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 12:08 am
by santosh bm
hi,,,
in one of my REXX code,i read some records from a seq file then after some string manipulation, i have used QUEUE keyword to move a variable containing a string of chars to a stem. later i write the stem data into some PDS member.
when i try executing the REXX code, it expects to enter "enter" key for the number of records it processed in the input file. why is it so ?

QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 12:35 am
by Pedro
Show us the code for this:
i have used QUEUE keyword to move a variable containing a string of chars to a stem.

I do not think you should use QUEUE to assign a value to a stem variable.

and show us the code for this:
later i write the stem data into some PDS member.


Without yet seeing any code to debug, my guess is that you specify the number of records in the EXECIO statement, but do not specify the stem name. It will try to read from the stack instead.

The EXECIO statement allows the use of the stack -or- of a stem variable. You should not try to use both in the same instance.

Re: QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 11:20 am
by santosh bm
Thanks for the reply..
as i'm not supposed to post the exact code from my shop, i'm posting the similar code below.
DO I=1 TO INREC.0  /* INREC. STEM CONTAINS INP RECS READ */
   PARSE VAR INREC.I JOBNAME.I REQNO.I
   STRING1 = "USER REQ NUMBER#"
   OUTREC.I = STRING1 || REQNO.I
   QUEUE OUTREC.I
   PDS_MEM = 'USERID.REXX.PDS(JOBNAME.I)'
   "ALLOC DA('"PDS_MEM"') F(MYOTDD) OLD REUSE"
   "EXECIO * DISKW MYOTDD (FINIS "
   "FREE F(MYOTDD)"

the above code, creates a member inside the specified pds with member name as "jobname" read from inp file. But the prob is it expects to enter the "ENTER" key for the number of times equal to the number of records present in the input file. suppose, the inp file contains 4 records, it expects to enter "ENTER" key four times. i dont want it to expect anything from the terminal to enter.

Re: QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 3:13 pm
by enrico-sorichetti
why not just simply use

"EXECIO " inrec.0 " DISKW MYOTDD (FINIS STEM OUTREC."

???

Re: QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 4:43 pm
by MrSpock
Because the PDS member name changes with each iteration of the loop ...

I'm thinking

"EXECIO 1 DISKW MYOTDD (FINIS STEM OUTREC."


might be better, or, sticking with the original premise:

QUEUE OUTREC.I
...
"EXECIO "Queued()" DISKW MYOTDD (FINIS "

Re: QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 4:55 pm
by enrico-sorichetti
:oops:
I had not noticed the member name change

that' s what happens when people do not use the code tags

Re: QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 4:57 pm
by NicC
I have "coded" your code. Please do it yourself in future. And you really should cut and paste your code. Once cut and pasted you can overtype anything that might be sensitive or identify you if you do not wish to be identified. As it is it looks as though you are creating a member called JOBNAME.I which is invalid as it contains a period (.) and is 9 characters long. I suspect you forgot to type in some quotes - another reason for cutting and pasting.

Re: QUEUE handling in REXX

PostPosted: Wed Oct 30, 2013 7:11 pm
by Pedro
it expects to enter "enter" key for the number of records it processed in the input file. why is it so ?


When you use 'EXEC * DISKW. . . ':
When EXECIO writes an arbitrary number of lines from the data stack, it stops only when it reaches a null line. If there is no null line on the data stack in an interactive TSO/E address space, EXECIO waits for input from the terminal and stops only when it receives a null line.

Re: QUEUE handling in REXX

PostPosted: Thu Oct 31, 2013 12:04 am
by santosh bm
without using QUEUE concept, if i try writing rec to output member, it works fine..:-)
But when i try with QUEUE keyword, it expects input from the terminal !!

@Pedro :
You are right. Is there any way to get rid of it ? i mean can we introduce any null line or something ??

QUEUE handling in REXX

PostPosted: Wed Jan 08, 2014 12:00 am
by Pedro
You are doing this:

Queue one line
EXECIO unknown lines
...
Queue one line
EXECIO unknown lines
...
Queue one line
EXECIO unknown lines
...

etc.

Where 'unknown lines' is signified by an asterisk in the EXECIO. The problem you have is because of the asterisk in EXECIO. Instead of asterisk, use 1:
QUEUE 'some text'
"EXECIO 1 DISKW..."


Both MrSpock and Enrico and I have tried to say the same thing a few times already.