Thursday, May 07, 2009

COBOL Compiler

As fresher we usually feel it as a tedious job to compile the COBOL program and submit the job for the load each time. So this is how we can modify the compiler so that the compiler itself can submit the load for the COBOL program.

All we have to do is add the following code at the end of the compiler

//STEP111 EXEC PGM=IEBGENER,COND=(0,LT,LKED)
//SYSUT1 DD DSN=FILE-NAME,DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*

The FILE-NAME would be the name of file to submit ( JCL for executing the Load)

The DDName SYSUT1 will point to the input, (i.e.) the JCL we want to submit.

The DDName SYSUT2 (output) will point to the internal reader.

The Internal Reader takes our input and sends it to JES so it can be processed.

Thus the compiler would be able to submit the JOB if the COBOL program was sucessfully executed (This is ensured by the the COND )

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory