Sending Commands to an AS/400 Host without a Display Session
Using the Remote Command utility, you can start and control non-interactive programs on an AS/400 host without opening an AS/400 display session. Commands can be sent individually or in combination, and can be saved as an ASCII file for resubmission. Return codes are received, but program data cannot be returned from the host.
The Remote Command utility provides:
- An interface to automate sending one command or a batch of commands.
- An API set for Remote Command and Distributed Program Call. This includes header files, an .LIB file, and sample code.
The API set and sample code is installed to the following location:
|To send commands to an AS/400 host without a display session
- Determine the non-interactive programs on the AS/400 host that you want to start and control from your personal computer.
For example, to send an immediate message to one or more message queues, you would use the SNDMSG command.
- From the display session, test the command to make sure that it is a legitimate command.
- Write down or copy the command lines that you are entering from the display session.
- Open the Remote Command utility.
- From the File menu, choose Open.
- If you are creating a new command script (.RCS), choose New.
If you are editing an existing command script, select the filename of the command script that you want to edit, and then choose Open.
- Enter the command lines.
|One command line
||Move the cursor to the command line to be sent, then choose the Send Command button.
|All commands listed in the box
||Choose the Send All Commands button.
When commands are sent, the actual messages that were sent are displayed in the Command Output Messages box.
- Choose Save to save the command script (.RCS).
You can also choose Save As to save an edited command script to be resubmitted, or Exit to close the Remote Command dialog box without saving your changes.