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). Specify the name of the new to-file on the TOFILE parameter. 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. For more information, see Authorities, user profiles, and file capabilities of the to-file created by Copy File (CPYF). Your system specifies different identifiers and attributes to the new file based on whether you use the CPYF or CPYFRMQRYF command. See Specifying CRTFILE(*YES) on either the CPYF or CPYFRMQRYF command.