QP2TERM()--Run an IBM PASE for i 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 IBM® i Portable Application Solutions Environment (IBM PASE for i) 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 IBM PASE for i program to run and any argument strings to pass to the program. If no parameters are specified, QP2TERM runs the default IBM PASE for i shell as an interactive login shell. The default IBM PASE for i 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 IBM PASE for i programs that all arguments are null-terminated character strings.


Authorities

Object Referred to Authority
Required
Each directory in the path to the IBM PASE for i program and shared libraries *X
IBM PASE for i program (not a shell script) in a local file system *X
IBM PASE for i program in a remote file system or shell script *RX
IBM PASE for i 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 IBM PASE for i 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 IBM PASE for i program. See QP2SHELL() and QP2SHELL2()--Run an IBM PASE for i Program for details about running an IBM PASE for i 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 IBM PASE for i runtime does ASCII/EBCDIC text conversion for data that the IBM PASE for i program reads or writes to files stdin, stdout, and stderr.

Related Information



API introduced: V4R5

[ Back to top | IBM PASE for i APIs | APIs by category ]