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.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Programming (Languages- compilers- tools)","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0;7.2;7.1.0;7.1;6.1.1;6.1.0;6.1;5.4.5;5.4.0;5.3.5;5.3.0;5.2.0;5.1.0","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC5L9","label":"IBM i 7.2"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

Historical Number

620946983

Document Information

Modified date:
04 March 2020

UID

nas8N1011231