Home | Previous Page | Next Page   Defining Formats > Fixed-Length Records >

Creating a Fixed Format

The Record Formats window and the Fixed Format definition windows let you create and define formats for fixed-length records.

To create a format for fixed-length records
  1. Choose Components > Formats from the HPL main window.

    The Record Formats window appears, as Figure 53 shows.

    Figure 53. The Record Formats Window
    begin figure description - This graphic depicts the ipload graphical user interface. The onpladm command line utility provides the same functionality. - end figure description
  2. Click Create in the Mode group.
  3. Click Fixed in the Type group.
  4. Choose a name for the format and type it in the Create Format text box.
  5. Click OK.

    The Fixed Format definition window appears. The title bar includes the name that you chose for the format. Figure 54 shows the Fixed Format definition window as it might appear after you prepare the format for the file that Figure 52 shows.

    Figure 54. A Completed Fixed-Format Definition Window with an Open Selection List
    begin figure description - This graphic depicts the ipload graphical user interface. The onpladm command line utility provides the same functionality. - end figure description
  6. Click Add in the Operation group.
  7. Choose a name for the field and type the name in the Field Name text box.
  8. 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, refer to IBM 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 54. Data Types Allowed in a Fixed Format describes the data types that appear in the selection list.

  9. 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 will get an error. Field size depends on the type of data and its representation in the data file.
  10. 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 54 shows.

  11. Repeat steps 7 through 10 for each field in your data file.
  12. Click OK to save the format and return to the Record Formats window.
  13. 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.

Data Types Allowed in a Fixed Format

You can use the following data types when you are preparing a fixed format.

Data Type Description
Chars ASCII format data
Short
Unsigned Short
Integer
Unsigned Integer
Long Integer
Unsigned Long
Float
Double
The Machines description specifies the number of bytes required in fixed format for integers and floating-point values (see Machines Window.) When you select one of these data types, ipload sets the number of bytes.
Date Date string
UNIX Date A long integer interpreted as the system date from a UNIX system
Blob Length The number of bytes of BYTE and TEXT (binary large object) information that follow this record
Blob File A file that contains BYTE and TEXT data
BLOB and CLOB A file that contains BLOB and CLOB data
Simple LO Length The number of bytes of simple large object data (BYTE and TEXT data) that follow this record
Simple LO File The name of a file that contains a Simple LO data (BYTE and TEXT data)
Int8 An eight-byte integer type
Serial8 An eight-byte serial column
Ext Type String The ASCII representation of an extended data type (Ext Type) value
Ext Type String Length The length of an ASCII Ext Type value The Ext Type value follows at the end of the input/output record. Use Ext Type String Length data type if you have data that contains null UDT values.
Ext Type Binary The binary representation of an Ext Type value
Ext Type Binary Length The length of the binary representation of an Ext Type value. The binary value follows at the end of the input/output record. Use Ext Type Binary Length data type if you have data that contains null UDT values.

The HPL supports several data types under the Ext Type mechanism. As a result, the specific names of these data types do not appear in the data-type selection list. For the following data types, choose the appropriate Ext Type data type:

Bytes

In Figure 54, 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 new format that has a new length, it does not readjust the lengths for existing formats. To change the default information, see Machines Window. The ipload utility automatically calculates the total length of the data file as you add each field description.

Decimals

In Figure 54, 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.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]