Admin Alert: Running Green-Screen Commands from OpsNav, Part 2
August 9, 2006 Joe Hertvik
In a recent column, I covered how to use iSeries Navigator’s Run Command feature to submit batch i5/OS commands to an i5 system for execution. This week, I will cover some additional configurations that will help you set up other Run Command options, as well as to determine whether a specific batch command can be submitted for execution by Run Command. Run Command is a valuable OpsNav feature that allows you to graphically enter and send batch i5/OS commands to an i5 partition for execution (see Part 1 of this article for basic information on how to use Run Command). Run Command configures and sends 5250 commands to your i5 box, so that the commands can be run as batch processes. As currently structured, it isn’t possible to submit interactive i5/OS commands to an i5 server from inside Operations Navigator. So it’s important to understand that you cannot submit the entire catalogue of green-screen commands from Run Command; you can only submit the commands that can be run in a batch environment. What Commands Can I Submit to an i5 Partition? It’s fairly easy to determine if an i5/OS command can be executed through OpsNav’s command execution facilities. You simply check to see if the command is rated to run in batch. For every command, you can tell whether it’s allowed to run in a batch environment by checking its Where allowed to run parameters through the Display Command (DSPCMD) command. For example, if I wanted to determine whether I could submit the Work Object command (WRKOBJ) as a batch process, I could view its command properties by running the following DSPCMD statement: DSPCMD CMD(WRKOBJ) DSPCMD then produces a screen that contains the following line of information describing where the command can run: Where allowed to run: *IREXX *IPGM *EXEC *INTERACT If WRKOBJ is rated to run in a batch environment, it will contain the ‘*BATCH literal in its Where allowed to run parameters. In this case, WRKOBJ is not allowed to run as a batch process and it cannot be executed through Run Command. In contrast, if I run DSPCMD over the Work with Active Jobs command (WRKACTJOB), like this: DSPCMD CMD(WRKACTJOB) I would see this list of i5/OS environments where WRKACTJOB is allowed to run: Where allowed to run:*IMOD *BMOD *IREXX *BREXX *BPGM *IPGM *EXEC *INTERACT *BATCH In this case, WRKACTJOB is rated to run in a batch environment, because it has the *BATCH literal in its Where allowed to run parameters. So I could submit WRKACTJOB for execution by using Run Command. It’s fairly easy to use DSPCMD to determine a command’s operating environment, and–as a bonus–it is rated to run in a batch environment. So DSPCMD can also be submitted to an i5 partition through OpsNav’s Run Command feature. Additional Options for Run Command In addition to the Run Command parameters I discussed in Part One, there are two other parameters that you can add to a scheduled command from the Run Command panel. To specify these parameters, click on the OS/400 Options tab inside the Run Command panel. Inside the OS/400 Options panel, you will find two other Run Command parameters: Job Log and Inquiry Messages. The Job Log parameter is a Windows radio button function that tells the system whether or not the Run Command feature should produce a job log after it finishes. There are two options that you can specify for the Job Log parameter: Always keep the job log on each target system; and Only keep the job log if the command failed. These choices are fairly self-explanatory but there is one catch. While the first choice always produces a job log when you successfully submit a command, both choices may not produce a job log for every Run Command failure. In cases where the command is never executed because Management Central was having trouble maintaining a connection with the target system, no joblog will be produced because the command was never submitted to the system. So it’s not a given that Run Command will always produce a joblog for all submitted commands in all situations. The Inquiry Messages parameters on this screen work more consistently. The choices in this area allow you to specify whether or not you want i5/OS to automatically reply to any inquiry messages that are generated when there is a problem running the command. If you uncheck the Automatically reply to inquiry message check box, i5/OS will not attempt to automatically answer any inquiry messages associated with the command. If you check the Automatically reply to inquiry messages if they occur check box, then the system will answer any inquiry messages by using one of the following two options. If you activate the Use default reply radio button that is also in the Inquiry Messages area of the panel, the system will attempt to answer inquiry message with the default reply value defined in the message itself, if one is available. Reply values are defined in the Default reply value parameter (DFT) of the message description. But be warned that many, if not most, messages do not have default replies. If you want to view or modify the default reply for a specific message, you can work with a message’s DFT value by using the Change Message Description command (CHGMSGD). You can also view and work with all the messages in a specific message file by using the Work with Message Descriptions command (WRKMSGD) from a 5250 terminal display. For Run Command purposes, the CHGMSGD command is rated to run in a *BATCH environment so it can be submitted to an i5 partition through Run Command. The WRKMSGD command is an interactive command that is not rated to run as a batch process so it cannot be submitted from Run Command. If you activate the Use system reply list radio button in the Inquiry Messages area, the system will reply to an inquiry message with whatever relevant message replies it finds in the System Reply List. You can print all the system replies for a partition by running the following Work with Reply List Entries command (WRKRPYLE). WRKRPYLE OUTPUT(*PRINT) You can also run the WRKRPYLE command without the OUTPUT parameter to view, update, and add system replies from a 5250 green screen. WRKRPYLE For automatically answering system inquiry messages, flexibility is the difference between using the message’s default reply parameter and using a system reply list entry. If you configure a DFT value for a message and your jobs are configured to use the message’s default reply parameter, the system will always use the same DFT reply response every time a job generates that inquiry message. System reply messages, on the other hand, can be configured to issue different replies depending on which specific parameters the message is referring to. For example, using the System Reply List, you can easily configure different system reply list entries for different i5/OS writers when a printer error message occurs. Configuring and using default response entries inside the message are a one-size fits all solution, while system reply entries can provide more flexibility in automatically answering inquiry messages for different command parameters. The WRKRPYLE command can be submitted to a partition by using Run Command, but it can only be submitted to produce a printed list of your reply list entries. You cannot use Run Command to interactively update your system reply list entries; you have to run WRKRPYLE on the green screen to maintain your reply list. If you only want to add one reply list entry to the system, that entry can also be entered by using the Add Reply List Entry command (ADDRPYLE) from either a green-screen terminal session or through OpsNav’s Run Command function. For more information on using WRKRPYLE to answer system inquiry messages, go to IBM’s WRKRPYLE Information Center entry for V5R3 And That’s the Basics This column and last, I covered the core configurations for manually running i5/OS commands within a Windows OpsNav environment. There are additional features for setting up command definitions and automatically running commands under the Management Central node of OpsNav, but I’ll save those features for a future article as they comprise an entire OpsNav topic in itself. About Our Testing Environment All configurations described in this article were tested by using the iSeries Navigator (OpsNav) program that comes with iSeries Access for Windows V5R3M0. The OpsNav desktop testing environment was a Windows 2000 Professional laptop. Commands sent from OpsNav were executed on an i5 550 box running i5/OS V5R3. The Run Command function is also included in many other OpsNav releases, including the Operations Navigator program (also nicknamed OpsNav) that comes with earlier versions of Client Access. Run Command can be used in those versions to send commands to pre-V5 i5 iSeries and AS/400 machines. Be aware, however, that these earlier versions may have reduced capabilities from the examples shown here, so, depending on which OpsNav version you are using, these examples may not behave exactly the same way in your shop. RELATED STORIES Running Green-Screen Commands from OpsNav, Part 1 |