C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

D Data Type Correspondence
Table 66: Integer Types, Part 1 contains the return value size generated by HP language compilers
for each data type. Use this information when you need to specify values with the Accelerator
ReturnValSize option. These tables are also useful if your programs use data from files created by
programs in another language, or your programs pass parameters to programs written in callable
languages.
Note that the return value sizes given in these tables do not correspond to the storage size of SQL
data types. For a complete list of SQL data type correspondence, see:
SQL/MP Programming Manual for C
SQL/MX Programming Manual for C and COBOL.
NOTE: COBOL includes COBOL 74, COBOL85, and SCREEN COBOL unless otherwise
noted.
If you are using the Data Definition Language (DDL) utility to describe your files, see the Data
Definition Language (DDL) Reference Manual for more information.
Table 66 Integer Types, Part 1
32-Bit Integer16-Bit Integer8-Bit Integer
INT(32)INTSTRINGC-series BASIC
INT(16)
int in the 32-bit or wide data
model
int in the 16-bit data model
short
char
1
unsigned char
C and C++
long
unsigned
signed char
unsigned long
PIC S9(n) COMPPIC S9(n) COMPAlphabeticCOBOL
ororNumeric DISPLAY
PIC 9(n) COMP without P or V,
5 < n < 9
PIC 9(n) COMP without P or V, 1
< n < 4
Alphanumeric-Edited
Alphanumeric
Index Data Item
2
Index Data Item
2
Numeric-Edited
NATIVE-4
3
NATIVE-2
3
INTEGER*4INTEGER
4
--FORTRAN
INTEGER*2
LONGINTINTEGERBYTED-series Pascal
INT32INT16Enumeration, unpacked, < 256
members
Subrange, unpacked n…m,
–2147483648 < n and m <
CARDINAL
1
BYTE or CHAR value parameter
Subrange, unpacked, n…m, 0
< n and m < 255 2147483647, but at least n or
m outside -32768…32767
range
Enumeration, unpacked, > 256
members
Subrange, unpacked, n…m,
-32768 < n and m < 32767, but
at least n or m outside 0…255
range
NUMERIC(5)… NUMERIC(9)NUMERIC(1)… NUMERIC(4)CHARSQL
PIC 9(5) COMP …PIC 9(9)
COMP
PIC 9(1) COMP… PIC 9(4)
COMPSMALLINT
INTEGER
430 Data Type Correspondence