How Do I Record a PC5250 Macro?
October 20, 2010 Hey, Joe:
I have some PC5250 users who every month need to execute the same commands from their green screen sessions to launch queries, set configuration values, etc. How do I teach them to create macros so they can spend more time analyzing data and less time creating it?
Macros are extremely easy to create on a PC5250 screen. Here’s how to do it using the Personal Communications program (PC5250) that comes with iSeries Access for Windows V5R4Mx.
PC5250 macro generation is controlled through four buttons on the PC5250 toolbar: Record, Stop, Play, and Quit. Here’s what these buttons look like.
If you can’t see these macro control buttons on your screen, your session probably isn’t displaying the PC5250 toolbar. To enable the toolbar to display on a PC5250 screen, click on View from the PC5250 menu bar and check the Toolbar selection. This will cause the toolbar to appear.
To record your macro, sign on to a green screen session and click the Record button on the toolbar. This will cause the following Record Macro/Script As panel to show up.
Enter a name for the macro file that you want to capture your commands to. There are a few other parameters you may also want to change for this file. By default, macro scripts are recorded in VBScript, but you can record the commands in a macro file by turning on the Macro File radio button in the Record Format section of the screen.
Also consider whether you want to record the actual user wait time between executing commands along with the i/OS commands (the default setting). If you record the wait time, on execution the macro will always wait between executing commands for the same number of seconds that you originally waited when the command was recorded. This means that the wait time between commands will also be replayed each time you replay the macro, possibly slowing down your users.
You can easily change the Record User Wait Time setting to None or Fixed by clicking on its corresponding radio button on the screen. Changing it to None will skip recording the wait time between commands, but be warned that this setting can cause problems when actually executing the commands. If you record the commands with no wait time, the next command may fire off before your iSeries, System i, or Power i machine has finished processing the previous command and the commands may not execute properly in sequence. Changing Record User Wait Time to Fixed changes the wait time between commands to a standard 25 ms after each command is entered. However, if your partition is running slowly, this may not provide enough time to allow each command to finish.
Your best bet may be to record the commands with the Actual wait time radio button selected and then make sure that the wait time between commands is sufficient enough to allow your machine to finish processing the commands. If you find that your wait times are either too fast or too slow, you can edit the macro later on.
After you input the macro name and adjust any parameters, simply start typing in your commands and PC5250 will record each command and its corresponding wait time to your macro. When you finish capturing all the commands, click on the toolbar Stop button and your macro will finish recording.
Click on the toolbar Play button to play the macro again. The following Play Macro/Script screen will appear. Select the macro you want to play, click the OK button, and the macro will execute and replay all its recorded keystrokes.
If you later want to edit one of your macros to change the wait values or add other information, you can edit a macro by clicking Edit, Preferences, Macro/Script from the PC5250 menu bar.
This will bring up the following Macro/Script Setup window. Select the macro that you want to edit and then click on the Customize button.
This will bring you to the following Customize Macro/Script screen where you can change your macro commands as needed.
You’ll need to be familiar with VB Script to make changes, but once the changes are made, they will execute the next time you run your macro.
And that’s all there is to creating, executing, and changing macros.