MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » July 2014

Re: RPG integer vs SQL integer.



fixed

Nope, just a mismatch in terminology....

DDS and it's corresponding interfaces such as DSPFFD defined numeric fields
in terms of digits.

When binary numerics where added, they had a problem. While you can stick
2 147 483 647
into an integer field you can't stick
9 999 999 999

Like you could with a 10 digit packed or zoned field. So they called it
9b0 since
999 999 999
would fit.

RPG added support of 9b0 fields, but even though the DB would support 2 147
463 647, RPG's binary fields would not.

So in ROG IV, you got 10i0 for true integer support. But the non-SQL
interfaces into the DB report 9b0 even though it is a true integer field.

Charles


On Mon, Jul 21, 2014 at 4:16 PM, Luis Rodriguez <luisro58@xxxxxxxxx> wrote:

Steve,

My mistake. I'm afraid that you are right....

Although V5R3's SQL Reference manual states that:

*Large integer *
A large integer is a binary number composed of 4 bytes with a precision of
10 digits. The range of large integers is −2147483648 to +2147483647.


If I create a table with:
CREATE TABLE @PRUEBAS/TEST_INT (LARGE_INTE INT NOT NULL WITH DEFAULT)

A quick DSPFFD shows the LARGE_INTE field as 9B 0. Could it be that the
sign occupies a digit's byte?

Regards,

Luis

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Mon, Jul 21, 2014 at 3:20 PM, Luis Rodriguez <luisro58@xxxxxxxxx>
wrote:

Steve,

At least on V5R3, SQL integers are defined as 4-byte, 10-digits precision
numbers, ranging from −2147483648 to +2147483647, the same as ILE RPG's
10i spec.

Regards,

Luis


Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Mon, Jul 21, 2014 at 3:11 PM, Steve Landess <sjl_abc@xxxxxxxxxxx>
wrote:

I believe that SQL integer fields are defined as 9,0.
-sjl


wrote in message news:mailman.1234.1405971393.
8590.midrange-l@xxxxxxxxxxxx...

Adding title line...

I've got a stored procedure wrapper for a program.
CREATE PROCEDURE ROUTINES/GDSSYS002
(INOUT sysasp INT ,
INOUT pctsysasp INT,
INOUT PctPerm INT ,
INOUT PctTemp INT )
LANGUAGE RPGLE
NOT DETERMINISTIC
CONTAINS SQL

Been working great. However, first time we ran it against a 22TB
machine.


Message ID . . . . . . : MCH1210 Severity . . . . . . . : 40
Message type . . . . . : Escape
Date sent . . . . . . : 07/21/14 Time sent . . . . . . :
14:57:27

Message . . . . : Receiver value too small to hold result.

Is there a difference between 10i0 in RPG and
(INOUT sysasp INT , in SQL?

Very simple RPG program
D GDSSYS002 PI
D SysAsp 10i 0
D PctSysAsp 10i 0
D PctPerm 10i 0
D PctTemp 10i 0
/free
reset SysAsp;
reset PctSysAsp;
qwcrssts(ssts0200:%len(ssts0200):'SSTS0200':'*NO':ERRC0100);
Select;
When ExceptionId=*blanks; // OK
SysAsp=ssts0200.SysAsp;
PctSysAsp=ssts0200.PctSysAsp;
PctPerm=ssts0200.PctPerm;
PctTemp=ssts0200.PctTemp;
Other;
dsply ExceptionId;
EndSl;
*inlr=*on;
return;
/end-free



In debug mode:

SysAsp=ssts0200.SysAsp;
SYSASP = 22500008


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact