Previous Topic: Alerts for VSAM Monitoring

Next Topic: Null Values and Null Fields

NDB Data Formats

An NDB supports the following data formats:

CHAR

Data is provided, and stored, as a character string. NCL restricts character data to printable characters. The maximum length of a character field is 255 characters if not keyed, or (VSAM key length - 8) if keyed. Character fields collate (for keying, or sorting in a scan) on ascending EBCDIC value. Trailing blanks are not significant and are removed from stored data. The option to automatically make data upper case is available. Alternatively, data can be stored as lower case but searched as if it were upper case.

NUMERIC

Data is provided as an optionally signed number, from -2,147,483,648 to +2,147,483,647. Numeric fields collate on ascending binary value (-10 before -5 before 0 before +5 before +10). The minimum VSAM key length for an NDB guarantees that numeric data can always be keyed.

HEX

Data is provided as an even number of hexadecimal characters (0-9, A-F, or a-f). Trailing blanks are eliminated from the value. Trailing zeros are significant, and are stored. The maximum length of the character representation of a HEX field is 254, giving a maximum binary length of 127. If keyed, the maximum character representation length is ((VSAM key length - 9) * 2). A null-valued HEX field can be represented by a character value of one blank. HEX fields collate on ascending binary value, with values that are equal except for the number of trailing zeros collating on increasing length.

DATE

Data is provided in one of several formats, controlled by the user and/or system language code, and the current &NDBCTL DATEFMT setting. Basically, the provided value is in YYMMDD format. The data is stored internally as packed digits in the form YYMMDD. Date fields collate on ascending date value. The minimum VSAM key length for an NDB guarantees that date data can always be keyed.

As the DATE format does not include a century, CA recommends use of the CDATE format instead.

CDATE

Data is provided in one of several formats, controlled by the user and/or system language code, and the current &NDBCTL DATEFMT setting. The data is stored internally as a 3-byte binary number, being the numbers of days from 1/1/0001.

TIME

Data is provided in HHMMSS.TTTTTT format (the decimal point and fraction can be truncated or omitted). The data is stored internally as a 5-byte binary number, being the number of microseconds since midnight.

TIMESTAMP

Data is provided in YYYYYMMDDHHMMSS.TTTTTT format. The data is stored internally as a concatenation of a 3-byte CDATE and 5-byte TIME.

FLOAT

Data is provided as a floating point number. It is stored internally in IBM 8-byte normalized floating point format. The numbers are stored to 15 significant digits and with an exponent of +70. Floating point fields are collated on ascending numeric value.