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 />

object. This is true unless the user is a member of a group profile and has<br />

OWNER(*GRPPRF) specified for the profile.<br />

If you specify OWNER(*GRPPRF), the group profile becomes the owner of the<br />

to-file. In this case, if the user profile running the copy command does not have<br />

authority to add a member or write data to the new file, the copy command fails.<br />

The created to-file does not maintain the file capabilities of the from-file. The to-file<br />

allows update, delete, read, and write operations, regardless of whether the<br />

from-file allowed these operations. Following are special considerations for the<br />

new to-file:<br />

v If the number of records copied into a member is greater than the maximum size<br />

of the created to-file, the to-file is extended without intervention by the system<br />

operator.<br />

v If the from-file is an SQL table, view, or index, the created to-file will be a<br />

physical file that is not an SQL table. However, when the from-file contains<br />

LOBs, datalinks, or user-defined types, the created to-file is an SQL table.<br />

v If the from-file has a trigger program associated with it, the CPYF and<br />

CPYFRMQRYF commands do not copy the trigger information to the to-file<br />

when the CRTFILE parameter is used.<br />

v If you create a new file (CRTFILE(*YES)) from a file with constraints, the<br />

constraint definitions do not copy to the new file.<br />

v If you create a new file (CRTFILE(*YES)) from a file with user-defined functions,<br />

the user-defined functions do not copy to the new file.<br />

Adding, replacing, and updating records (MBROPT parameter)<br />

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

On the CPYF, CPYFRMDKT, CPYFRMQRYF, CPYFRMTAP, or CPYSRCF<br />

commands, you can add or replace existing data in the to-file by specifying<br />

different attributes on the MBROPT parameter. The CPYF command also allows<br />

you to update duplicate key records and add non-duplicate key records to a to-file<br />

member. You can do these tasks by specifying *REPLACE, specifying *ADD, or<br />

specifying *UPDATE on the MBROPT parameter (see page Specifying *REPLACE<br />

when copying files).<br />

Specifying *REPLACE when copying files<br />

By specifying *REPLACE, you essentially clear the member. The copied records are<br />

the only records in the member when the operation completes. You must have<br />

authority to clear the member in order to specify MBROPT(*REPLACE).<br />

For copy commands other than the CPYFRMQRYF command, when you specify<br />

*REPLACE, copy command processing fails if the from-file does not contain any<br />

records. When you specify *REPLACE on the CPYFRMQRYF command, the to-file<br />

member will be cleared even if the open query file contains no records.<br />

*REPLACE is the default value for the CPYSRCF command. All other copy<br />

commands have the default value of *NONE; however, *NONE is valid only for<br />

copying to a device file.

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

Saved successfully!

Ooh no, something went wrong!