QUEUE handling in REXX



IBM's Command List programming language & Restructured Extended Executor

QUEUE handling in REXX

Postby santosh bm » Wed Oct 30, 2013 12:08 am

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 ?
santosh bm
 
Posts: 14
Joined: Tue Oct 29, 2013 11:53 pm
Has thanked: 0 time
Been thanked: 0 time

QUEUE handling in REXX

Postby Pedro » Wed Oct 30, 2013 12:35 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: QUEUE handling in REXX

Postby santosh bm » Wed Oct 30, 2013 11:20 am

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.
santosh bm
 
Posts: 14
Joined: Tue Oct 29, 2013 11:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: QUEUE handling in REXX

Postby enrico-sorichetti » Wed Oct 30, 2013 3:13 pm

why not just simply use

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

???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: QUEUE handling in REXX

Postby MrSpock » Wed Oct 30, 2013 4:43 pm

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 "
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: QUEUE handling in REXX

Postby enrico-sorichetti » Wed Oct 30, 2013 4:55 pm

:oops:
I had not noticed the member name change

that' s what happens when people do not use the code tags
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: QUEUE handling in REXX

Postby NicC » Wed Oct 30, 2013 4:57 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: QUEUE handling in REXX

Postby Pedro » Wed Oct 30, 2013 7:11 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: QUEUE handling in REXX

Postby santosh bm » Thu Oct 31, 2013 12:04 am

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 ??
santosh bm
 
Posts: 14
Joined: Tue Oct 29, 2013 11:53 pm
Has thanked: 0 time
Been thanked: 0 time

QUEUE handling in REXX

Postby Pedro » Wed Jan 08, 2014 12:00 am

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.


Last bumped by santosh bm on Wed Jan 08, 2014 12:00 am.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post