Recording a simple macro
This section shows you how to record a very simple macro. This macro changes the application screen from the ISPF Primary Option Menu to the Data Set List Utility screen (passing through the Utility Selection Panel screen on the way).
Before recording this macro, assure that:
- The ISPF Primary Option Menu is displayed on the session window. See Figure 2.
- The Macro Manager toolbar is displayed above the session window. Figure 1 shows the Macro Manager toolbar (this is
the same illustration that is displayed in Figure 1).
Figure 1. Macro Manager toolbar
If the Macro Manager toolbar is not displayed on your system, click View > Macro Manager.
To record the macro follow these steps:
- Is TSO displaying the ISPF Primary Options screen? If not, then go to the ISPF Primary Options screen. See Figure 2.
- Click the Record macro icon to start recording. (This icon displays a single dot over an image of a cassette.)
- The Record Macro window appears. Follow these steps:
- Select a macro location, such as Personal Library
- Click New.
- Type a name in the Name field, such as ispf_ex1 (macro names are case-sensitive).
- Type a description in the Description field, such as Simple macro.
- Click OK.
- The Record Macro window disappears.
- The ISPF Primary Option Panel is still displayed. See Figure 2.
Figure 2. The ISPF Primary Option MenuIn the figure above, Z and I Emulator for Web is displaying the application screen and waiting for user input in the same way that it always does. But at the same time, the Macro object is waiting to record the user input when it occurs. There are two visual cues in the figure above that show that a macro is being recorded:
- In the status line at the bottom of the session panel is displayed the message Recording macro.
- On the Macro Manager toolbar the five icons on the right are enabled (Stop Macro, Pause Macro, and the three Add-A icons), while the five icons on the left are temporarily disabled. See Figure 2.
- Click on the Option line near the top of the application screen. The Option line is the fourth line of the ISPF Primary Options Menu and begins at the left side of the screen with the label Option ===>. You should see the text cursor appear at the location that you clicked. Is the cursor displayed on the Option line? If not, then click again.
- Type 3 and the enter key. As the figure above shows, 3 is the selection for Utilities.
- The application screen changes to the Utility Selection Panel.
See Figure 3.
Figure 3. The Utility Selection Panel application screenIn the figure above, ISPF has automatically placed the text cursor on the Option line of this menu. On your screen, is the text cursor on the Option line? If not then click on the Option line to move the text cursor there.
- Type 4 followed by the enter key. As the figure above shows, 4 is the selection for Dslist.
- The application screen changes to the Data Set List Utility. See Figure 4.
Figure 4. The Utility Selection Panel application screen
- Click the Stop playing or recording macro icon to stop recording. This icon is the one that displays a black square with the image of a cassette below it. The five icons on the right side of the Macro Manager toolbar become disabled, and the five icons on the left side become enabled.
- Recording is complete. The Data Set List Utility screen is displayed, as in Figure 4.
Some observations:
- You clicked the Record macro icon to start recording.
- You entered input (a mouse click and some keystrokes) just as you normally would when using the application, and the host application, ISPF, displayed the application screens and responded to the user input as it normally does.
- The Macro object recorded the application screens (or rather, a few identifying characteristics of each application screen) and recorded the mouse clicks and keystrokes as you entered them.
- You clicked the Stop recording or playing macro icon to stop recording the macro.
You can record interactions with more than one session into the same macro. This is an advanced feature (see Interacting with more than one session).