IBM Support

How to Call PASE Commands/Scripts from a Command Line, CL Program, or in a Submitted Job

Troubleshooting


Problem

This document discusses the preferred method for calling PASE commands and scripts from a command line, CL program, or in a submitted job

Resolving The Problem

IBM prefers the following method be used to call Portable Application Solutions Environment (PASE) commands and scripts from a command line, CL program, or in a submitted job.

QSH CMD('/QOpenSys/usr/bin/sh -c "/QOpenSys/bin/script.sh"') where /QOpenSys/bin/script.sh is any PASE shell command or script.

This method invokes a Qshell interpreter session, which then creates a PASE Korn shell in a child process and execute the command specified on the "-c" option in the PASE shell.

This method is recommended as opposed to the use of the QP2SHELL() and QP2SHELL2() APIs. The use of these APIs is not recommended because they are complex and difficult to use. They are for advanced users only. Support for how to use these APIs is only available through IBM's consulting services.

Using the Qshell interpreter to invoke the PASE Korn shell provides an easy-to-use environment brior the PASE Korn shell creation. Part of the environment setup is the assignment of the 0, 1, and 2 file descriptors. With the QP2SHELL() and QP2SHELL2() APIs, these descriptors must be set up programmatically before the execution of the API. With the use of Qshell, these file descriptors are automatically assigned for you.
Note: When the job default CCSID is a mixed-byte CCSID, it will be treated as if it was set to the corresponding SBCS CCSID. If the argument strings contain DBCS characters, unexpected results will occur.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

620946983

Document Information

Modified date:
12 April 2023

UID

nas8N1011231