You can create and define formats for fixed-length records
from the Record Formats and the Fixed
Format Definition windows.
To create a format for fixed-length records:
- Choose from the HPL main window.
The
Record Formats window appears, as
the following figure shows.
- Click Create in the Mode group.
- Click Fixed in
the Type group.
- Choose a name for the format and type it in the Create
Format text box.
- Click OK.
The
Fixed
Format definition window appears. The title bar includes
the name that you chose for the format. The following figure shows
the
Fixed Format Definition window as it might
appear after you prepare the format for the file that
Figure 1 shows.
Table 1. The Fixed-Format Definition window optionsDisplay option |
Description |
Bytes |
The Bytes text box specifies
the number of characters that the field occupies in the record. In
the Bytes text box, you must set the number
of bytes for your data types. Although ipload uses
default information to calculate an offset if you create a format
that has a new length, it does not readjust the lengths for existing
formats. To change the default information, see The Machines window. The ipload utility
automatically calculates the total length of the data file as you
add each field description. |
Decimals |
The Decimals text box
specifies the number of decimal places that are displayed when you
convert floating-point types to ASCII. You can set the number of decimals
only for the Float and Double data types. |
- Click Add in the Operation group.
- Choose a name for the field and
type the name in the Field Name text box.
- Type the data type in the Data
Type text box. For columns that contain user-defined
types (UDTs) columns, you must choose an Ext Type format. For information
about user-defined types, see HCL
Informix® Guide to SQL: Reference.
The
down arrow next to the Data Type text box displays
the selection list that appears at the right in Figure 2. Data types allowed in a fixed format describes the data types
that appear in the selection list.
- Type the appropriate value in the Bytes text
box (or in the Decimals text box, if appropriate). If you chose the Ext Type String in the Data Type box, you must
specify a size, or you get an error. Field size depends on the type
of data and its representation in the data file.
- Click Perform.
After you click Perform, ipload calculates
the proper offset for this field in the record and displays the value
under the Offset heading, as Figure 2 shows.
- Repeat steps 7 through 10 for each field in your
data file.
- Click OK to save the format and
return to the Record Formats window.
- Click Cancel to return to the HPL
main window.
Tip: Use the field name to map the data file to
the database. You can type any name that you choose. You might find
it easier to remember the names if you use the same name as the corresponding
column of the database.