The following information applies to OnDemand for i. IBM Content Manager OnDemand for i, Version 7.2.+

Calling QSHELL commands from an IBM i command line

When executing the ARSxxxxxx programs from an IBM® i command line, the i QSH command is used. When embedded single quotes exist within the program parameter, they must be doubled. For example:.
QSH CMD('arsdoc get ...... "-i WHERE Account#=''1234567'' "....-u testadmin -p ondemand')
Since the QSHELL environment will log messages to the terminal, you will want to control this by setting environment variable QIBM_QSH_CMD_OUTPUT. This variable will control where the messages are logged. This does not interfere with the messages that get logged to the System Log. The QSHELL environment logging can be sent to the terminal session, to a file in the IFS directory structure, or you can choose not to log the messages. The ADDENVVAR, CHGENVVAR, RMVENVVAR and WRKENVVAR commands can be used to manipulate the QSHELL environment. The environment parameters can be set for the entire system and for the job. In most cases, you will not want to change the environment parameter at the system level, because it will affect all users of QSHELL on the system.
  • Set the job environment to log messages to the terminal
  • Set the system environment to not log messages.
  • Set the job environment to log messages to the a file in the IFS. mydirectory must exist in the IFS.
The following is an example of the messages that might be displayed to the terminal or logged in the output file. Start of change
OnDemand Load Id = >8495-53-0-1FAA-20130627000000-20130627000000-8496<
End of change
Loaded 4 rows into the database
Document compression type used - OD77.  Bytes Stored = >10240<
Message QSH0005 will be issued in the job log when running the QSH command. The message text is Command ended normally with exit status &1. The possible statuses returned are shown in the following table.
Table 1. Message QSH0005 status codes
Status Description
0 Completed Successfully
1 Command Failure
2 Folder does not exist or do not have authority to folder
3 User ID or Password is not valid. Cannot establish communication to server
127 Command Not Found
254 No Hits Match Query


Last updated: November 2013

© Copyright IBM Corporation 2014.
This information center is powered by Eclipse technology. (