30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CPYSRCF command support for CCSIDs<br />

Using the Copy Source <strong>File</strong> (CPYSRCF) command automatically converts data in<br />

the from-file to the to-file CCSID. If you do not want the character data converted,<br />

use the CPYF command with FMTOPT(*NOCHK).<br />

Copy commands support for null values<br />

You can copy files that contain null-capable fields by using the CPYF and<br />

CPYFRMQRYF commands. The FMTOPT parameter allows mapping of<br />

null-capable fields. The INCREL parameter allows selection of records that are<br />

based on whether a field is or is not null.<br />

While copying the records to the to-file, the following commands ignore null<br />

values in the from-file:<br />

CPYTOTAP<br />

CPYTODKT<br />

CPYFRMTAP<br />

CPYFRMDKT<br />

The following conditions or values on the CPYF or CPYFRMQRYF command<br />

ignore null values in the from-file while copying the records to the to-file:<br />

FMTOPT(*NOCHK)<br />

FMTOPT(*CVTSRC)<br />

Device to-file<br />

Record selection involving null values may still be done, but only the<br />

user-specified or default value in the buffer (rather than a null value) is copied to<br />

the to-file. Null values cannot be preserved in these instances. Any print listings<br />

produced when a copy command is run (including TOFILE(*PRINT),<br />

PRINT(*COPIED), PRINT(*EXCLUDE), and PRINT(*ERROR)) also ignore null<br />

values.<br />

Creating the to-file (CRTFILE parameter)<br />

82 <strong>File</strong> <strong>Management</strong> V4R5<br />

To copy a physical or logical file when no to-file exists to receive the data, you can<br />

create the to-file by specifying CRTFILE(*YES). Specify the name of the new to-file<br />

on the TOFILE parameter. Qualify the name with the name of an existing library<br />

for which you have the required authority. (You must also have authority to the<br />

CRTPF command). You cannot override the created to-file that you specified to a<br />

different file or library.<br />

CRTFILE(*YES) automatically adds members and records to the new file.<br />

The newly created file has certain authorities, capabilities, and a user profile<br />

associated with it. For more information, see “Authorities, user profiles, and file<br />

capabilities of the to-file created by Copy <strong>File</strong> (CPYF)” on page 83. Your system<br />

specifies different identifiers and attributes to the new file based on whether you<br />

use the CPYF or CPYFRMQRYF command. See “Specifying CRTFILE(*YES) on<br />

either the CPYF or CPYFRMQRYF command” on page 83.

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

Saved successfully!

Ooh no, something went wrong!