Fields that characterize the input area

Restriction
This section does not apply to values from DATE, TIME, and TIMESTAMP columns. For information on values for those types, see Handling DATE, TIME, and TIMESTAMP information.

During a session, the subprogram DSQUXDT might need to service many different edit codes. If it does, consider making your routine an executive routine, which does nothing but analyze the edit codes passed to it and then invokes an appropriate routine to do the actual formatting. The design makes the source code easier to read and easier to modify when new user edit codes are devised.

In addition to the fields in the interface control block, your edit exit routine receives, in the input field, information about the data to be formatted.

The value to be formatted appears in the field ECSINPT. How it is represented depends on whether the value to be formatted is numeric or character, as determined by the ECSINTYP field, or whether the edit code is a U or V code, as determined by the ECSECODE field.

How U-type edit codes are represented in the input area

Numeric values are represented in internal database format. For example, if ECSINTYP is equal to 496 (INTEGER data type), the value is a full-word integer. If it is 484 (DECIMAL data type), the value is in decimal format. Scale and precision for decimal format are in the ECSINSCL and ECSINPRC fields. Length (in bytes) is in the ECSINLEN field.

Numeric data from defined columns, calculations, and summary values is returned as extended floating point values, a data type not explicitly supported by DB2. The length (16 bytes) is in the ECSINLEN field.

Character or graphic values are represented in their internal, character-string format, with one exception: for variable-length strings (for example, VARCHAR data type), only the string itself appears and not the preceding length field. For all character values, the string length (in bytes) is in the ECSINLEN field.

How V-type edit codes are represented in the input area

Numeric values are represented by a numeric character string. The length is contained in the field ECSINLEN. Leading or trailing zeros fill out the string if required.

The string contains no sign or decimal point. Instead, the sign appears as a blank or a minus sign in the field ECSINSGN, and the position of the decimal point is in the field ECSINSCL. For example, suppose that the string in ECSINPT is 12345, that ECSINSGN is blank, and that ECSINSCL is equal to 3; then the value represented is +12.345.

Character or graphic values are represented in their character string. For all character values, the string length (in bytes) is in the ECSINLEN field.

[ Previous Page | Next Page | Contents | Index ]