Progress/400
Product Guide
Progress-to-DB2/400 Data Type Mapping
The following sections describe how the DataServer converts data types when you port an existing Progress database to DB2/400.
CHARACTER
Progress CHARACTER fields map to DB2/400 single-byte character set (SBCS) fields, which correspond to the DDS A data type. The display format specified in the Progress Data Dictionary determines the DB2/400 field size. For example, the Customer.Name field has a display format of 20 characters. The equivalent DB2/400 field length is 20 bytes.
The DB2/400 database can store character data in variable-length character strings. To enable this function when creating character fields in the Progress/400 Data Dictionary, follow these steps:
- Choose the Field mode button in the Progress/400 Data Dictionary main window.
- Choose Modify schema.
- Select the table that will contain new fields from the Tables list.
- Choose the Create Field button. The following dialog box appears:
![]()
- Enter a Format mask equal to the total maximum length.
- Select the Variable Allocated toggle box and enter the allocated amount.
If you enter a Format of x(500) and allocate 50, DB2/400 will store the first 50 characters in the allocated area of the field with a pointer to any remaining characters. Additionally, the amount you allocate must be less than the maximum length of the Format. Choose the Help button to access detailed information on all of the elements in the dialog box.
- Choose OK.
DATE
Progress DATE fields map to DB2/400 date fields, which correspond to the DDS L data type. The DataServer creates a DB2/400 date field whose internal storage format is *ISO, which stores dates as yyyy-mm-dd. Table 2–3 lists the date formats supported by DB2/400.
When a Progress application accesses dates in a DB2/400 database, it displays them in one of these formats, regardless of the internal storage format:
Use the Field Properties sheet in the Progress/400 Data Dictionary tool to switch between formats. To display dates in other formats, use the Date Format (-d) startup parameter or manipulate the data through your application code.
DECIMAL
Progress DECIMAL fields map to DB2/400 packed decimal numbers, which correspond to the DDS P data type. Depending on the number of digits in the DECIMAL field, the data type maps to packed decimal (odd digits) or to packed decimal (even digits).
DB2/400 requires that you define precision (number of digits) and scale (number of digits to the right of the decimal point). The DataServer uses the value of the Decimals field in the definition as the value for the scale. It uses the number of digits in the format field as the value for precision. If no format information is available, the DataServer uses the Progress default format (->>,>>9.99) as the value for precision.
INTEGER
Progress INTEGER fields map to DB2/400 integers, which correspond to the DDS B data type. Whether an INTEGER field maps to a four-byte or a two-byte integers depends on the size of the display format:
LOGICAL
Progress LOGICAL fields map to single-character fields in DB2/400. A 0 represents false, a 1 represents true, and a question mark (?) represents the unknown value. The Progress/400 Data Dictionary labels these fields as Logical.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |