SMALLINT |
S9(4) COMP-4,
S9(4) COMP-5,
S9(4) COMP,
or S9(4) BINARY
|
|
INTEGER |
S9(9) COMP-4,
S9(9) COMP-5,
S9(9) COMP,
or S9(9) BINARY
|
|
DECIMAL(p,s) or NUMERIC(p,s) |
S9(p-s)V9(s) COMP-3 or
S9(p-s)V9(s)
PACKED-DECIMAL
DISPLAY SIGN
LEADING SEPARATE
NATIONAL SIGN
LEADING SEPARATE
|
p is precision; s is scale. 0<=s<=p<=31.
If s=0, use S9(p)V or S9(p). If s=p, use
SV9(s). If the COBOL compiler does not support 31–digit decimal
numbers, no exact equivalent exists. Use COMP-2. |
REAL or FLOAT (n) |
COMP-1
|
1<=n<=21 |
DOUBLE PRECISION, DOUBLE or FLOAT (n) |
COMP-2
|
22<=n<=53 |
BIGINT |
S9(18) COMP-4, S9(18) COMP-5, S9(18) COMP, or S9(18) BINARY |
|
CHAR(n) |
Fixed-length character string.
For example,
01 VAR-NAME PIC X(n).
|
1<=n<=255 |
VARCHAR(n) |
Varying-length character string.
For example,
01 VAR-NAME.
49 VAR-LEN PIC S9(4)
USAGE BINARY.
49 VAR-TEXT PIC X(n).
|
The inner variables must have a level of 49. |
GRAPHIC(n) |
Fixed-length graphic string. For
example,
01 VAR-NAME PIC G(n)
USAGE IS DISPLAY-1.
|
n refers to the number of double-byte characters, not
to the number of bytes. 1<=n<=127 |
VARGRAPHIC(n) |
Varying-length graphic string.
For example,
01 VAR-NAME.
49 VAR-LEN PIC S9(4)
USAGE BINARY.
49 VAR-TEXT PIC G(n)
USAGE IS DISPLAY-1.
|
n refers to the number
of double-byte characters, not to the number of bytes.
The inner variables must have a level of 49. |
BINARY(n) |
SQL TYPE IS BINARY(n) |
1<=n<=255 |
VARBINARY(n) |
SQL TYPE IS VARBINARY(n) |
1<=n<=32 704 |
DATE |
Fixed-length character string of
length n. For example,
01 VAR-NAME PIC X(n).
|
If you are using a date exit routine, n is determined by that
routine. Otherwise, n must be at least 10. |
TIME |
Fixed-length character string of
length n. For example,
01 VAR-NAME PIC X(n).
|
If you are using a time exit routine, n is
determined by that routine. Otherwise, n must be at
least 6; to include seconds, n must be at least 8. |
TIMESTAMP |
Fixed-length character string of
length n. For example,
01 VAR-NAME PIC X(n).
|
n must be at least 19. To include microseconds, n
must be 26; if n is less than 26, truncation occurs on
the microseconds part. |
TIMESTAMP(0) |
Fixed-length
character string of length n. For example,
01 VAR-NAME PIC X(n).
|
n
must be at least 19. |
TIMESTAMP(p)
p > 0 |
Fixed-length
character string of length n. For example,
01 VAR-NAME PIC X(n
). |
n
must be at least 19. To include fractional seconds, n
must be 20+x where x is the number of
fractional seconds to include; if x is less than p,
truncation occurs on the fractional seconds part. |
TIMESTAMP(0)
WITH TIME ZONE |
Varying-length
character string. For example,
01 VAR-NAME.
49 VAR-LEN PIC S9(4) USAGE
BINARY. 49 VAR-TEXT PIC
X(n).
|
The
inner variables must have a level of 49. n must be at
least 25. |
TIMESTAMP(p)
WITH TIME ZONE |
Varying-length
character string. For example,
01 VAR-NAME.
49 VAR-LEN PIC S9(4) USAGE
BINARY. 49 VAR-TEXT PIC
X(n).
|
The
inner variables must have a level of 49. n must be at
least 26+p. |
Result set locator |
SQL TYPE IS
RESULT-SET-LOCATOR
|
Use this data type only for receiving result sets. Do not use
this data type as a column type. |
Table locator |
SQL TYPE IS
TABLE LIKE
table-name
AS LOCATOR
|
Use this data type only in a user-defined function or stored
procedure to receive rows of a transition table. Do not use this
data type as a column type. |
BLOB locator |
USAGE IS SQL TYPE IS
BLOB-LOCATOR
|
Use this data type only to manipulate data in BLOB columns. Do
not use this data type as a column type. |
CLOB locator |
USAGE IS SQL TYPE IS
CLOB-LOCATOR
|
Use this data type only to manipulate data in CLOB columns. Do
not use this data type as a column type. |
DBCLOB locator |
USAGE IS SQL TYPE IS
DBCLOB-LOCATOR
|
Use this data type only to manipulate data in DBCLOB columns.
Do not use this data type as a column type. |
BLOB(n) |
USAGE IS SQL TYPE IS
BLOB(n)
|
1≤n≤2147483647 |
CLOB(n) |
USAGE IS SQL TYPE IS
CLOB(n)
|
1≤n≤2147483647 |
DBCLOB(n) |
USAGE IS SQL TYPE IS
DBCLOB(n)
|
n is the number of double-byte characters. 1≤n≤1073741823 |
XML |
SQL TYPE IS XML AS BLOB(n) |
1≤n≤2147483647
|
XML |
SQL TYPE IS XML AS CLOB(n) |
1≤n≤2147483647
|
XML |
SQL TYPE IS XML AS DBCLOB(n) |
n is the number of double-byte characters. 1≤n≤1073741823
|
BLOB file reference |
USAGE IS SQL TYPE IS
BLOB-FILE
|
Use this data type only to manipulate data in BLOB columns. Do
not use this data type as a column type. |
CLOB file reference |
USAGE IS SQL TYPE IS
CLOB-FILE
|
Use this data type only to manipulate data in CLOB columns. Do
not use this data type as a column type. |
DBCLOB file reference |
USAGE IS SQL TYPE IS
DBCLOB-FILE
|
Use this data type only to manipulate data in DBCLOB columns.
Do not use this data type as a column type. |
XML BLOB file reference |
SQL TYPE IS XML AS BLOB-FILE |
Use this data type only to manipulate XML data as BLOB files.
Do not use this data type as a column type.
|
XML CLOB file reference |
SQL TYPE IS XML AS CLOB-FILE |
Use this data type only to manipulate XML data as CLOB files.
Do not use this data type as a column type.
|
XML DBCLOB file reference |
SQL TYPE IS XML AS DBCLOB-FILE |
Use this data type only to manipulate XML data as DBCLOB
files. Do not use this data type as a column type. |
ROWID |
SQL TYPE IS ROWID
|
|