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

Numeric error: Bad arithmetic conversion in REXX


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

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Fri Oct 10, 2008 9:17 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 10, 2008 9:34 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Oct 10, 2008 11:28 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 10, 2008 12:35 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Oct 10, 2008 12:40 pm
Reply with quote

OK, thanks for clarification.
Back to top
View user's profile Send private message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Fri Oct 10, 2008 5:25 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 10, 2008 5:36 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Oct 10, 2008 5:40 pm
Reply with quote

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 icon_cry.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 10, 2008 9:08 pm
Reply with quote

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 icon_wink.gif

d
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Oct 10, 2008 9:33 pm
Reply with quote

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
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 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 Error when install DB2 DB2 2
Search our Forums:

Back to Top