Previous Topic: Examples

Next Topic: Control Options

Support for User Defined Macros (UDM)

CA 2E has a feature that gives you the ability to record and play User Defined Macros (UDM) from a Web Option page at run time. User Defined Macros allow any user to pre-record keystrokes for any screen at any position. There can be multiple macros defined for the same screen or field combination.

Note: Macro and Script are used synonymously in this appendix. A User Defined Macro is simply a script by another name, but is not the same as a Macro button defined in the section Web Option HTML Input Element Format.

From versions of Web Option prior to r8.5, the following changes were made to the way scripts are stored as a result of the implementation of UDM support:

  1. All users on the system have their own members in YSCRIPT. The members can contain multiple scripts. Any script that a user creates is stored in this member.
  2. A default member called DEFAULT also exists in YSCRIPT. This member can contain multiple scripts and allows the users to add scripts only manually. The scripts contained in this member are available to all users for running. Users cannot edit scripts in the DEFAULT member. If a user selects any of these scripts for the Delete or Edit option, the action is ignored. However, you can copy these scripts between the DEFAULT and user-specific members for editing purposes.

Note: If you have added a new script member for a user to YSCRIPT, you must end and restart the web option server for the scripts to be available for that user in a web option session.

User Interface

You can add UDM support to the skeleton through a new system tag (_xSCPLST). Use the the customization element named *SCPLST to add to a screen element on the function Header. This ensures the _xSCPLST tag is inserted in the skeleton. Otherwise, you can make a change to the MLS Syntax file or edit the skeleton after generation.

Note: If you are adding the _xSCPLST tag manually, ensure you add it after the <form method….> HTML line.

When the Web Option Server processes a skeleton containing the (_xSCPLST) tag, the following additional processing is initiated:

  1. The tag processor parses the DEFAULT member in YSCRIPT and loads all the scripts available for the screen being processed.
  2. The tag processor parses your member in YSCRIPT and loads all the scripts available for the screen being processed.
  3. The scripts are sorted in name order.
  4. If you have *ALL authority, certain control options are also loaded. Control options that are loaded depend on the current script processing status.

    For more information about the available control options, see Control Options.

  5. The *SCPHDR object group (in the MLS Syntax file) is written to the HTML output.
  6. The *SCPRCD object group is written repeatedly to the HTML, once for each available script. The Script name and Script description are made available in the &&_scpnam and &&_scptxt substitution variables respectively.
  7. The *SCPFTR object group (in the MLS Syntax file) is written to the HTML.

The following example shows the Script Selection DDL:

example script selection DDL

You can also expand the Script Selection DDL:

expanded script selection DDL

Note: In this example, you have *ALL authority. As a result, the Record Keystrokes, Delete Script, and Edit Script options are shown at the bottom of the Script Selection DDL.