I was trying out to execute the rexx program as below,
***************************** Top of Data ******************************
000100 the_number = random(1,10)
000200 say 'i am thinking of number between 1 to 10.what is it?'
000300 pull the_guess
000400 if the_number = the_guess then
000500 say 'u guessed it!'
000600 else
000700 say 'sorry. My number was:' the_number
000800 say 'BYE!'
**************************** Bottom of Data ****************************
I have the rexx program mentioned above in the PDS XXX.XXX.Dataset
When i ran the job the job completed with Maxcc= 0 and in the sysout it displayed
***************************** TOP OF DATA *******************************
1 *-* 000100 the_number = random(1,10)
+++ RC(-3) +++
2 *-* 000200 say 'i am thinking of number between 1 to 10.what is it?'
+++ RC(-3) +++
3 *-* 000300 pull the_guess
+++ RC(-3) +++
4 *-* 000400 if the_number = the_guess then
+++ RC(-3) +++
5 *-* 000500 say 'u guessed it!'
+++ RC(-3) +++
6 *-* 000600 else
+++ RC(-3) +++
7 *-* 000700 say 'sorry. My number was:' the_number
+++ RC(-3) +++
8 *-* 000800 say 'BYE!'
+++ RC(-3) +++
**************************** BOTTOM OF DATA *****************************
But this was not actually what i was expecting. I expected that it would ask me to enter the number and compare then display the statement depending on if condition. Could anyone please help me what changes i need to do so that i could get the desired output.
********************************* TOP OF DATA *****************
i am thinking of number between 1 to 10.what is it?
sorry. My number was: 4
BYE!
******************************** BOTTOM OF DATA ***************
I wanted it to allow me to enter a number the_guess and then compare the_guess with the_number and then display as per the If condition. Could any one suggest changes.
for what reason should we waste our time in replying and posting tested advice and snippets
when You/people do not effing care to read and try to understand the replies given
when running in batch You should be aware that You must <stack> the input after the systsin dd
I posted a snippet which does a parse pull, displays the <input> received
the two jobstreams used to run the silly snippet
the two full outputs from the execution
if You cannot read and understand the suggestions received
it would be wiser to meditate a career shift to a less demanding job
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
pratiksha wrote:
I added the /*REXX*/
Now i get as below in sysout.
********************************* TOP OF DATA *****************
i am thinking of number between 1 to 10.what is it?
sorry. My number was: 4
BYE!
******************************** BOTTOM OF DATA ***************
I wanted it to allow me to enter a number the_guess and then compare the_guess with the_number and then display as per the If condition. Could any one suggest changes.
Thanks & Regards,
Pratiksha
But you're trying to run this as a batch job via JCL (which I didn't pick up on your first post). You don't get the opportunity to interface via display when running batch. Try executing the REXX from TSO command line to be interactive or else provide the_guess from SYSTSIN (stakced, as enrico suggested).
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
Garry Carroll wrote:
Quote:
I am learning Rexx.
Yes, but the first thing you should have learnt is that every REXX program must begin with a comment that includes the word REXX - e.g.
Code:
/* REXX */
Also, you should have a RETURN statement a the eed of your code.
Garry.
As far as i know, rexx execs in SYSEXEC dont need a REXX comment line,
for SYSPROC there is a difference because TSO/E needs to know if its processing a REXX or a CLIST.
I executed without /*Rexx*/. It worked. Also added the input the Jcl.
Thank you all .
enrico-sorichetti- I had wriiten my second comment . Missed to see ur first answer. Tried out when read.
********************************* TOP OF DATA ******
i am thinking of number between 1 to 10.what is it?
your guess number is 9
sorry. My number was: 2
BYE!
******************************** BOTTOM OF DATA ****