Using the PowerExchange CallProg Function to Call a User Exit Program

Using the PowerExchange CallProg Function to Call a User Exit Program

CallProg

CallProg

Calls a user-defined program or subroutine to process the source data in a record.
Syntax:
[
result
=]CallProg('
program
','
subroutine
','
linkage
'[,
arg1
][,
arg2
][,
...
])
The parameters are:
  • result
    . Optional. NUM32. This argument contains the return value from program called by the CallProg function, which is one of the following values:
    • 0
      . Success.
    • Non-zero
      . Failure.
      If you do not specify a result argument and a non-zero return code is returned from the external program, CallProg executes the following default map-level error responses:
    • Ends the extract.
    • Skips this subroutine.
  • program
    . The name of the program that contains the subroutine. Depending on the operating system, the program is one of the following:
    • i5/OS
      . A service program.
    • Linux or UNIX
      . A shared object.
    • Windows
      . A DLL.
    • z/OS
      . A load module.
      Enclose the program name in single quotes.
  • subroutine
    . The name of the entry point in the program. Depending on the operating system, the subroutine is one of the following:
    • i5/OS
      . The subroutine name.
    • Linux, UNIX, or Windows
      . The subroutine name.
    • z/OS for Assembler, C, or COBOL
      programs
      . You must provide a value, but the value is ignored and the default entry point for the load module is used. Specify the same name as the program.
    • z/OS for PL/I programs
      . If multiple fetchable subroutines reside in the same load module, specify the subroutine name.
      Enclose the subroutine name in single quotes.
  • linkage
    . The type of linkage, which determines the way that arguments are passed to and return codes are returned from the program or subroutine. The linkage type is one of the following values:
    Linkage Type
    Supported Operating Systems
    Arguments
    Returns
    C
    • i5/OS
    • Linux, UNIX, and Windows
    • z/OS
    Passed through the stack
    Program return code
    COBOL
    z/OS
    Passed as a list of addresses
    Address of failure code integer
    OS
    z/OS
    Program return code
    OS400
    i5/OS
    Address of failure code integer
    PLI
    z/OS
    Address of failure code integer
    Enclose the linkage type in single quotes.
  • [,
    arg1
    ][,
    arg2
    ][,
    ...
    ]. One or more optional arguments passed to the program or subroutine.

0 COMMENTS

We’d like to hear from you!