Understanding field data types

An alphanumeric data type indicates that data in the field can consist of any ASCII characters.

A data type of D indicates a decimal or implied-decimal data type. Decimal data represents a signed, whole number consisting of ASCII numeric characters (0 through 9). Implied-decimal data is a signed number with a whole number part and a fractional precision, in which either the whole number or the fractional precision may be zero. For both decimal and implied-decimal data, a negative sign (–) doesn’t take a data storage space. Instead, the sign is stored in the rightmost digit with a ‘p’ through ‘y’, corresponding to 0 through 9. For implied-decimal, the decimal point does not take a data storage space either.

A data type of DT or TM indicates that the data is stored in a ReportWriter supported date/time storage format. See Appendix B: Date and Time Formats for a list of supported formats.

The user-defined data type indicates that the data in the field may need to be modified by the user before being displayed by ReportWriter. To support such a field, ReportWriter calls a user-replaceable subroutine (RW_USAGE_METHOD) before displaying the field, and it passes the field and its redisplay format to that subroutine each time the field is displayed. When RW_USAGE_METHOD is called, the possible data types are displayed as UA, UD, UDT, and UTM.

The enumerated data type indicates that a decimal value stored in the field is associated with an alphanumeric string. For enumerated fields, the length of the format string corresponds to the length of the associated alphanumeric string. A report may have a maximum of 99 enumerated fields.

Enumerated fields are defined in the Repository and are specified in conjunction with a Toolkit allow list, selection list, or selection window; ReportWriter supports enumerated fields only in conjunction with allow lists and selection lists. See the description of the Enumerated field in Validation information for more information.

Note

If you use an enumerated field that is not associated with an allow list or selection list in a report, ReportWriter just displays blanks for your enumerated string value. (ReportWriter can’t access the window entry text for windows that are predefined or built on-the-fly.)

The alpha string is used when the enumerated field is selected as any of the following:

The numeric value is used when the enumerated field is used in any of the following:

To use the numeric value from the file for printing, selections, or sorting, create a calculation field that assigns the numeric value into a temporary field.

When an enumerated field is used in selection statements or conditionals, the comparison is always case insensitive; therefore, you should not enclose the comparison string in quotation marks.

For example, when you use the calculation field defined in figure 1, you get the numbers 1, 2, 3, and so on, instead of blue, red, yellow, and so on. This temporary field can be used for printing, selecting, sorting, or in conditionals.

1. Using an enumerated field.