COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
B Data Type Correspondence
These tables contain 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.
Refer to the appropriate SQL/MP or SQL/MX manual for a complete list of SQL data type
correspondence. Also note that the return value sizes given in these tables do not correspond to
the storage size of SQL data types.
NOTE: COBOL includes COBOL 74, HP COBOL, 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 149 Integer Types, Part 1
32-Bit Integer16-Bit Integer8-Bit Integer
HP C and
HP C++
int in the 32-bit or wide data
model
int in the 16-bit data modelchar
1
short
unsigned char
longunsigned
signed char
unsigned long
COBOL PIC S9(n ) COMP orPIC S9(n ) COMP orAlphabetic
Numeric DISPLAY
PIC 9(n ) COMPPIC 9(n ) COMP
Alphanumeric-Edited
without P or V,without P or V,
Alphanumeric
5 <=n <= 91 <=n <= 4
Numeric-Edited
Index Data Item
2
Index Data Item
2
NATIVE-4
3
NATIVE-2
3
INTEGER*4--FORTRAN INTEGER
4
INTEGER*2
Pascal LONGINTINTEGERBYTE
INT32INT16Enumeration, unpacked,
Subrange, unpacked n…m,
–2147483648 <=n and m <=
CARDINAL
1
<= 256 members
Subrange, unpacked,
BYTE or CHAR value parameter
n …m, 0 <= n and
2147483647, but at least n or
m outside -32768…32767 range
Enumeration, unpacked,
m <= 255
> 256 members
Subrange, unpacked,
n …m, -32768 <=n and
m <= 32767, but at least
n or m outside 0…255 range
CHARSQL/MP or
SQL/MX
NUMERIC(5)…NUMERIC(1)…
NUMERIC(9)NUMERIC(4)
PIC 9(5) COMP …PIC 9(1) COMP…
PIC 9(9) COMPPIC 9(4) COMP
INTEGERSMALLINT
INT(32)INTSTRINGTAL
INT(16)UNSIGNED(8)pTAL
UNSIGNED(16)
211Return Value
Size (Words)
1
Unsigned integer
2
Index Data Item is a 16-bit integer in COBOL 74 and a 32-bit integer in HP COBOL
3
HP COBOL only
4
INTEGER is normally equivalent to INTEGER*2. The INTEGER*4 and INTEGER*8 compiler directives redefine INTEGER.
1234 Data Type Correspondence










