ILE COBOL Programmer's Guide


Running a COBOL Program Using the CL CALL Command

You can use the CL CALL command to run an ILE COBOL program. You can use a CL CALL command interactively, as part of a batch job, or include it in a CL program. An example of a CL CALL command is as follows:

CALL program-name

The program object specified by program-name must exist in a library and this library must be contained in the library list *LIBL. You can also explicitly specify the library in the CL CALL command as follows:

CALL library-name/program-name

For further information about using the CL CALL command, see the CL and APIs section of the Programming category in the iSeries 400 Information Center at this Web site -http://publib.boulder.ibm.com/pubs/html/as400/infocenter.htm.

When you are running a batch job that calls an ILE COBOL program that uses the Format 1 ACCEPT statement, the input data is taken from the job stream. This data must be placed immediately following the CL CALL for the ILE COBOL program. You must ensure that your program requests (through multiple ACCEPT statements) the same amount of data as is available. See the "ACCEPT Statement" section of the WebSphere Development Studio: ILE COBOL Reference for more information.

If more data is requested than is available, the CL command following the data is treated as input data. If more data is available than is requested, each extra line of data is treated as a CL command. In each instance, undesirable results can occur.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]