Errors When Transferring Data from BASIC Random Files

When you transfer data from a workstation BASIC random file to a system file, the following errors can occur:
  • Data in this field is too short for the system field. The data is padded. This error occurs when the file contains character or hexadecimal data shorter than the field length specified on the system. This error can occur if the workstation field is defined as shorter than the system, or if the data in the last record of the file is too short. Character fields are padded on the right with EBCDIC spaces, and hexadecimal fields are padded with zeros.
  • Data in this field is too long for the system field. The data is truncated. This error occurs when the workstation file-description file defines character or hexadecimal data as longer than the field length specified on the system.

    For character data, this error occurs only if the extra bytes are not spaces. For hexadecimal data, this error occurs only if the extra bytes are not zeros. These extra bytes are then truncated so that the data fits into the specified iSeries, eServer™ i5, or System i5® field.

  • The value of numeric data is too large for the system field. The maximum number is used. This error occurs when:
    • Numeric data in the workstation field does not fit into the specified number of bytes for the system field.
    • The decimal value of a numeric field contains more digits than are specified for the system field.
  • Data in this field has too many decimal positions. The number is rounded down to zero. In BASIC random processing, this error occurs if the value of the number is too small to fit into the specified field.

    For example, the number 0.00001 does not fit into a system zoned field specified as being 2 bytes in length and 2 decimal positions to the right of the decimal point. In this example, the resulting value is zero.

  • Data for this field is missing. The default values are used. This error occurs when a data field is defined, but the data is not in the file. This means that the end of the file is reached before all of the defined data is found. For BASIC random files, this error occurs only on the last record in the file, since there are no explicit record delimiters.

    When this error occurs, the field or fields for which data is defined, but not found, are filled with default values and are transferred to the iSeries, eServer i5, or System i5 file. These default values are EBCDIC spaces for character fields and zeros for numeric fields.

    To supply your own default values, use the Default (DFT) keyword in the DDS for the file.

When you transfer data from a BASIC random file to an iSeries, eServer i5, or System i5 file, any data shorter than the record length defined for the system file is padded with EBCDIC spaces.

Because there are no record delimiters in BASIC random files, this error can occur only on the last record of the file. This probably indicates that the record length of the system file does not match the record length of the workstation file.