Macro Manager exercise

This exercise takes you through the recording features of the Macro Manager. Because host applications are so different, the steps will not apply to all host applications. It's up to you to customize the macro for your specific application.

In this exercise, IBM's OfficeVision/VM application is used. If your host uses OfficeVision, great! If not, comments in italics guide you in customizing a macro for your own application. A menu application will work best for this exercise (ISPF is a good one if you're using it with TSO). Before you start, be sure that a session is started and that you are logged on to your host system.

Don't forget to click the Help button if you need to!

  1. Click Macro Manager on the toolbar.
  2. Click Record.
  3. Click New.
  4. Enter the following information:
    • Name - Exer1
    • Description - Macro Recording Exercise (do not worry if the text wraps, since it is stored as a continuous string)
  5. Click OK. You are now in record mode. All keystrokes will be recorded in the macro.
  6. At your host's system prompt, type profs and press Enter. Substitute your application's command here. For example, if you use ISPF, from a TSO prompt type ispf instead of profs.
  7. Insert a Smart Wait. Click the Smart Wait button and do the following:
    • Check Field Count
    • Check Input Field Count
    • Enter OfficeVision/VM in the Keyword field (note: a Wait is case sensitive).  Substitute a keyword that is unique to the first screen of the host application.
    • Enter 5000 in the Timeout field (5 second wait)
    If the host application screen has a variable number of fields, you may not get a match for the smart wait because the number of fields recorded can be different from what is actually on the screen. If so, re-record the macro and don't use field counts.
  8. Add a prompt for the menu item. Click Prompt and do the following:
    • Don't edit the row and column position. The cursor is already where it needs to be to enter OfficeVision commands. If you need to adjust the location of where the prompt will be placed for your application, either adjust the values in the window, or click Cancel, move your cursor to the right place with your mouse (not with the arrow keys) and click the Prompt button again. If you are not using OfficeVision for this exercise, your cursor should be at the location where you enter menu commands.
    • Name the prompt Enter Menu Choice.
    • Enter filelist as the default value. Add a default menu command.
  9. Click OK. A prompt window appears. This allows you to enter whatever text the application needs in order to continue normally. Usually, you can leave the default value in the prompt window and click OK. The prompt places the text on the screen only; it doesn't press Enter because you might want to do something else, like press a PF key.
  10. Press Enter. The filelist command is entered. Press the key that will send the command to the host.
  11. Press PF11. This should bring you into XEDIT mode for the first file in the list.
  12. Click Stop. You're done! Do any steps you want recorded in the macro and then click Stop.

Test the macro by going back to the screen from which you started, and click Play.

The Macro function performs automatic screen-recognition for you by watching the field counts on each screen. You don't have to add a smart wait for every screen unless you are sure that the field counts are not a positive enough way of recognizing a screen. IBM's Callup application is a good example of when you do need a smart wait, because the cursor position depends on how long a name you're searching for.

Related topics