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.

Specifying CRTFILE(*YES) on either the CPYF or<br />

CPYFRMQRYF command<br />

If you specify CRTFILE(*YES) on the CPYF command, the to-file that is created<br />

has the same record format and type of access path as the from-file. The file level<br />

and the format level identifiers of the new to-file are identical to the file level and<br />

the format level identifiers of the from-file. The text of from-file members that are<br />

copied is used as the text of any to-file members that are created.<br />

When the from-file is a logical file, the system assigns the following physical file<br />

attributes: SIZE(*NOMAX), ALLOCATE(*NO), and CONTIG(*NO). If the from-file<br />

is a logical file with multiple record formats, the to-file is created with the format<br />

that is specified on the RCDFMT parameter on the CPYF command. See “Selecting<br />

records using a specified record format name (RCDFMT Parameter)” on page 92 for<br />

more information on the RCDFMT parameter.<br />

If you specify CRTFILE(*YES) on the CPYFRMQRYF command, the file level and<br />

the format level identifiers of the new to-file are generated at the time the new<br />

to-file is created. Furthermore, the physical file’s attributes match the first file that<br />

is specified on the FILE parameter of the corresponding Open Query <strong>File</strong><br />

(OPNQRYF) command. However, the system assigns some of the attributes. The<br />

file is created with CONTIG(*NO), SIZE(*NOMAX), ALLOCATE(*NO),<br />

AUT(*NORMAL) and FILETYPE(*DATA).<br />

The name, type, length, null capability, date, or time format, separators, and<br />

decimal positions attributes of each field on the format that is specified are used.<br />

The file is created without key fields and is an arrival sequence physical file.<br />

In some cases, the OPNQRYF command changes the format of the format that is<br />

specified on the new to-file. The new to-file format may become null-capable when<br />

the OPNQRYF command uses one of the following grouping functions:<br />

v %STRDEV<br />

v %VAR<br />

v %SUM<br />

v %AVG<br />

v %MIN<br />

v %MAX<br />

Note: A new to-file with a changed format has a format level identifier that is<br />

different from the format level identifier that is specified on the OPNQRYF<br />

command.<br />

Authorities, user profiles, and file capabilities of the to-file<br />

created by Copy <strong>File</strong> (CPYF)<br />

When the Copy <strong>File</strong> (CPYF) command creates the local physical file, the from-file<br />

gives the created to-file all the authorities of the from-file. These authorities<br />

include public, private, and authorization lists. When CPYFRMQRYF creates the<br />

local physical file, the authorities given are of the first file that is specified on the<br />

FILE parameter of the corresponding Open Query <strong>File</strong> (OPNQRYF) command. The<br />

authorities include public, private, and authorization lists.<br />

In both cases, the owner of the created to-file is the user profile running the copy<br />

command. The user running the copy command inherits *ALL authority to the<br />

Chapter 4. Copying files 83

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

Saved successfully!

Ooh no, something went wrong!