|
EXEC |
|
|
The EXEC statement causes, on a mainframe environment, a program, a JCL or a PROC to be started, depending on the supplied parameters. In the XFRAME Batch Environment (XEBE), the start method changes depending on what you intend to start. Starting programs The XEBE put at disposal two interfaces to start program from WSH:
The exec function activates COBOL programs. Normally, COBOL program are not compiled as standalone executable, but they are left as linkable objects, demanding the dynamic link to the runtime phase. This lead to an higher degree of maintainability, without performance loss. The shell function activates any executable program. Passing data cards Data cards may be passed to both exec and shell functions. exec reads data cards directly from the SYSIN file link, defined with a dd() function. // SRC: //STP1 EXEC PGM=TXEBE1 The shell function reads the data cards from the string provided as second parameter. // SRC: //STP1 EXEC PGM=DFSORT Providing a PARM The PARM parameter of the EXEC command, is managed by exec through its second parameter. If the second parameter is omitted no PARM is provided. I.e. // SRC: //STP1 EXEC PGM=TXEBE1,PARM=MYPARM Starting PROCs The PROCs are converted into separate functions, included in dedicated scripts, that must be invoked by the master script. To allow dynamic parameter substitutions and overrides, called scripts must be call by the invoke function, which requires the name of the PROC to invoke and the object which identify the set of overridden parameters. I.e. // SRC: //STP2 EXEC PROC1,PARM1=DAJOB,COND=(8,LE)
|