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

Burned by NUMERIC DIGITS


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

Active User


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

PostPosted: Tue Sep 16, 2014 10:40 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Want to mask Middle 8 Digits of Debit... COBOL Programming 3
No new posts Handling the numeric data in unstring... COBOL Programming 18
Search our Forums:

Back to Top