cwbRC_CreatePgm
Use the cwbRC_CreatePgm API with this product.
Purpose
This function creates a program object given a program and library name. The handle that is returned can be used to add parameters to the program and then call the program.
Syntax
unsigned int CWB_ENTRY cwbRC_CreatePgm(
const char *programName,
const char *libraryName,
cwbRC_PgmHandle *program);
Parameters
- const char *programName - input
- Pointer to an ASCIIZ string that contains the name of the program that you want to call. The name is uppercased unless enclosed in double quotes.
- const char *libraryName - input
- Pointer to an ASCIIZ string that contains the name of the library where the program resides. The name is uppercased unless enclosed in double quotes.
- cwbRC_PgmHandle * program - output
- Pointer to a cwbRC_PgmHandle where the handle of the program will be returned.
Return Codes
The following list shows common return values.
- CWB_OK
- Successful completion.
- CWB_INVALID_POINTER
- Bad or NULL pointer.
- CWBRC_PROGRAM_NAME
- Program name is too long.
- CWBRC_LIBRARY_NAME
- Library name is too long.
- CWB_NOT_ENOUGH_MEMORY
- Insufficient memory; may have failed to allocate temporary buffer.
- CWB_NON_REPRESENTABLE_UNICODE_CHAR
- One or more input Unicode characters have no representation in the codepage being used.
- CWB_API_ERROR
- General API failure.
Usage
You should create a separate IBM i program object for each program you want to call on the system. You can use the functions described in this file to change the values of the parameters being sent to the program, but cannot change the number of parameters being sent.