Figure 105. DB2 Server for VSE & VM Data Types for Assembler
Description | DB2 Server for VSE & VM Keyword | Equivalent Assembler Declaration |
---|---|---|
A binary integer of 31 bits, plus sign. | INTEGER or INT | F |
A binary integer of 15 bits, plus sign. | SMALLINT | H |
A packed decimal number, precision p, scale s (1<=p<=31 and 0<=s<=p). In storage the number occupies a maximum of 16 bytes. Precision is the total number of digits. Scale is the number of digits to the right of the decimal point. | DECIMAL[(p[,s])] or DEC[(p[,s])]1 1 | PLn['decimal constant'] or P'decimal
constant'
For declarations using PLn, the precision is 2n-1 (n is the number of bytes). For the declarations using P, the length of the decimal constant, excluding the decimal point and sign, is the precision. For the declarations using P or PL, the scale is that of the decimal constant. For the declarations using P, the decimal constant must be specified. For the declarations using PLn, the decimal constant is optional. If it is not specified, the scale is 0. |
A single precision (4-byte) floating-point number in short System/390 floating-point format. | REAL or FLOAT(p), 1 <= p <= 21 | E |
A double precision (8-byte) floating-point number in long System/390 floating-point format. | FLOAT or FLOAT(p), 22 <= p <= 53 or DOUBLE PRECISION | D |
A fixed-length character string of length n where 0 < n <= 254. | CHARACTER[(n)] or CHAR[(n)] | CLn |
A varying-length character string of maximum length n. If n > 254 or <= 32,767; this data type is considered a long field. (See Using Long Strings.) (Only the actual length is stored in the database.) | VARCHAR(n) | H,CLn |
A varying-length character string of maximum length 32 767 bytes. | LONG VARCHAR | H,CLn |
A fixed-length string of n DBCS characters, where 0 < n <= 127. | GRAPHIC[(n)] | Not supported. |
A varying-length string of n DBCS characters. If n > 127 or <= 16 383, this data type is considered a long field. (See Using Long Strings.) | VARGRAPHIC(n) | Not supported. |
A varying-length string of DBCS characters of maximum length 16 383. | LONG VARGRAPHIC | Not supported. |
A fixed or varying-length character string representing a date. The minimum and maximum lengths vary with both the format used and whether it is an input or output operation. See the DB2 Server for VSE & VM SQL Reference manual for more information. | DATE | CLn or H,CLn |
A fixed or varying-length character string representing a time. The minimum and maximum lengths vary with both the format used and whether it is an input or output operation. See the DB2 Server for VSE & VM SQL Reference manual for more information. | TIME | CLn or H,CLn |
A fixed or varying-length character string representing a timestamp. The lengths can vary on input and output. See the DB2 Server for VSE & VM SQL Reference manual for more information. | TIMESTAMP | CLn or H,CLn |
Notes: