30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

v Fields that are not null-capable can also be copied from and to null-capable<br />

fields, provided the field attributes and lengths are compatible. The results to<br />

expect in the to-file field are:<br />

– Copying a null-capable field to a null-capable field<br />

Null values in the from-file field are copied to the to-file field. Values that are<br />

not null in the from-file field are also copied to the to-file field. For values<br />

that are not null in the from-file field that cause conversion errors during the<br />

copy, the default value of the to-file field is placed into the to-file field.<br />

– Copying a field that is not null capable to a null-capable field<br />

Values that are not null in the from-file field are copied to the to-file field. For<br />

values in the from-file field that cause conversion errors during the copy<br />

operation, the default value of the to-file field is placed into the to-file field.<br />

– Copying a null-capable field to a field that is not null capable<br />

Values that are not null in the from-file field are copied to the to-file field. If a<br />

conversion error occurs when copying values that are not null or the from-file<br />

field value is null, the to-file field default value is placed into the to-file.<br />

When you use FMTOPT(*NONE), the null values in the from-file are copied to the<br />

to-file when copying a database file to a physical data file with identical record<br />

formats.<br />

When you use FMTOPT(*DROP), the null values are copied.<br />

When you use FMTOPT(*NOCHK) or FMTOPT(*CVTSRC), the record data is<br />

copied directly from left to right into the to-file without any regard to field types.<br />

Null values are not copied if *NOCHK or *CVTSRC is specified, because the record<br />

formats need not be identical. Either a user-specified or default value is copied to<br />

the to-file rather than a null value.<br />

CCSIDs using FMTOPT(*MAP) or FMTOPT(*NOCHK)<br />

When FMTOPT(*NOCHK) is specified, no CCSID conversions are done. Record<br />

data is copied directly from left to right into the to-file without any regard to field<br />

types or CCSIDs.<br />

When FMTOPT(*MAP) is specified and a valid conversion is defined between the<br />

CCSID of the from-field and the CCSID of the to-file field, the character data is<br />

converted to the CCSID of the to-file field. However, if the CCSID of the from-file<br />

field or the CCSID of the to-file field is 65535, no conversions are done.<br />

When FMTOPT(*NONE) is specified, the from-file and to-file attributes must be<br />

the same, unless one of the CCSIDs in corresponding fields is 65535.<br />

For the CPYFRMQRYF command, the FMTOPT rules are the same except that the<br />

changed query format is used instead of a from-file format.<br />

DBCS-graphic fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)<br />

When mapping graphic fields to bracketed DBCS fields, shift-out and shift-in<br />

characters are added around the DBCS data. When mapping from bracketed-DBCS<br />

fields to graphic fields, the shift-out and shift-in characters are removed. For<br />

variable-length fields, the graphic field length is expressed in the number of DBCS<br />

characters and the bracketed DBCS length is expressed in number of bytes<br />

Chapter 4. Copying files 115

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!