×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 11 Jul 2013 12:02, Gary Thompson wrote:
This link:
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp
seems to say DB2 integers are 0 to 9 digits
The DB2 for i 4-byte INTEGER allows up to 10 digits. I am unsure
what a zero digit integer would look like, definition-time or run-time
:-) So whatever was the intended doc link, would seem to require some
review for what it intends to imply; if indeed the above comment was
intended to be a literal quotation from the docs.
While the DDS and some other interfaces may have anomalies or
difficulties due to the restrictions enforced using those interfaces to
the DB2 for i, the database itself supports only signed integers of 2,
4, and 8 bytes, but every possible signed value is fully supported for
each [SMALLINT, INT or INTEGER, or BIGINT]. Thus supporting the "full
range of binary values" as expressed in the doc link included inline below.
darren@xxxxxxxxx on Thursday, July 11, 2013 12:46 PM wrote:
I've been curious about %int. What is the maximum size integer it
could return. For example, could it return like a 10u00, a 10i00,
or even less at maybe a 5i00?
The following link and its description of an 8-byte signed integer
seems to reflect the actual maximal representational capabilities of the
RPG for its %INT builtin [as compiled and tested on v5r3]; i.e. any
intermediate value smaller than the smallest value shown, or larger than
the largest value shown, will fail with a MCH1210 "Receiver value too
small to hold result" and RNQ0103 "The target for a numeric operation is
too small to hold the result":
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzasd/sc092508275.htm
IBM i 7.1 Information Center -> Programming -> Programming languages ->
RPG -> ILE RPG Language Reference -> Definitions -> Chapter 9. Data
Types and Data Formats -> Numeric Data Type
_i Integer Format i_
"The integer format is similar to the binary format with two exceptions:
* The integer format allows the full range of binary values
* The number of decimal positions for an integer field is always zero.
...
_Field length_
...
20-digit integer
-9223372036854775808 to 9223372036854775807
..."
As an Amazon Associate we earn from qualifying purchases.