Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
114 <strong>File</strong> <strong>Management</strong> V4R5<br />
in the current job under which the copy command is running. This may be<br />
*MDY, *DMY, *YMD, or *JUL. The length of the zoned decimal field must be 5,0<br />
(if the current job format is *JUL) or 6,0 (if the current job format is *MDY,<br />
*DMY, or *YMD). The system attempts to convert or copy it to the date to-field.<br />
v For converting a zoned decimal field to a time field, the system assumes the<br />
zoned decimal field data is in the *HMS format (no separators). The length of<br />
the zoned decimal field must be 6,0. The system attempts to convert or copy it<br />
to the time to-field.<br />
v For converting a zoned decimal field to a timestamp field, the system assumes<br />
the zoned decimal field data is in the YYYYMMDDHHMMSS form (no<br />
separators). The length of the zoned decimal field must be 14,0. The system<br />
attempts to convert or copy it to the timestamp to-field.<br />
When converting a date, time, or timestamp field to a zoned decimal field,<br />
FMTOPT(*MAP) is specified and the corresponding from- and to-field names<br />
match, the system uses the current job specified form to determine what format the<br />
zoned decimal data should be in. The following applies:<br />
v For converting a date field to a zoned decimal field, the system assumes the<br />
zoned decimal field data is to be in the same date format (no separators) as<br />
specified in the current job under which the copy command is running. This<br />
may be *MDY, *DMY, *YMD, or *JUL. The length of the zoned decimal field<br />
must be 5,0 (if the current job format is *JUL) or 6,0 (if the current job format is<br />
*MDY, *DMY, or *YMD). The system attempts to convert or copy the date field<br />
to it.<br />
v For converting a time field to a zoned decimal field, the system assumes the<br />
zoned decimal field data is to be in the *HMS format (no separators). The length<br />
of the zoned decimal field must be 6,0. The system attempts to convert or copy<br />
the time field to it.<br />
v For converting a timestamp field to a zoned decimal field, the system assumes<br />
the zoned decimal field data is to be in the YYYYMMDDHHMMSS form (no<br />
separators). The length of the zoned decimal field must be 14,0. The system<br />
attempts to convert or copy the timestamp field to it.<br />
Any conversion not successful because of a data value, data format, or data-length<br />
error causes an information message to be sent. The to-file field is set with its<br />
default value.<br />
Null-capable fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)<br />
FMTOPT(*MAP) or FMTOPT(*NOCHK) must be specified on the CPYF command<br />
if:<br />
v The from-file is a database data file.<br />
v The to-file is a physical data file.<br />
v The record formats are not identical.<br />
For the record formats to be identical, corresponding fields in the from-file and<br />
to-file must both be null-capable or not null-capable. For the CPYFRMQRYF<br />
command, the same is true except that the open query file record format is used<br />
(rather than a from-file format).<br />
When you use FMTOPT(*MAP):<br />
v Null values are copied from null-capable from-file fields to null-capable to-file<br />
fields that are named alike. This copying can only happen if the field attributes<br />
and lengths are compatible.