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
 

 

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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


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