If a CL program overrides a file and then calls a high-level language program, the override remains in effect for the high-level language program. However, if a high-level language program calls a CL program that overrides a file, the system deletes the override automatically when control returns to the high-level language program.
High-level language program:
|
The file opened is DK1, not MSTOUT. This is because the system deletes the override in the CL program when the CL program ends.
To perform an override from a high-level language program, call the QCMDEXC program from the high-level language program. The override specified on the QCMDEXC command, takes the call level of the program that called QCMDEXC. High-level language program:
CALL QCMDEXC PARM('OVRDKTF FILE(DK1) +
TOFILE(MSTOUT)' 32)
OPEN DK1
The file MSTOUT opens because of the override that is requested by the call to the QCMDEXC program.
In an actual program, you might want to use data that is supplied by the program as a parameter of the override. You can do this by using program variables in the call to QCMDEXC. For more information on the use of program variables, refer to the appropriate language information.