Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

Appendix F.2 SQL data types and COBOL data descriptions

This section provides the correspondence between SQL data types and COBOL data descriptions.

Data can be exchanged between variables of compatible data types and between variables of either convertible or assignable data types.

Organization of this subsection
(1) SQL data types and COBOL data descriptions
(2) SQL data types and COBOL data descriptions when arrays are used
(3) SQL data types and COBOL data descriptions when repetition columns are used

(1) SQL data types and COBOL data descriptions

The table below shows the SQL data types and COBOL data descriptions. Note that the data descriptions in these tables can also be coded as follows:

PICTURE:
PIC

COMPUTATIONAL:
COMP

COMPUTATIONAL-n:
COMP-n

9(n):
99 9

X(n):
XX X

OCCURS n TIMES:
OCCURS 1 TO n TIMES 0
OCCURS 1 TO n
OCCURS n

Table F-8 SQL data types and COBOL data descriptions

SQL data type COBOL data description Item coding Remarks
SMALLINT

L1 elementary-item-name
PICTURE S9(4)
COMPUTATIONAL.
elementary-item or independent-item --
INTEGER

L1 elementary-item-name
PICTURE S9(9)
COMPUTATIONAL.
elementary-item or independent-item --
DECIMAL [(p[,s])]

L1 elementary-item-name
PICTURE S9(p-s) [V9(s)]
COMPUTATIONAL-3.
elementary-item or independent-item If 1 [Figure] p [Figure] 38#10, 0 [Figure] s [Figure] p,
and p = s, then SV9(s).
If s = 0, then [V9(s)] is omitted.
L1 elementary-item-name
PICTURE S9(p-s)[V9(s)]
DISPLAY SIGN

LEADING SEPARATE.#9, #12
L1 elementary-item-name
PICTURE S9(p-s)[V9(s)]
DISPLAY SIGN
TRAILING.#11, #12, #13
SMALLFLT (REAL)

L1 elementary-item-name
COMPUTATIONAL-1.
elementary-item or independent-item --
FLOAT (DOUBLE PRECISION)

L1 elementary-item-name
COMPUTATIONAL-2.
elementary-item or independent-item --
CHAR [(n)]
[CHARACTER SET [MASTER.]EBCDIK]

L1 elementary-item-name
[CHARACTER SET[IS]
[MASTER.]EBCDIK]
PICTURE X(n).#5
elementary-item or independent-item 1 [Figure] n [Figure] 30,000
CHAR[(2n)]
CHARACTER SET [MASTER.]UTF16
If the HiRDB server's default character set is not UTF-8:#15
CHAR type cannot be used.
If the HiRDB server's default character set is UTF-8:#15
L1 elementary-item-name
PICTURE N(n).
elementary-item or independent-item 1 [Figure] n [Figure] 15,000
VARCHAR (n)
[CHARACTER SET [MASTER.]EBCDIK]
L2 group-item-name
[CHARACTER SET[IS]
[MASTER.]EBCDIK].

L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n).#5
A group item composed of two elementary items
elementary-item-name-1:
character-string-length (number of bytes)
elementary-item-name-2:
character-string
1 [Figure] n [Figure] 32,000
VARCHAR(2n)
CHARACTER SET [MASTER.]UTF16
If the HiRDB server's default character set is not UTF-8:#15
VARCHAR type cannot be used.
If the HiRDB server's default character set is UTF-8:#15
L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE N(n).
A group item composed of two elementary items
elementary-item-name-1: character-string-length (number of bytes)
elementary-item-name-2: character-string
1 [Figure] n [Figure] 16,000
NCHAR [(n)] If the HiRDB server's default character set is not UTF-8:#15
L1 elementary-item-name
PICTURE N(n).

If the HiRDB server's default character set is UTF-8:#15
NCHAR type cannot be used.
elementary-item or independent-item 1 [Figure] n [Figure] 15,000
NVARCHAR (n) If the HiRDB server's default character set is not UTF-8:#15
L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE N(n)

If the HiRDB server's default character set is UTF-8:#15
NVARCHAR type cannot be used.
A group item composed of two elementary items

elementary-item-name-1:
character-string-length

elementary-item-name-2:
character-string
1 [Figure] n [Figure] 16,000
MCHAR [(n)] L1 elementary-item-name
PICTURE X(n).#6

If the HiRDB server's default character set is UTF-8,#15 this can be coded as follows:
L1 elementary-item-name
PICTURE N(n2).#14
elementary-item or independent-item 1 [Figure] n [Figure] 30,000
MVARCHAR (n) L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n).#6

If the HiRDB server's default character set is UTF-8,#15 this can be coded as follows:
L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE N(n2).#14
A group item composed of two elementary items

elementary-item-name-1:
character-string-length

elementary-item-name-2:
character-string
1 [Figure] n [Figure] 32,000
DATE

L1 elementary-item-name
PICTURE X(10).#6
elementary-item or independent-item --
TIME

L1 elementary-item-name
PICTURE X(8).#6
elementary-item or independent-item --
TIMESTAMP[(p)] L1 elementary-item-name PICTURE X(n).#6 elementary-item or independent-item If p = 0, n = 19.
If p = 2, n = 21 or 22.
If p = 4, n = 23 or 24.
If p = 6, n = 25 or 26.
INTERVAL YEAR TO DAY

L1 elementary-item-name
PICTURE S9(8)
COMPUTATIONAL-3.
elementary-item or independent-item --
INTERVAL HOUR TO SECOND L1 elementary-item-name
PICTURE S9(6)
COMPUTATIONAL-3.
elementary-item or independent-item --
ROW#3 Combination of data items and group items in this table#1 A group item composed of elementary items 1 [Figure] total-length
[Figure] 30,000
BLOB

L2 group-item-name#2
[USAGE [IS]]
SQL TYPE IS
BLOB(n[K |M |G]).#4, #7
elementary-item Default: 1 [Figure] n [Figure] 2,147,483,647
In units of K: 1 [Figure] n [Figure] 2,097,152
In units of M: 1 [Figure] n [Figure] 2,048
In units of G: 1 [Figure] n [Figure] 2
BINARY(n) L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(9)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE X(n).#5, #7
A group item composed of two elementary items
elementary-item-name-1:
character-string-length
elementary-item-name-2:
character-string
character-string-length is the byte count.
1 [Figure] n [Figure] 2,147,483,647
BLOB locator L1 elementary-item-name
SQL TYPE IS
BLOB AS LOCATOR.#8
elementary-item or independent-item --
BINARY locator L1 elementary-item-name
SQL TYPE IS
BINARY AS LOCATOR.#8
elementary-item or independent-item --
Indicator variable Other than BLOB, BINARY, BLOB locator, or BINARY locator

L1 elementary-item-name
PICTURE S9(4)
COMPUTATIONAL.
elementary-item or independent-item --
BLOB, BINARY, BLOB locator, or BINARY locator

L1 elementary-item-name
PICTURE S9(9)
COMPUTATIONAL.
SQL statement L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n)
A group item composed of two elementary items

elementary-item-name-1:
character-string-length

elementary-item-name-2:
character-string
1 [Figure] n [Figure] 2,000,000

Legend:
--: Not applicable
L1: Level number 01-49 or 77
L2: Level number 01-48
L3: Level number 02-49 (L2 < L3)
n: Length (bytes)
p: Precision (total number of digits)
s: Scale (number of digits beyond the decimal point)

#1: The following clauses can be used:
  • REDEFINES
  • OCCURS
  • ADDRESSED BY
If you manipulate a table with the FIX attribute in units of rows, you must specify a data item that is to store a row of data as a group item. Each column of the target table must correspond to a data item belonging to the group item. To specify a data item that corresponds to a column, you use the data description that corresponds to the data type of that column. Note that a data description that requires data format conversion cannot be used.
The following table shows the data descriptions that require data format conversion and the substitute data descriptions that can be used:
Column's data type Data description that is not available because it requires data format conversion Substitute data description that can be used
DECIMAL DISPLAY (external decimal format) COMP-3 (internal decimal format)
MCHAR PICTURE N (Japanese data item) PICTURE X (alphanumeric item)
DATE PICTURE X(10)
10: Number of characters in character string representation
PICTURE X(4)
4: Number of bytes in the format X'YYYYMMDD'
TIME PICTURE X(8)
8: Number of characters in character string representation
PICTURE X(3)
3: Number of bytes in the format X'hhmmss'
TIMESTAMP(p) PICTURE X(n)
n: Number of characters in character string representation
PICTURE X(n)
n=7 + p/2
n: Number of bytes in the format X'YYYYMMDDhhmmss[nn...n]'
Note
You can use the REDEFINES clause to redefine the data items corresponding to the columns of the target table. In such a case, you can specify an item to be redefined regardless of the data type of the corresponding column. However, you can use only those elementary items that correspond to the INTEGER, SMALLINT, DECIMAL, FLOAT SMALLFLT, CHAR, and NCHAR types shown in Table F-8 and the group items consisting of these elementary items. For these elementary and group items, you can specify the OCCURS clause.

#2:
A group item name should be coded as no more than 21 characters. However, for COBOL2002, a group item name should be 22 characters or less.

#3:
The ROW type is allowed only when the HiRDB server and the HiRDB client use the same endian type.

#4: The coding of a BLOB UAP is expanded internally as follows:
L2 group-item-name.
 49 group-item-name_RESERVED PIC S(9) USAGE IS BINARY. 1
 49 group-item-name_LENGTH   PIC S(9) USAGE IS BINARY. 2
 49 group-item-name_DATA     PIC X(m).                 3
  1. group-item-name_RESERVED is not used.
  2. group-item-name_LENGTH is equal to the BLOB actual length.
  3. group-item-name_DATA is the BLOB data storage area (where m denotes the actual data length).

#5:

This item can be defined using 9 in place of X. If 9 is used for definition, the operation when a character string containing a character other than a number is substituted or received as the retrieval result depends on the installed COBOL compiler.

#6:
Do not use 9 for X during definition, although using 9 does not cause an error during preprocessing.

#7:
The maximum value that can be declared depends on the installed COBOL compiler. For details, see the manual for the COBOL compiler to be used.

#8:
The following internal expansion takes place:
 
L1 elementary-item-name PICTURE S9(9) COMPUTATIONAL.

#9:
The HiRDB server's data type is DECIMAL, but it is expressed as an external decimal item whose first byte is an operation sign.

#10:
The value range depends on the specifications of the COBOL compiler. For example, for COBOL85, the range is 1 [Figure] p [Figure] 18.

#11
The HiRDB server's data type is DECIMAL, but it is expressed as an external decimal item (zoned format) that has an operation sign in the 4 high-order bits of the rightmost byte.

#12
If a data item format is specified for a numeric item with an operation sign, DISPLAY (external decimal item) is assumed. If the SIGN clause is not specified for an external decimal item with an operation sign, the location and format of the operation sign are treated as being the same as in the DISPLAY SIGN TRAILING format.

#13
The DISPLAY SIGN TRAILING format is supported only in COBOL85 and COBOL2002.

#14
This data description containing a Japanese data item (PICTURE N) of COBOL is permitted as a data description corresponding to the SQL mixed character string data type (MCHAR or MVARCHAR) only if the Unicode functionality of COBOL2002 is used.
For details about UAP execution using the Unicode functionality of COBOL2002, see 8.4.3 UAP execution using the Unicode functionality of COBOL2002.
You can use this data description in embedded variable declarations and the declarations of data areas for storing ? parameter values.
For embedded variables:
The data is treated as having a character data type (CHAR or VARCHAR) for which UTF-16LE or UTF-16BE is specified as the character set name according to the -XU16 option specification. The following table shows the details:
Data description format Data description in COBOL Attribute of embedded variable
Data type Character set name
Fixed length L1 elementary-item-name
PICTURE N(n2).
CHAR(m)
m = 2 x n2
UTF-16LE or UTF-16BE
Variable length L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE N(n2).
VARCHAR(m)
m = 2 x n2
UTF-16LE or UTF-16BE
Note: For variable-length elementary-item-name-1, specify the length (in bytes) of the Japanese-language character string to be stored in elementary-item-name-2. Because the character codes for data to be stored in a Japanese data item are UTF-16 (within the range of UCS-2), the length of the Japanese language character string in bytes is twice the number of characters. This length in bytes is 2 x n2 or less.
For data areas for storing ? parameter values:
If you use this data description in the declaration of a data area for storing a ? parameter value, you must set the SQL descriptor area and character set descriptor area as shown in the following table:
Data description format Data description in COBOL Setting in SQL descriptor area Setting in character set descriptor area
Data code Data length
Fixed length L1 elementary-item-name
PICTURE N(n2).
Data code of CHAR type 2 x n2 UTF-16LE or UTF-16BE
Variable length L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE N(n2).
Data code of VARCHAR type 2 x n2 UTF-16LE or UTF-16BE
Note: For variable-length elementary-item-name-1, specify the length in bytes of the Japanese-language character string to be stored in elementary-item-name-2. Because the character codes for data to be stored in a Japanese data item are UTF-16 (within the range of UCS-2), the length of the Japanese language character string in bytes is twice the number of characters. This length in bytes is 2 x n2 or less.
For details about the character set names, see Appendix E.1(3) Character set information that can be set in SQLCSN in the character set descriptor area.

#15
If you specify utf-8 as the character code type in the pdntenv command (in UNIX edition, pdsetup command), the HiRDB server's default character set is set to UTF-8.

(2) SQL data types and COBOL data descriptions when arrays are used

The following table shows the SQL data types and COBOL data descriptions when arrays are used.

Table F-9 SQL data types and COBOL data descriptions when arrays are used

SQL data type COBOL data description Item coding Remarks
SMALLINT

L2 elementary-item-name
PICTURE S9(4)
COMPUTATIONAL
OCCURS m TIMES.
A group item composed of repetitions of data items in which the same data structure is repeated through specification of OCCURS --
INTEGER

L2 elementary-item-name
PICTURE S9(9)
OCCURS m TIMES.
--
DECIMAL [(p[,s])]

L2 elementary-item-name
PICTURE S9
(p-s)[V9(s)]
COMPUTATIONAL-3
OCCURS m TIMES.
1 [Figure] p [Figure] 38#3,
0 [Figure] s [Figure] p
If p = s, SV9(s) is used.
If s = 0, [V9(s)] is omitted.

L2 elementary-item-name
PICTURE S9(p-s)[V9(s)]
DISPLAY SIGN LEADING
SEPARATE OCCURS m TIMES.

L2 elementary-item-name
PICTURE S9(p-s)[V9(s)]
DISPLAY SIGN TRAILING
OCCURS m TIMES.
--
SMALLFLT (REAL)

L2 elementary-item-name
COMPUTATIONAL-1
OCCURS m TIMES.
--
FLOAT (DOUBLE PRECISION)

L2 elementary-item-name
COMPUTATIONAL-2
OCCURS m TIMES.
--
CHAR [(n)]
[CHARACTER SET [MASTER.]EBCDIK]

L2 elementary-item-name
[CHARACTER SET[IS]
[MASTER.]EBCDIK]
PICTURE X(n)
OCCURS m TIMES.#1
1 [Figure] n [Figure] 30,000
CHAR[(2n)]
CHARACTER SET [MASTER.]UTF16
If the HiRDB server's default character set is not UTF-8:#5
CHAR type cannot be used.
If the HiRDB server's default character set is UTF-8:#5
L2 elementary-item-name
PICTURE N(n)
OCCURS m TIMES.
1 [Figure] n [Figure] 15,000
VARCHAR (n)
[CHARACTER SET [MASTER.]EBCDIK]

L2 group-item-name
[CHARACTER SET[IS]
[MASTER.]EBCDIK]
OCCURS m TIMES.

L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n).#1
1 [Figure] n [Figure] 32,000
VARCHAR(2n)
CHARACTER SET [MASTER.]UTF16
If the HiRDB server's default character set is not UTF-8:#5
VARCHAR type cannot be used.
If the HiRDB server's default character set is UTF-8:#5
L2 group-item-name-2
OCCURS m TIMES.
L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE N(n).
1 [Figure] n [Figure] 16,000
NCHAR [(n)]

If the HiRDB server's default character set is not UTF-8:#5

L2 elementary-item-name
PICTURE N(n)
OCCURS m TIMES.

If the HiRDB server's default character set is UTF-8:#5
NCHAR type cannot be used.
1 [Figure] n [Figure] 15,000
NVARCHAR (n) If the HiRDB server's default character set is not UTF-8:#5
L2 group-item-name
OCCURS m TIMES.

L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE N(n)

If the HiRDB server's default character set is UTF-8:#5
NVARCHAR type cannot be used.
1 [Figure] n [Figure] 16,000
MCHAR [(n)]

L2 elementary-item-name
PICTURE X(n)
OCCURS m TIMES.#2

If the HiRDB server's default character set is UTF-8,#5 this can be coded as follows:
L2 elementary-item-nameL2 elementary-item-name
PICTURE N(n2)
OCCURS m TIMES.#4
1 [Figure] n [Figure] 30,000
MVARCHAR (n) L2 group-item-name-2
OCCURS m TIMES.

L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n).#2

If the HiRDB server's default character set is UTF-8,#5 this can be coded as follows:
L2 group-item-name-2
OCCURS m TIMES.
L3 elementary-item-name-1
PICTURE S9(4)
COMPUTATIONAL.
L3 elementary-item-name-2 L3 elementary-item-name-2
PICTURE N(n2).#4
1 [Figure] n [Figure] 32,000
DATE

L2 elementary-item-name
PICTURE X(10)
OCCURS m TIMES.#2
--
TIME

L2 elementary-item-name
PICTURE X(8)
OCCURS m TIMES.#2
--
TIMESTAMP(p) L2 elementary-item-name
PICTURE X(n)
OCCURS m TIMES.#2
If p = 0, n = 19.
If p = 2, n = 21 or 22.
If p = 4, n = 23 or 24.
If p = 6, n = 25 or 26.
INTERVAL YEAR TO DAY

L2 elementary-item-name
PICTURE S9(8)
COMPUTATIONAL-3
OCCURS m TIMES.
--
INTERVAL HOUR TO SECOND

L2 elementary-item-name
PICTURE S9(6)
COMPUTATIONAL-3
OCCURS m TIMES.
--
ROW

L2 group-item-name-2
OCCURS m TIMES.
Combination of data items and group items in this table#6
--
BLOB CN CN --
BINARY L2 group-item-name-2
OCCURS m TIMES.
L3 elementary-item-name-1
PICTURE S9(9)
COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE X(n).#1
A group item composed of repetitions of data items in which the same data structure is repeated through specification of OCCURS.
  • FETCH that uses an array
    4 [Figure] n [Figure] 2,147,483,644 (n must be a multiple of 4.)
  • Other than FETCH that uses an array
    4 [Figure] n [Figure] 32,000 (n must be a multiple of 4.)
BLOB locator -- -- --
BINARY locator L2 elementary-item-name
SQL TYPE IS
BINARY AS LOCATOR
OCCURS m TIMES.
Group item consisting of iterative data items that repeat the same data structure according to the OCCURS specification --
Indicator variable Other than BINARY or BINARY locator

L2 elementary-item-name
PICTURE S9(4)
COMPUTATIONAL
OCCURS m TIMES.
--
BINARY or BINARY locator L2 elementary-item-name
PICTURE S9(9)
COMPUTATIONAL
OCCURS m TIMES.
--
SQL statement CN CN --

Legend:
CN: Cannot be coded.
--: Not applicable.
L2: Level number 02-49 (L2 < L3). You cannot specify level number 01, 66, 77, or 88 for L2. For details, see the syntax rules for the OCCURS clause in the COBOL manual.
L3: Level number 03-49
m: Number of array elements (1-4,096)
n: Length (bytes)
p: Precision (total number of digits)
s: Scale (number of digits beyond the decimal point)

#1:
This item can be defined using 9 in place of X. If 9 is used for definition, the operation when a character string containing a character other than a number is substituted or received as the retrieval result depends on the installed COBOL compiler.

#2:
Do not use 9 for X during definition, although using 9 does not result in an error during preprocessing.

#3:
The range depends on the specifications of the COBOL compiler. For example, for COBOL85, the range is 1 [Figure] p [Figure] 18.

#4
This data description containing a Japanese data item (PICTURE N) of COBOL is permitted as a data description corresponding to the SQL mixed character string data type (MCHAR or MVARCHAR) only if the Unicode functionality of COBOL2002 is used. For details, see the notes on MCHAR[(n)] and MVARCHAR(n) in Table F-8 SQL data types and COBOL data descriptions.

#5
If you specify utf-8 as the character code type in the pdntenv command (in UNIX edition, pdsetup command), the HiRDB server's default character set is set to UTF-8.

#6
For details about the combinations, see Table F-8.

(3) SQL data types and COBOL data descriptions when repetition columns are used

The following table shows the SQL data types and COBOL data descriptions when repetition columns are used.

Table F-10 SQL data types and COBOL data descriptions when repetition columns are used

SQL data type COBOL data description Item coding Remarks
SMALLINT L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE S9(4) COMPUTATIONAL OCCURS m TIMES.
A group item composed of two elementary items --
INTEGER L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE S9(9) COMPUTATIONAL OCCURS m TIMES.
--
DECIMAL [(p[,s])] L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE S9
(p-s)[V9(s)] COMPUTATIONAL-3 OCCURS m TIMES.
1 [Figure] p [Figure] 38#3,
0 [Figure] s [Figure] p
When p = s, SV9(s) is used.
When s = 0, [V9(s)] is omitted.
L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE S9(p-s)[V9(s)]
DISPLAY SIGN LEADING SEPARATE
OCCURS m TIMES.
L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE S9(p-s)[V9(s)]
DISPLAY SIGN TRAILING
OCCURS m TIMES.
SMALLFLT (REAL) L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
COMPUTATIONAL-1 OCCURS m TIMES.
--
FLOAT (DOUBLE PRECISION) L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
COMPUTATIONAL-2 OCCURS m TIMES.
--
CHAR [(n)] L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n) OCCURS m TIMES.#1
1 [Figure] n [Figure] 30,000
VARCHAR (n) L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
OCCURS m TIMES.

L4 elementary-item-name-3
PICTURE S9(4) COMPUTATIONAL.

L4 elementary-item-name-4
PICTURE X(n).#1
A group item composed of two elementary items and a group item composed of one elementary item. 1 [Figure] n [Figure] 32,000
NCHAR [(n)] If the HiRDB server's default character set is not UTF-8:#5
L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE N(n) OCCURS m TIMES.

If the HiRDB server's default character set is UTF-8:#5
NCHAR type cannot be used.
A group item composed of two elementary items. 1 [Figure] n [Figure] 15,000
NVARCHAR (n) If the HiRDB server's default character set is not UTF-8:#5
L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
OCCURS m TIMES.

L4 elementary-item-name-3
PICTURE S9(4) COMPUTATIONAL.

L4 elementary-item-name-4
PICTURE N(n).

If the HiRDB server's default character set is UTF-8:#5
NVARCHAR type cannot be used.
A group item composed of two elementary items and a group item composed of one elementary item. 1 [Figure] n [Figure] 16,000
MCHAR [(n)] L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(n) OCCURS m TIMES.#1

If the HiRDB server's default character set is UTF-8,#5 this can be coded as follows:
L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE N(n2) OCCURS m TIMES.#4
A group item composed of two elementary items. 1 [Figure] n [Figure] 30,000
MVARCHAR (n) L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
OCCURS m TIMES.

L4 elementary-item-name-3
PICTURE S9(4) COMPUTATIONAL.

L4 elementary-item-name-4
PICTURE X(n).#1

If the HiRDB server's default character set is UTF-8,#5 this can be coded as follows:
L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.
L3 group-item-name-2 OCCURS m TIMES.
L4 elementary-item-name-3
PICTURE S9(4)
COMPUTATIONAL.
L4 elementary-item-name-4 PICTURE N(n2).#4
A group item composed of two elementary items and a group item composed of one elementary item. 1 [Figure] n [Figure] 32,000
DATE L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(10) OCCURS m TIMES.#2
A group item composed of two elementary items. --
TIME L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE X(8 OCCURS m TIMES.#2
--
TIMESTAMP[(n)] L2 group-item-name.
L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.
L3 elementary-item-name-2
PICTURE X(n) OCCURS m TIMES.#2
If p = 0, n = 19.
If p = 2, n = 21 or 22.
If p = 4, n = 23 or 24.
If p = 6, n = 25 or 26.
INTERVAL YEAR TO DAY L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(8) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE S9(8) COMPUTATIONAL-3 OCCURS m TIMES.
--
INTERVAL HOUR TO SECOND L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(6) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE S9(6) COMPUTATIONAL-3 OCCURS m TIMES.
--
ROW CN CN --
BLOB CN CN --
BINARY CN CN --
BLOB locator CN CN --
BINARY locator CN CN --
Indicator variable (other than BLOB, BINARY, BLOB locator, or BINARY locator) L2 group-item-name

L3 elementary-item-name-1
PICTURE S9(9) COMPUTATIONAL.

L3 elementary-item-name-2
PICTURE S9(4) COMPUTATIONAL OCCURS m TIMES.
A group item composed of two elementary items. --
SQL statement CN CN --

Legend:
CN: Cannot be coded.
--: Not applicable.
L2: Level number 02-49
L3 and L4: Level number 03-49
m: Maximum number of repetition column elements (2 to 30,000)
n: Length (bytes)
p: Precision (total number of digits)
s: Scale (number of digits beyond the decimal point)

Notes
  1. The value of elementary-item-name-1 must be the current element count.
  2. The values of elementary-item-name-2 and group-item-name-2 must be specified as the value of each repetition element.
  3. elementary-item-name-1 of the indicator variable must be specified as the indicator of the entire repetition column.
  4. elementary-item-name-2 of the indicator variable must be specified as the indicator of each repetition column element.

#1:
This item can be defined using 9 in place of X. If 9 is used for definition, the operation when a character string containing a character other than a number is substituted or received as the retrieval result depends on the installed COBOL compiler.

#2:
Do not use 9 for X during definition, although using 9 does not result in an error during preprocessing.

#3:
The range depends on the specifications of the COBOL compiler. For example, for COBOL85, the range is 1 [Figure] p [Figure] 18.

#4
This data description containing a Japanese data item (PICTURE N) of COBOL is permitted as a data description corresponding to the SQL mixed character string data type (MCHAR or MVARCHAR) only if the Unicode functionality of COBOL2002 is used. For details, see the notes on MCHAR[(n)] and MVARCHAR(n) in Table F-8 SQL data types and COBOL data descriptions.

#5
If you specify utf-8 as the character code type in the pdntenv command (in UNIX edition, pdsetup command), the HiRDB server's default character set is set to UTF-8.