Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Burned by NUMERIC DIGITS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 187
Location: Toronto, ON, Canada

PostPosted: Tue Sep 16, 2014 10:40 pm    Post subject: Burned by NUMERIC DIGITS
Reply with quote

I want to share a hard learned lesson with others so hopefully they can avoid the same error. I had the below REXX logic
Code:
IF key <> prev_key THEN DO
  /* do something */
  key = prev_key
end


When I ran this with a 15 character key consisting of all digits it would sometimes fail even though the values were different. REXX was treating the string as a number and would shorten it to the default 11 numeric digits before doing the comparision.

To work around this I used the below
Code:
IF key \== prev_key THEN DO
  /* do something */
  key = prev_key
end

This seems to force REXX to treat the variables as a string instead of a number.
The other solution would be to specify NUMERIC DIGITS 15

Comments? Suggestions?
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us