Null-capable fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)

 

You can use FMTOPT(*MAP) or FMTOPT(*NOCHK) for null-capable fields. The copy operation is handled differently according to your settings. FMTOPT(*MAP) or FMTOPT(*NOCHK) must be specified on the CPYF command if:

For the record formats to be identical, corresponding fields in the from-file and to-file must both be null-capable or not null-capable. For the CPYFRMQRYF command, the same is true except that the open query file record format is used (rather than a from-file format). When you use FMTOPT(*MAP):

When you use FMTOPT(*NONE), the null values in the from-file are copied to the to-file when copying a database file to a physical data file with identical record formats.

When you use FMTOPT(*DROP), the null values are copied.

When you use FMTOPT(*NOCHK) or FMTOPT(*CVTSRC), the record data is copied directly from left to right into the to-file without any regard to field types. Null values are not copied if *NOCHK or *CVTSRC is specified, because the record formats need not be identical. Either a user-specified or default value is copied to the to-file rather than a null value.

 

Parent topic:

Specifying data for different field types and attributes