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.

72 <strong>File</strong> <strong>Management</strong> V4R5<br />

Table 9. Copy Operations (continued)<br />

From-<strong>File</strong>s To-<strong>File</strong>s<br />

:<br />

1<br />

2<br />

3<br />

4<br />

5<br />

If the from-file and the to-file are both diskette files, the to-file must be spooled.<br />

If the to-file does not exist before the copy operation, the copy operation will create<br />

a physical file as the to-file if you specified:<br />

v CRTFILE(*YES) on the CPYF command and the from-file is a physical or logical<br />

file.<br />

v CRTFILE(*YES) on the CPYFRMQRYF command.<br />

Open query files can only be copied by using the CPYFRMQRYF command.<br />

CPYFRMQRYF is not allowed for open query files that use DDM files.<br />

If TOFILE(*PRINT) is specified, the from-file records are copied to the<br />

<strong>IBM</strong>-supplied printer device file QSYSPRT and formatted according to the<br />

OUTFMT parameter.<br />

An inline data file (which is handled like a device file) is included as part of a<br />

batch job when the job is read by a reader program.<br />

While copying records, some of the copy commands can perform the following<br />

functions:<br />

v Copy from or to the first file member, a particular file member, a generic set of<br />

members, or all file members (FROMMBR and TOMBR parameters).<br />

v Add a member to a physical to-file if the member does not exist.<br />

v Add records to an existing file member, replace the contents of an existing<br />

member (MBROPT parameter), or update duplicate key records in a to-file<br />

member.<br />

v Select certain records to copy by one of the following methods:<br />

– Selecting records by record format name when a multi-format logical file is<br />

copied (RCDFMT parameter).<br />

– Specifying records by starting at a relative record number and ending at a<br />

relative record number (FROMRCD and TORCD parameters).<br />

– Specifying records by starting with a specific record key value and ending<br />

with another specific record key value (FROMKEY and TOKEY parameters).<br />

– Specifying the number of records that you want to copy (NBRRCDS<br />

parameter).<br />

– Selecting records by the contents of one or more character positions in the<br />

record or in a field in the record (INCCHAR parameter).<br />

– Selecting records according to the values that are contained in one or more<br />

fields in the record (INCREL parameter).<br />

– Disregard or include deleted records in the from-file during the copy if<br />

processing the from-file in arrival sequence (COMPRESS parameter).<br />

v Print copied records, excluded records, or error records (PRINT parameter) in a<br />

specified format (OUTFMT parameter).<br />

v Copy records whose from-file and to-file record formats are different (FMTOPT<br />

parameter). When formats are different, you can perform any of the following<br />

actions:<br />

– Map fields whose names are the same in the from-file and to-file record<br />

formats and whose field attributes are compatible (*MAP value).<br />

– Drop fields in the from-file record format that do not exist in the to-file record<br />

format (*DROP value).

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

Saved successfully!

Ooh no, something went wrong!