Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Numeric error: Bad arithmetic conversion in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Numeric error: Bad arithmetic conversion in REXX
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

Site Director


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

PostPosted: Fri Oct 10, 2008 9:34 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 10, 2008 11:28 am    Post subject:
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

Site Director


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

PostPosted: Fri Oct 10, 2008 12:35 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 10, 2008 12:40 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 10, 2008 5:40 pm    Post subject:
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

Site Director


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

PostPosted: Fri Oct 10, 2008 9:08 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Oct 10, 2008 9:33 pm    Post subject: Reply to: Numeric error: Bad arithmetic conversion in REXX
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us