Converting System/370 floating-point and null fields
To copy floating-point fields and null fields that are in a System/370™ format to an i5/OS® format, use FMTOPT(*CVTFLOAT) for the floating-point fields and FMTOPT(*NULLFLAGS) for the null fields. You can use these two values together in one command: FMTOPT(*CVTFLOAT *NULLFLAGS).
The FMTOPT(*CVTFLOAT) parameter on the Copy File (CPYF) command converts each floating point field from System/370 hexadecimal format to the IEEE format that is used by the i5/OS operating system. The CPYF command converts those fields that are identified by the external description of the physical to-file.
The FMTOPT(*NULLFLAGS) parameter on the CPYF command takes the byte (or flag) following each null-capable field and uses it to indicate if the corresponding input field is null. The CPYF command takes the fields that are identified as null-capable by the external description of the physical to-file. If the byte (or flag) is blank (X'40') or contains X'00', the data is considered not null. Any other value for the flag causes the corresponding input field data to be ignored and the output value set to null.
If you use *CVTFLOAT or *NULLFLAGS and the input file is externally described, the input file's external description is not used in mapping the copied data.
When you use *CVTFLOAT and *NULLFLAGS (together or independently), make certain that the to-file is an existing database, externally-described, physical data file. You cannot specify the *CVTFLOAT and *NULLFLAGS values when any of the following conditions are true:
- You have specified RCDFMT(*ALL) for a multiple-format logical from-file
- You have specified any value other than the default for CRTFILE, and the to-file does not exist
- You have specified a value other than the default for the FROMKEY, TOKEY, INCCHAR, INCREL, SRCOPT, or SRCSEQ parameters.
When you specify either *CVTFLOAT or *NULLFLAGS, all other values for the FMTOPT parameter are ignored. If you use both *CVTFLOAT and *NULLFLAGS on one CPYF command, both values are recognized.
When you specify the *CVTFLOAT value (and have not specified *NULLFLAGS), the expected from-file record length is the to-file record length. When you have specified the *NULLFLAGS value, the expected from-file record length is equal to the sum of the to-file record length and the number of null-capable fields in the to-file. The from-file's record length cannot be less than the expected length. If the from-file's record length is greater than the expected length, an inquiry message is sent to the QSYSOPR message queue to determine if the user wants to continue. If the user continues, the trailing data (fields) in the from-file is truncated in the to-file.
The to-file must contain the correct result format description. The from-file data must be in the same corresponding position as the to-file data. Otherwise, output mapping errors or unpredictable results might occur. Date, time, and timestamp data must be in the external form of the to-file field specification. Numeric data types in the to-file must be large enough to contain the expected data. For example, decimal data types in the to-file must be created using the maximum possible precision for the byte length of the field to avoid the loss of any digits. Because there are no CCSID conversions, the to-file fields should be created with the expected CCSIDs.
For more information about converting floating points and null fields, see Errors in converting System/370 floating-point and null fields.
- Errors in converting System/370 floating-point and null fields
Any conversion errors will cause CPF2958 messages to be issued for up to 10 records with errors. A CPF2959 message will be issued after the copy operation; this message indicates the number of records that caused an error if more than 10 records caused conversion errors.
Parent topic:
Copying between different database record formats (FMTOPT parameter)