View previous topic :: View next topic
|
Author |
Message |
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
Hi,
Error running ADD2NUM, line n: Bad arithmetic conversion
I am facing this same problem.
Is there a way to handle this problem throug REXX code as pressing CTRL or ENTER key doesn't look an efficient solution especially when there are users other than author.
Thanks,
Satish[/quote] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When you have a question you should not reply to some 3-year-old inactive topic. You should start a new topic for your question.
Please review your edited post and reply with any clarification as needed. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well, the information that you have posted is about as much good as a chocolate teapot. It failed. I guess we gathered that as you have posted a thread on the forum.
How on earth are we expected to know what is going on when you do not post the code in question and the actual error messages complete with codes.
There could be a whole myriad of reasons that your rexx fails and without any detailed information you are wasting your time by posting because without that we can not help you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Expat,
Part of the confusion is mine - i split this from a 3-year-old topic that had the same error. I asked Satish to clarify the question (which i hoped would include the problem code), but so far no reply . . . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
OK, thanks for clarification. |
|
Back to top |
|
|
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
I am sorry, I thought it would be comfortable to answer when problem is already explained and also I did not wanted to start another thread for same problem.
Problem is
/* REXX */
/* THIS EXEC ADDS TWO NUMBERS AND DISPLAYS THEIR SUM. */
SAY 'PLEASE ENTER A NUMBER.'
PULL NUMBER1
SAY 'NOW ENTER A NUMBER TO ADD TO THE FIRST NUMBER.'
PULL NUMBER2
TRACE I
SM = NUMBER1 + NUMBER2
SAY 'THE SUM OF THE TWO NUMBERS IS' SM'.'
The input given is
PLEASE ENTER A NUMBER.
12
NOW ENTER A NUMBER TO ADD TO THE FIRST NUMBER.
*** 3
Why that *** is coming while giving NUMBER2(marked in blue color)?
The output is
8 *-* SM = NUMBER1 + NUMBER2
>V> "12"
>V> ""
8 +++ SM = NUMBER1 + NUMBER2
IRX0041I Error running ADDITION, line 8: Bad arithmetic conversion
***
I guess *** is what we usually see when our screen is full and we need to hit CTRL or ENTER before entering any data. Please suggest a solution so that I don't have to press CTRL or Enter key.
Thanks,
Satish |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
why not write the script to access arguments instead of pulling input?
the script would be invoked as:
TSO <script name> 10 abc
then you could run validation on the input arguments (you could have done the same thing after the pull. IF DATATYPE(NUMBER1) = N |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Apart from using an ISPF panel ...........
I don't have a handy example because my ISPPLIB got blatted when the portable tape got eaten by the tape drive |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Expat,
Quote: |
the portable tape got eaten by the tape drive |
Time for a couple of flash cards. . . Primary and backup. . .
I'm still trying to get bunches of old "stuff" together. May take more time than i have
d |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Doubt it makes a difference, but try using NEWSTACK at beginning and DELSTACK at the end. See Rexx Reference manual for details. |
|
Back to top |
|
|
|