Creating the to-file (CRTFILE parameter)

 

To copy a physical or logical file when no to-file exists to receive the data, you can create the to-file by specifying CRTFILE(*YES).

In such cases, you specify the name of the new to-file on the TOFILE parameter, and qualify the name with the name of an existing library for which you have the required authority. (You must also have authority to the Create Physical File (CRTPF) command). You cannot override the created to-file that you specified to a different file or library.

CRTFILE(*YES) automatically adds members and records to the new file.

The newly created file has certain authorities, capabilities, and a user profile associated with it. Your system specifies different identifiers and attributes to the new file based on whether you use the Copy File (CPYF) or Copy From Query File (CPYFRMQRYF) command.

 

Parent topic:

Copying files

 

Related concepts


Copying physical or logical files
Authorities, user profiles, and file capabilities of the to-file
Specifying CRTFILE(*YES) on either the CPYF or CPYFRMQRYF command