Admin Alert: Running Green-Screen Commands from OpsNav, Part 1
August 2, 2006 Joe Hertvik
Because their operating systems are grounded in 5250 green-screen commands, i5, iSeries, and AS/400 machines have always had problems gaining acceptance in a graphical world. IBM responded to this issue years ago by creating the iSeries Navigator program (OpsNav), a graphical interface for the i5/OS operating system. However, Windows users still occasionally need to run text-based 5250 commands. To solve that problem, IBM added a Run Command facility to OpsNav. Run Command is a somewhat valuable OpsNav feature that allows you to graphically enter and send batch i5/OS commands to an i5 partition for execution. This article is the first of a two-part series where I will cover the ins and outs of Run Command by showing you how to send commands from OpsNav to an i5/OS V5R3 machine for execution. (Note: The testing environment for the examples shown here can be found at the bottom of the article.) Today, I’ll cover the basics of Run Command. In a future article, I’ll look at some of its advanced features. Getting Started with Run Command It’s important to understand that Run Command configures and sends 5250 commands to your i5 box, so that the commands can be run as batch jobs. Because all submitted commands are executed as batch processes, interactive commands, such as the Work with Object (WRKOBJ) command, cannot be executed using this feature. You access Run Command by opening OpsNav, highlighting and right-clicking on the i5 partition that you want to send commands to, and then selecting the Run Command option from the pop-up menu that appears. This sequence opens up OpsNav’s Run Command panel. Under the panel’s General tab, you can type in the name of the command that you want to execute in the box labeled Command to run:. Command parameters can also be typed into this box the same way you would type a completed command inside a CL program or on a green-screen command line. If you want to select and rerun an old command that you have previously submitted to Remote Command, click on the Previous Commands button in the Run Command panel. By default, Previous Commands shows you the 20 most recent commands that you submitted to this partition from OpsNav. Select the command that you want to rerun, click OK, and OpsNav will bring that command back to the Command to Run: box on the panel. If you want to prompt your command to select and enter other parameters, you can click on the Prompt button on the panel. This action displays a Command Prompt panel that displays all the possible parameters that you can select for the command. The parameters on this screen are no different than what you would select if you had run the command on a 5250 screen and pressed the F4 key (prompt). They are just presented graphically. From the Command Prompt panel, select OK and the fully formatted 5250 command will be returned to the Run Command panel. At this point, you have two choices: You can send the command to your i5 for immediate execution; or you can add it to Management Central’s Scheduled tasks to be executed at a later date or time. Here’s how each choice works. Running a Command Immediately After configuring your command and its parameters on the Run Command panel, you can tell OpsNav to submit the command to your target i5 partition for immediate execution by clicking on the panel’s OK button. OpsNav will then take the i5/OS command you created and send it to Management Central (MC) on your i5 central server for execution. This means that in order to use Run Command in a multi-partitioned environment, you must have Management Central configured on your target partitions and on a central partition. After submitting the command, Management Central sends the command to its target partition for execution. A Run Command Task Status window will appear that shows you the current status of your command. When the command status reads Completed, you can right-click on the command’s status line and select Task Output from the pop-up menu that appears. If your command completed successfully, a Run Command Printer Output window should appear, where you can open and view the spooled file output results of your submitted command. Be aware, however, that Run Command sometimes displays a few glitches that may cause you some frustration. I have found that Run Command may sometimes fail altogether or fail to display its printer file output in the Run Command Printer Output window. If the command fails to connect to the partition you are sending it to, chances are good that there is something wrong with the Management Central configuration on your partition or on your MC central system. There are several reasons Management Central may not be running correctly, and you can consult an earlier Admin Alert article I wrote called “When Management Central Won’t Start” for clues on getting Management Central up and running again. I have also found that the Run Command Printer Output window associated with a command sometimes may not display the command’s printed output, even if the command completed successfully. If that happens, you can generally find the resulting output file for a command by displaying all spooled files for the submitting user under the OpsNav Basic Operations –> Printer Output node. Scheduling a Command for Later Execution In addition to running a command immediately from the Run Command panel, you can also designate that a command should be run only once at a later date or you can set up a schedule for a command to run at a predetermined time every day, week, or month. You simply define the command the same way I described above but, instead of selecting the OK button to run it immediately from the Run Command panel, click instead on the Schedule button on that screen. This will bring you to the Management Central Scheduler screen, where you can define the date (or regular dates) when you want to run the command. Select the schedule that you want the command to run on, and then press OK on this screen. Pressing OK will cause you to exit the Run Command panel and Management Central will automatically create a scheduled task for running this command. You can view and make minor changes to the scheduled command by opening the Scheduled Tasks –> Commands node under OpsNav’s Management Central tree. By right-clicking on the command, you can use the pop-up menu to see the command’s schedule, run the command immediately, delete the scheduled command; or add a description for the command. The down side of using the Scheduled Tasks –> Commands feature is that Run Command does not provide any useful descriptive naming scheme for your command tasks; each task is only referred to as Run Command (xx) where xx is equal to a sequential command number that Management Central assigned to it. Useful, But a Little Kludgey As you can see, OpsNav’s Run Command facility is somewhat valuable for Windows users who need an outlet to run 5250 green-screen commands every once in a while. And if you get past some of its shortcoming, you can use it to your advantage. In my next article, I will discuss some of the more advanced Run Command features, and how you might use them to get more out of this function. 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 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 |