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.

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

Program A<br />

.<br />

.<br />

.<br />

Override 1 OVRDBF FILE(B) TOFILE(C)<br />

Override 2 OVRDBF FILE(A) TOFILE(B)<br />

.<br />

.<br />

.<br />

OPEN FILE A<br />

.<br />

.<br />

.<br />

To open FILE C, replace the two Override with Database <strong>File</strong> (OVRDBF)<br />

commands with the following command:<br />

OVRDBF FILE(A) TOFILE(C)<br />

This does not prevent applying an override at the same call level or job level in<br />

which the file is created. Regardless of which attribute is encountered first, file<br />

attributes on the override take the place of corresponding attributes on the create<br />

statement for the file.<br />

CL program overrides<br />

If a CL program overrides a file and then calls a high-level language program, the<br />

override remains in effect for the high-level language program. However, if a<br />

high-level language program calls a CL program that overrides a file, the system<br />

deletes the override automatically when control returns to the high-level language<br />

program.<br />

High-level language program:<br />

CALL PGM(CLPGM1)<br />

CL Program CLPGM1<br />

OVRDKTF FILE(DK1) TOFILE(MSTOUT)<br />

.<br />

.<br />

.<br />

ENDPGM<br />

High-level language program:<br />

OPEN DK1<br />

The file opened is DK1, not MSTOUT. This is because the system deletes the<br />

override in the CL program when the CL program ends.<br />

To perform an override from a high-level language program, call the QCMDEXC<br />

program from the high-level language program. The override specified on the<br />

QCMDEXC command, takes the call level of the program that called QCMDEXC.<br />

High-level language program:<br />

CALL QCMDEXC PARM('OVRDKTF FILE(DK1) +<br />

TOFILE(MSTOUT)' 32)<br />

OPEN DK1

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

Saved successfully!

Ooh no, something went wrong!