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.

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

The to-file must contain the correct result format description. The from-file data<br />

must be in the same corresponding position as the to-file data. Otherwise, output<br />

mapping errors or unpredictable results may occur. Date, time, and timestamp data<br />

must be in the external form of the to-file field specification. Numeric data types in<br />

the to-file must be large enough to contain the expected data. For example, decimal<br />

data types in the to-file must be created using the maximum possible precision for<br />

the byte length of the field to avoid the loss of any digits. Because there are no<br />

CCSID conversions, the to-file fields should be created with the expected CCSIDs.<br />

Errors in converting system/370 floating point and null fields<br />

Any conversion errors will cause CPF2958 messages to be issued for up to 10<br />

records with errors. A CPF2959 message will be issued after the copy operation;<br />

this message indicates the number of records that caused an error if more than 10<br />

records caused conversion errors.<br />

If there are no floating point fields in the to-file and *CVTFLOAT is specified, no<br />

error messages are issued. However, no floating point conversion is done. If you<br />

have not specified any null-capable fields in the to-file and *NULLFLAGS, no error<br />

messages are issued. However, the from-file data is assumed to have no null bytes<br />

(or flags). When you use *CVTFLOAT and *NULLFLAGS, the CPYF command<br />

expects the from-file data to be defined by the to-file format.<br />

You should use the *CVTFLOAT and *NULLFLAGS values only for files that<br />

require conversion of the System/370 hexadecimal floating point fields or<br />

conversion with null flags. Using these values for other files may cause<br />

unpredictable results including possible data corruption and output errors.<br />

System/370 floating point fields must be converted only once. If the fields are<br />

converted more than once, multiple conversions occur, and the data will be<br />

damaged.<br />

This CPYF function is compatible with the data that is placed on tape by the DB2<br />

unload function (DSNTIAUL). You must manually create the result tables or files<br />

with SQL or DDS on the AS/400 system before you can run the CPYF function to<br />

convert the data; use the formats produced by the DSNTIAUL function to do this.<br />

Conversion rules for copying files<br />

Table 15 on page 120 shows the field conversions that are allowed between<br />

mapped fields in the from-file and to-file record formats. If fields with the same<br />

name have incompatible attributes between the from-file and to-file formats, you<br />

can only use FMTOPT(*NOCHK) to perform the copy. An X indicates that the<br />

conversion is valid, and a blank indicates a field mapping that is not valid.<br />

When mapping character fields, the field being copied is truncated on the right if it<br />

is longer than the field into which the copy is made. For example, a character field<br />

of length 10 is copied into a character field of length 6; ABCDEFGHIJ becomes<br />

ABCDEF. If the field that is being copied is shorter than the field into which it is<br />

copied, the field is padded on the right with blanks. For example, a character field<br />

of length 10 is copied into a character field of length 12; ABCDEFGHIJ becomes<br />

ABCDEFGHIJxx (x = blank).<br />

When you are mapping numeric fields, and the field being copied is longer than<br />

the field into which the copy is made, the field being copied is truncated on the<br />

left and right of the decimal point. For example, a zoned decimal field of length 9<br />

Chapter 4. Copying files 119

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

Saved successfully!

Ooh no, something went wrong!