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.
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":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CJRAA2","label":"PASE"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
620946983
Was this topic helpful?
Document Information
More support for:
IBM i
Component:
PASE
Software version:
All Versions
Operating system(s):
IBM i
Document number:
684869
Modified date:
09 December 2024
UID
nas8N1011231
Manage My Notification Subscriptions