z/OS RUN TASK to Execute a COBOL Program

The following example shows how to execute a COBOL program from a IBM® Connect:Direct® Process by using the RUN TASK statement.

ALLOC1  RUN TASK (PGM=DMRTDYN                                             -
                  PARM=(C’ALLOC DSN=XYZ.TEMP DISP=SHR DD=OLD1’)) PNODE
ALLOC2  RUN TASK (PGM=DMRTDYN                                             -
                  PARM=(C’ALLOC DSN=XYZ.TEMP2 DISP=SHR DD=OLD2’)) PNODE
CUSTRT  RUN TASK (PGM=COBOL program name)
UNALLO1 RUN TASK (PGM=DMRTDYN                                             -
                  PARM=(C’UNALLOC DD=OLD1’)) PNODE
UNALLO2 RUN TASK (PGM=DMRTDYN PARM=(C’UNALLOC DD=OLD2)’)) PNODE