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.

For mapping to time fields, the seconds part (and corresponding separator) may<br />

be omitted from the character field.<br />

For *USA form values, the AM or PM with a preceding blank is required. These<br />

rules are also true for date, time, or timestamp values that are entered when using<br />

FROMKEY with *BLDKEY, TOKEY with *BLDKEY, or INCREL parameters on the<br />

CPYF command. All other instances of date, time, and timestamp data require<br />

leading zeros when necessary and no truncation.<br />

For both forms of the TOKEY parameter (*BLDKEY or non-*BLDKEY) the<br />

from-field data must be in a particular format for a chronological comparison to<br />

be made. For the date field, you must use the *ISO or *JIS format to make a<br />

chronological comparison. For the time fields, you must use the *HMS, *ISO, *EUR,<br />

or *JIS formats to make the chronological comparison. For any other formats of<br />

date or time fields (for date (*MDY, *DMY, *YMD, *JUL, *EUR, or *USA) or for<br />

time (*USA)), chronological comparisons are not possible because the TOKEY<br />

parameter performs a straight character string comparison. When you cannot make<br />

chronological comparisons, the system sends an informational message, and the<br />

copy operation continues.<br />

When copying data into a file with date, time, or timestamp fields, and the<br />

from-file is a device file or FMTOPT(*NOCHK) or FMTOPT(*CVTSRC) has<br />

been specified, output mapping errors may occur if the data copied to a date,<br />

time, or timestamp field is not valid data for the to-file field format and separator<br />

attributes. You cannot copy the record if this occurs. If you use the CPYF or<br />

CPYFRMQRYF command, you can specify an error level other than zero (ERRLVL<br />

parameter) to bypass the record and continue the copy operation. When copying<br />

into date, time, or timestamp fields in these instances, it is important that the<br />

from-file data is valid for the to-file.<br />

Preventing position errors when copying files<br />

A position error occurs when the copy file function cannot locate the first record to<br />

copy in the from-file member. This can happen when using the CPYF, CPYSRCF,<br />

CPYTODKT, or CPYTOTAP commands. If any of the following conditions are true,<br />

you may receive a position error for the from-file member:<br />

v You specified the FROMKEY parameter, and all records in the member are less<br />

than the FROMKEY value or the member is empty.<br />

v You specified the FROMRCD parameter beyond the end of the member or the<br />

member is empty.<br />

v The value of the from-file member position (the POSITION parameter of the<br />

OVRDBF command) is beyond the end of the member, is not valid for the access<br />

path of the from-file, or the member is empty.<br />

If a member position error occurs, the member may not be added to the to-file,<br />

and no information about the member is added to the print lists.<br />

If a member position error occurs during a copy operation that involves multiple<br />

members, the copy operation will continue with the next member.<br />

If a member position error occurs for all members, a print list is not produced, and<br />

the to-file may not be created.<br />

Chapter 4. Copying files 125

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

Saved successfully!

Ooh no, something went wrong!