How to run a program stored on the IBMi from a CA Plex function.

Document ID : KB000009936
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

How can an executable program that is stored on the IBMi be called from a CA Plex function?

Background:

The System i program needs to be defined as an API function within the Plex model. The API function must then be assigned an implementation name that matches the name of the System i program that needs to be called. Optionally, if the program to be called has parameters, these parameters need to be defined on the API function. The API function cannot be generated or built because it is already an executable program on the System i. Once the API function definition is complete, the function can be called with a 'Call' statement from any Plex function.

Instructions:
  1. Define the System i program as an API function: 

    System I Program          type SYS               API 

  2. Assign an implementation name that matches the name of the System i program: 

    System I Program          impl name NME     XXXXXXX 

  3. If the System i program has parameters, they need to be defined on the API function: 

    System I Program          input FLD               Parm1 
    System I Program          input FLD               Parm2 

    Make sure you use field inheritance to define the properties of each field. 

  4. Use the 'Call' statement in any Plex action diagram to make a call to the new API function and map any parameters that were defined.