Previous Topic: Locate the External Action Block StubNext Topic: External Action Block as Interface to Subroutine


Customize the Appropriate External Action Logic

You are responsible for writing, compiling, and link-editing the external subroutine and making it available to the application. External subroutines can be written in any language but when used by z/OS applications must follow LE linkage conventions. External Action Blocks must follow specific coding conventions so that they interface properly with programs generated through CA Gen.

To help ensure that these requirements are met, CA Gen generates a COBOL program stub you can use as a base for modification. The stub defines the runtime parameters passed from the calling procedure step or action block to the External Action Block. It also defines the import and export views of the External Action Block to match those of the calling procedure step or action block.

You must analyze the External Action Block stub to determine the input and output requirements for your external action.

Copy the generated stub to a separate library before modifying it to prevent an accidental overwrite of the stub. Add the logic needed to meet the specific requirements of your external subroutine. You can use the modified stub to call an existing subroutine or you can include the customized logic in the stub.

Note: If you insert the logic for the external subroutine into the stub, CA Gen does not preserve the changes during regeneration. You must copy any changes into the new External Action Block stub created when the load module is regenerated. For this reason, it is recommended that you put the logic in a subroutine and call the subroutine from the stub rather than insert the logic itself.