To copy floating point fields and null fields that are in a System/370™ format to an iSeries™ 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 CPYF command converts each floating point field from System/370 hexadecimal format to the IEEE format that is used by the iSeries. 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.
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.