Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Calling nested COBOL programs

By calling nested programs, you can create applications that use structured programming techniques. You can also call nested programs instead of PERFORM procedures to prevent unintentional modification of data items. Use either CALL literal or CALL identifier statements to make calls to nested programs.

You can call a contained program only from its directly containing program unless you identify the contained program as COMMON in its PROGRAM-ID paragraph. In that case, you can call the common program from any program that is contained (directly or indirectly) in the same program as the common program. Only contained programs can be identified as COMMON. Recursive calls are not allowed.

Follow these guidelines when using nested program structures:

You cannot use the THREAD option when compiling programs that contain nested programs.

related concepts  
Nested programs

related references  
Scope of names


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)