IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX pgm not waiting for pull verb


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Sat Apr 26, 2008 4:34 pm
Reply with quote

I have a loop, where I'm asking the user 3 questions, which he has to answer. Two answers are being asked at top of loop and third one at end of loop.

When it's entering the loop for first time, it's asking two question but then it is not waiting for the third answer to be entered and then loop goes infinite without asking any question (not even the first two).

What might be the error?
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Sat Apr 26, 2008 4:42 pm
Reply with quote

Hi Tushar,

Can you post the code

Thanks
Sai
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Apr 26, 2008 5:04 pm
Reply with quote

Quote:
What might be the error?


guess what??

certainly not a REXX interpreter one
how can we tell without seeing the code

http://catb.org/~esr/faqs/smart-questions.html
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Mon Apr 28, 2008 9:51 am
Reply with quote

Hi All,

The code i am using is -
Code:

USERCHOICE="N"                                                     
ENDOFLOOP="N"                                                     
DO WHILE ENDOFLOOP="N"                                             
   SAY 'ENTER THE PDS NAME(IF BASELINE DONT ENTER ANYTHING)'       
   PULL PDS                                                       
   PDSLIB = STRIP(PDS,B," ")                                       
   IF PDSLIB=" " THEN                                             
      PDSLIB=CHGMAN.CARD.DBRMLIB                                   
   ELSE NOP                                                       
   SAY 'ENTER THE MEMBER NAME'                                     
   PULL USERMEM                                                   
   MEMBER = STRIP(USERMEM,B," ")                                   
   QUEUE "//"USERRACF"J JOB (@),'BIND   BQ150',CLASS=0,MSGCLASS=R," 
   QUEUE "//         NOTIFY=&SYSUID"                               
   .........
   .........       
   QUEUE "//*"                                         
   IF USERCOND="Y" THEN                                 
      ENDOFLOOP="Y"                       
   ELSE NOP                               
   SAY "DO YOU WANT TO ENTER MORE MEMBER" 
   PULL CHOICE                             
   USERCOND = STRIP(CHOICE,B," ")         
 END                                       
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon Apr 28, 2008 2:06 pm
Reply with quote

maybe I'm wrong but at first sight you are asking for a field wich the user has not entered yet:

First:
Code:
IF USERCOND="Y" THEN                                 
   ENDOFLOOP="Y"                       
ELSE NOP                               

Second:
Code:
SAY "DO YOU WANT TO ENTER MORE MEMBER"
PULL CHOICE                             
USERCOND = STRIP(CHOICE,B," ")   
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Mon Apr 28, 2008 2:17 pm
Reply with quote

Hi,

Probably that might be the case.
But whatif i initialize the variable.

Secondly, I went for that because, if user wants to run the loop 4 times, the loop should execute 5 times, thats the reason i went for choice,usercond and end of loop. Is there any simplest way of achieving it.

Laslty, how easier it is to code a panel then use it in program.Actually this program takes input from user quite a few times, so i thought why not use panels/screen but the problem is i haven't use panels till now and i don't have that much time, i have to finish it within 2 days so how easier it is to code panle and use it.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 28, 2008 3:47 pm
Reply with quote

Panels are quite easy to design and use.

In your case, maybe one panel with up to 15 entries for one display
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Apr 28, 2008 5:52 pm
Reply with quote

It's because of the QUEUE statements. You're entering data into the same stack that you're trying to use for the prompt responses. Try holding that information in a stem variable until you're ready to use it.
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Mon Apr 28, 2008 9:25 pm
Reply with quote

Hi Kevin,

Can you please be more elaborate on your answer.......i mean.......does the pull verb put the prompt into the same stack which the queue is using...........or whenever rexx finds a pull it searches the stack and that is when it waits but in this case since stack already has values the interpreter doesn't wait and takes it up from stack......

and last what is the solution should i put the queue in stem or the prompt into stem.

Regards,
Tushar
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top