QP2TERM()--Run an i5/OS PASE Terminal Session


  Syntax
 #include <qp2term.h>  

 void QP2TERM(...);

  Default Public Authority: *USE

  Threadsafe: No

The QP2TERM() program runs an interactive terminal session that starts a batch job to run an i5/OS Portable Application Solutions Environment (i5/OS PASE) program. This program uses the workstation display in the interactive to present output and accept input for files stdin, stdout, and stderr in the batch job.


Parameters

argument strings
(Input) Optional pointers to null-terminated character strings that specify the path name of the i5/OS PASE program to run and any argument strings to pass to the program. If no parameters are specified, QP2TERM runs the default i5/OS PASE shell as an interactive login shell. The default i5/OS PASE shell is an implementation of the Korn shell, with path name /QOpenSys/usr/bin/sh.

Note: When calling QP2TERM from CL, be sure to quote any argument string that could be interpreted as a numeric value. CL converts unquoted numeric arguments to decimal or floating-point format, which does not match the assumption made by QP2TERM and i5/OS PASE programs that all arguments are null-terminated character strings.


Authorities

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


Return Value

QP2TERM returns no function result. Escape messages are sent to report errors.


Error Messages

Message ID Error Message Text
CPFB9C4 E Error running i5/OS PASE terminal session, reason code &1, errno &2.
CPFB9C9 E Terminal session already in use.
CPFB9CA E Batch job ended in error.


Usage Notes

  1. QP2TERM uses the Qp0zStartTerminal API to manage the interactive display and start a batch job. The batch job copies most attributes of the interactive job and calls program QP2SHELL to run the i5/OS PASE program. See QP2SHELL()--Run an i5/OS PASE Shell Program for details about running an i5/OS PASE shell program.

  2. QP2TERM copies all ILE environment variables from the interactive job to the batch job before starting the batch job, except the following ILE environment variables, which are set or replaced in the batch job. These changes affect the batch job only. They do not modify the environment in the job that called QP2TERM.

    COLUMNS If COLUMNS is not already set, QP2TERM sets it to the number of columns available for program output on the interactive display.
    ROWS If ROWS is not already set, QP2TERM sets it to the number of rows available for program output on the interactive display.
    QIBM_USE_DESCRIPTOR_STDIO=I QP2TERM sets QIBM_USE_DESCRIPTOR_STDIO to ensure that files stdin, stdout, and stderr use Integrated File System descriptors 0, 1, and 2. The terminal session manager attaches open pipes to these file descriptors in the batch job.
    QIBM_PASE_DESCRIPTOR_STDIO=T QP2TERM sets QIBM_PASE_DESCRIPTOR_STDIO to ensure that i5/OS PASE runtime does ASCII/EBCDIC text conversion for data that the i5/OS PASE program reads or writes to files stdin, stdout, and stderr.

Related Information



API introduced: V4R5
Top | i5/OS PASE APIs | APIs by category