Create Administrative Macros

You create an administrative macro just as you do a report-level macro, however you must assign the specific name of the macro you want IBM® Cognos® PowerPlay® to run automatically. For example, if you want PowerPlay to recognize the AppOpen macro, the file AppOpen.mac must exist in the Macros directory.

The table below describes the PowerPlay administrative macros, the names to assign the files for PowerPlay to automatically run them, and identifies the order in which PowerPlay executes them.

Administrative macro

Description

AppOpen Macro

Performs startup operations when PowerPlay starts and before it opens a cube or report.

DocOpen Macro

Runs administrative tasks when PowerPlay opens a report or cube. Any instructions in the macro are executed before the report or cube opens.

After Doc Open Macro

Used for local document processing, such as performing calculations.

This macro must have the same file name (with the .mac extension) and be stored in the same folder location as the report.

Highlight Exceptions Macro

Highlights exceptions. After you specify the use of this function in the Custom Exceptions dialog box, PowerPlay runs this function once for every cell in a report.

DocClose Macro

Performs cleanup operations required after running the DocOpen macro. This macro starts when you close the report.

AppClose Macro

Performs cleanup operations required after running the AppOpen macro. This macro starts when you close PowerPlay.

Examples

The following examples demonstrate some specific uses for administrative macros:

  • To ensure that users have the latest cube, use the DocOpen macro to verify the version when PowerPlay is opened.
  • To delete any empty or unused files, use the DocClose macro when you close PowerPlay.
  • To automatically drill down to the lowest level of a category, use the After Doc Open macro.
  • To open PowerPlay and set preferences, use the AppOpen macro.
  • To reset any preferences after a user quits the application, use the AppClose macro.
  • To highlight any exceptions in a report, use the Exception macro.
  • To preset security passwords for a cube or report, use the AppOpen macro.