The usual way to run an IBM Cognos Analyst macro from within a Contributor macro is to use the “Execute Analyst Macro” step, however for some customers this seems to fail without logging any good reasons. The error logging is minimal, though you will typically find errors such as:
Unable to execute macro 'ApplicationName.MacroName'.
The return code was 1107.
One alternative I find to work more robustly is to use the “Execute Command Line” macro step, we can use this step to launch an Analyst Batch Utility job just like in the “good old days”. This method seems to be a bit more reliable and also logs a little bit more detail.
To maximise the success rate the wizard to create the batch job should be run on the Admin Server. The wizard creates two files in the c:\Program Files\cognos\c8\bin (or equivalent IBM Cognos 10 location) and are called:
If the wizard is run on a machine other than the Admin Server they can be copied to the relevant location on the Admin Server to allow the Batch Job to be called by the macro.
To set up the Batch Utility job, open Analyst and to to the “Tools” menu. Near the bottom you can select the option “Batch Utility Wizard”.

The Wizard Welcome Page will be shown, click “Next”.

Select “Create a new batch job”.

On the “Select a macro” screen, choose your Library and Macro from the drop-down menus and then give a descriptive name for this batch job.
You can also enter the name of the Namespace you want the batch-job to use.

Finally set up a log file location so you can review the Batch Job’s status.

The completion screen gives you the options to run the job right away or to print a summary of the job.
Click “Finish” to exit the Wizard.

The command line for the Batch Utility job will be copied to the clipboard automatically, this will be useful as we can use this when we set up the Contributor Macro to call it.

Open the Contributor Administration Console and navigate to “Macros” in the tree on the left.
Then click “New” to create a new macro.

You will be prompted to enter a name for the macro.

Then you will be given a list of macro step types. Select the “Execute Command Line” macro step.

You will need to name the macro step, a descriptive name is best here, some people find it useful to prefix the step names with a code to indicate what type of macro step it is for example “ECL” for Execute Command Line, or “EAL” for Execute Administration Link”.
Place your cursor into the “Command to execute” text box and use CTRL-V on the keyboard to paste in the command line that was generated by the Batch Utility Wizard.
Finally you can chose to either enter a success code, typically success is determined by a code of “0″ (Zero).

With the macro created you can now execute this and check that it works as expected.
