How to run CognosScript macros?

CognosScript programs (macros) can be written, run, debugged and tested in the CognosScript Editor which comes default with the installation of Cognos Impromptu or PowerPlay. The CognosScript editor can be started on edmacro32.exe in the \bin\ cognos installation folder to open mac files.

The Macros are saved to a text format and have a mac extension. When the file is run it is automatically compiled to a binary file, with a mcx extension.
To run the macros from the command line the runmac32.exe in the \bin\ cognos installation folder is used.

To run a cognos macro from the command line just type in the following at the command prompt:
“D:\Program Files\Cognos\cer3\bin\runmac32.exe” D:\myfirstmacro.mac

It is also possible to pass a parameter to the script (you’ll find an example on how to read the parameter in CognosScript on our pages). It can be done by adding the parameter simply at the end of the command: “D:\Program Files\Cognos\cer5\bin\runmac32.exe” D:\myfirstmacro.mac