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 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 server specifies different identifiers and attributes to the new file based on whether you use the CPYF or CPYFRMQRYF command.