The Copy from Query File (CPYFRMQRYF) command can be used to copy from an open query file to another file or to print a formatted listing of the records.
Any open query file, except those using distributed data management (DDM) files, specified with the input, update, or all operation value on the FILE parameter of the Open Query File (OPNQRYF) command can be copied using the CPYFRMQRYF command. The CPYFRMQRYF command cannot be used to copy to logical files.
Although the CPYFRMQRYF command uses the open data path of the open query file, it does not open the file. Consequently, you do not have to specify SHARE(*YES) for the database file you are copying.