Call Program (QxdaCallProgramEDRS) API


  Required Parameter Group:

1 Connection handle Input Binary(4)
2 Qualified program name Input Char(20)
3 Number of parameters Input Binary(4)
4 Parameter information Input Char(*)
5 Error code I/O Char(*)

  Service Program Name: QXDAEDRS

  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes

The Call Program (QxdaCallProgramEDRS) API is used to call a user-defined program on the database server system. All parameters are passed to the program by reference.


Authorities and Locks

Any program
*USE
Library of the program
*EXECUTE

Required Parameter Group

Connection handle
INPUT; BINARY(4)

The handle number of the connection on which to call the program. The connection handle must have been generated by the QxdaConnectEDRS API in the current job and activation group.

Qualified program name
INPUT; CHAR(20)

The library and name of the program to call. The special value *LIBL may be specified for the library name; however, the library list of the server job may differ from that of the client job.

Number of parameters
INPUT; BINARY(4)

The number of parameters to pass to the program.

Parameter information
INPUT; CHAR(*)

Information about each of the parameters. This should be an array of type Qxda_ParmInfo_t, with one entry for each parameter. For the format of each array element, see Qxda_ParmInfo_t Format.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error Code Parameter.


Qxda_ParmInfo_t Format

The following table shows the structure of the Qxda_ParmInfo_t format. For more details about the fields in this table, see Field Descriptions.

Offset Type Field
Dec Hex
0 0 PTR Parameter address
16 10 BINARY(4) Parameter type
20 14 BINARY(4) Parameter length
24 18 BINARY(4) Parameter usage
28 1C CHAR(4) Reserved


Field Descriptions

Parameter address. The address where an input parameter exists or where an output parameter should be returned.

Parameter length. The number of bytes allocated for the parameter.

Parameter type. The type of the parameter. The possible values are:

1 - QXDA_BIN4 The parameter at the address specified is a BINARY(4) value.
2 - QXDA_CHAR The parameter at the address specified is a character string. If the API is being called from an i5/OS application, no CCSID conversion is performed.
3 - QXDA_HEX The parameter at the address specified is hexadecimal data and requires no conversion.
3 - QXDA_BIN2 The parameter at the address specified is a BINARY(2) value. If the API is being called from an i5/OS application, you cannot use this value.

Parameter usage. The usage of the parameter. The possible values are:

0 - QXDA_INPUT The parameter is used for input only.
1 - QXDA_OUTPUT The parameter is used for output only.
2 - QXDA_IN_OUT The parameter is used for both input and output.

Reserved. Reserved field; it must be initialized to 0x00.


Usage Notes

This function may be called from the initial thread of a job only. For the i5/OS version of this API, the QXDA_CHAR and QXDA_HEX parameter types are equivalent.


Error Messages

Message ID Error Message Text
CPF180C E Function &1 not allowed.
CPF24B4 E Severe error while addressing parameter list.
CPF3C90 E Literal value cannot be changed.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.
CPFAE14 E Cannot allocate &1 bytes.
CPFB750 E Connection handle specified not valid.
CPFB752 E Internal error in &1 API.
CPFB755 E Program &1 in library &2 not found.
CPFB756 E Rollback operation performed.
CPFB757 E The connection is suspended.
CPFB758 E The EDRS server system has been switched.



API introduced: V4R4
Top | Database and File APIs | APIs by category