#include <qp2user.h> int Qp2RunPase(const char *pathName, const char *symbolName, const void *symbolData, unsigned int symbolDataLen, int ccsid, const char *const *argv, const char *const *envp);
The Qp2RunPase() function runs an i5/OS Portable Application Solutions Environment (i5/OS PASE) program in the job where the API is called. It loads the i5/OS PASE program and any necessary shared libraries and then transfers control to the program. Control returns to the caller when the i5/OS PASE program exits, terminates due to a signal, or returns without exiting.
The system uses ccsid to set the CCSID of any bytestream file created by the i5/OS PASE program, and also to control character encoding conversions done for i5/OS PASE runtime interfaces that use i5/OS services.
The system copies argument strings into i5/OS PASE memory and converts them from the job default CCSID to the CCSID specified by the ccsid parameter. By convention, the first argument string passed to an i5/OS PASE program should be the same as the pathName string.
The system copies environment variable strings into i5/OS PASE memory and converts them from the job default CCSID to the CCSID specified by the ccsid parameter. By convension, environment variable strings take the form "NAME=value".
Object Referred to | Authority Required |
---|---|
Each directory in the path to the i5/OS PASE program and shared libraries | *X |
i5/OS PASE program (not a shell script) in a local file system | *X |
i5/OS PASE program in a remote file system or shell script | *RX |
i5/OS PASE shared library | *R |
The function result may be one of these special values:
QP2RUNPASE_ERROR (-1) | An internal error occurred during Qp2RunPase processing. |
QP2RUNPASE_RETURN_NOEXIT (-2) | The i5/OS PASE program returned without exiting (by calling the i5/OS PASE _RETURN function). |
If the result is not one of the special values above, it is a value that contains status information about how the i5/OS PASE program ended, in the same format as the stat_val parameter for the ILE waitpid function. You can use these macros in file <sys/wait.h> to interpret such a result:
WIFEXITED(stat_val) | Evaluates to a nonzero value if i5/OS PASE program ended normally. |
WEXITSTATUS(stat_val) | If the value of the WIFEXITED(stat_val) is nonzero, evaluates to the low-order 8 bits of the value the i5/OS PASE program specified as the argument to exit or the function result returned by main. |
WIFSIGNALED(stat_val) | Evaluates to a nonzero value if i5/OS PASE program ended because of the receipt of a terminating signal that was not caught by the process. |
WTERMSIG(stat_val) | If the value of WIFSIGNALED(stat_val) is nonzero, evaluates to the number of the i5/OS PASE signal that caused the program to end. i5/OS PASE programs use the same signal numbers as AIX (which differ from ILE signal numbers). |
Message ID | Error Message Text |
---|---|
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
CPFB9C0 E | Error loading program &1. See previous messages. |
CPFB9C1 E | System support for i5/OS Portable Application Solutions Environment not available. |
CPFB9C2 E | Hardware support for i5/OS Portable Application Solutions Environment not available. |
CPFB9C3 E | i5/OS PASE CCSID and job default CCSID are incompatible. |
CPFB9C7 E | i5/OS PASE already running in this job. |
CPFB9C8 E | File descriptors 0, 1, and 2 must be open to run the i5/OS PASE program. |
CPFB9CB E | Qp2RunPase second argument must be a null pointer. |
QIBM_USE_DESCRIPTOR_STDIO | When this ILE environment variable is set to Y or
I, both i5/OS PASE runtime and ILE C runtime use Integrated File System file
descriptors 0, 1, and 2 for stdin, stdout, and stderr. Otherwise, i5/OS PASE
file descriptors 0, 1, and 2 are mapped to ILE C runtime files stdin, stdout,
and stderr (which may not use any Integrated File System file descriptors).
i5/OS PASE and ILE generally use different descriptor numbers for the same open file, but when QIBM_USE_DESCRIPTOR_STDIO is set to Y or I, any operation against i5/OS PASE file descriptors 0, 1, or 2 is also done for the same Integrated File System file descriptor number so i5/OS PASE and ILE C use the same files for stdin, stdout, and stderr. |
QIBM_PASE_DESCRIPTOR_STDIO | This ILE environment variable controls ASCII/EBCDIC conversion for data read or written through i5/OS PASE files stdin, stdout, and stderr to Integrated File System file descriptors 0, 1, and 2. ASCII/EBCDIC conversion is always done (and this variable is ignored) unless QIBM_USE_DESCRIPTOR_STDIO is set to either Y or I. If QIBM_PASE_DESCRIPTOR_STDIO is set to B, the PASE program processes binary data (without ASCII/EBCDIC conversion). Otherwise, ASCII/EBCDIC conversion is done for any data read from or written to i5/OS PASE file descriptors 0, 1, or 2. |
QIBM_PASE_FLUSH_STDIO | This ILE environment variable controls whether i5/OS PASE runtime flushes every write to a standard output stream attached to a Data Management file (such as a spooled printer file) or to the Dynamic Screen Manager in an interactive job. QIBM_PASE_FLUSH_STDIO must be set before starting i5/OS PASE, and only applies when i5/OS PASE is NOT using IFS descriptors for standard I/O (QIBM_USE_DESCRIPTOR_STDIO is not set). It is usually only needed for interactive programs that require immediate display of output that does not end with newline. These values are supported:
|
QIBM_PASE_USE_PRESTART_JOBS | When this ILE environment variable is set to Y, i5/OS PASE runtime uses prestarted jobs for child processes created by fork and for any job started by the systemCL i5/OS PASE runtime function (to run a CL command). You should add prestarted job entries (ADDPJE command) for programs QP0ZSPWT (used by fork) and QP0ZSPWP (used by systemCL) to any subsystem description that will run jobs that use this support. |
Top | i5/OS PASE APIs | APIs by category |