COGNOiSe.com - The IBM Cognos Community

Planning & Consolidation => COGNOS Planning => Topic started by: jv_oz on 04 Mar 2010 12:20:06 AM

Title: Run Analyst Macro from Cognos Connection
Post by: jv_oz on 04 Mar 2010 12:20:06 AM
Hi,

Can someone please advise how to run an Analyst macro from within Cognos Connection without going through the CAC (note we do not have OS sign-on enabled either).

Thanks
Title: Re: Run Analyst Macro from Cognos Connection
Post by: craig_karr on 04 Mar 2010 02:30:39 AM
In Cognos Connection, choose Administer IBM Cognos Content, then configuration, content administration, Planning, Macros then click on the "Play" icon to the right of the macro you want to execute.
Title: Re: Run Analyst Macro from Cognos Connection
Post by: DavidSmith on 04 Mar 2010 04:43:09 AM
You will need to have set up a macro in the CAC to run the Analyst macro, then you can call it as described above.
Title: Re: Run Analyst Macro from Cognos Connection
Post by: jv_oz on 04 Mar 2010 11:10:55 PM
Thanks Craig and David for your replies.

Do either of you know how to run just an Analyst Macro from Cognos Connection without going through the CAC as currently we are using CAC to run it and it is failing (we are also addressing this failure with Cognos, but want to find an alternative route if that can't be resolved).

Cheers,

John
Title: Re: Run Analyst Macro from Cognos Connection
Post by: ciaronk on 05 Mar 2010 05:39:40 AM
Can you provide a bit further info on the failure when running from the CAC?  If you run the analyst macro within the CAC manually does it fail?  What is the anaylst macro doing?

If you definately need to bypass the CAC, you could do it the old fashioned way of setting up a windows scheduler task directly on the server which in turn runs a DOS batch file that will kick off the analyst macro.  There's a wizard in Analyst to help you create the batch file if your unsure how to do this.
Title: Re: Run Analyst Macro from Cognos Connection
Post by: craig_karr on 05 Mar 2010 06:51:18 AM
Yes, and if you want to be able to execute this Analyst macro from Cognos connection, you can create a contributor macro with an execute command line step that runs the bat file which executes the Analyst macro, since if I understood you correctly you have a problem to execute macros in CAC that executes Analyst macros, but other contributor macros run fine?

Also as someone already said, post the details about the error when trying to execute the macro from CAC as these problems are usually quite simple to solve.
Title: Re: Run Analyst Macro from Cognos Connection
Post by: jv_oz on 07 Mar 2010 03:50:52 PM
Thanks for your post below ciaronk. 

I am very interested in the "old" method you describe, but run into a problem when creating the wizard based job and that is because the site I am working on does not use OS sign-on, so unless a macro is initiated from within a logged in Cognos session, it prompts for login details - somewhat of a problem when you want to schedule a macro externally.

Thus, I am hoping that you can offer any ideas on how to schedule a macro run by, say Win Scheduler, and incorporate into it the login credentials.  Any thoughts?

Thanks again.

John
Quote from: ciaronk on 05 Mar 2010 05:39:40 AM
Can you provide a bit further info on the failure when running from the CAC?  If you run the analyst macro within the CAC manually does it fail?  What is the anaylst macro doing?

If you definately need to bypass the CAC, you could do it the old fashioned way of setting up a windows scheduler task directly on the server which in turn runs a DOS batch file that will kick off the analyst macro.  There's a wizard in Analyst to help you create the batch file if your unsure how to do this.

Title: Re: Run Analyst Macro from Cognos Connection
Post by: branko on 11 Mar 2010 09:19:23 AM
Hi,

to run an analyst macro using a batch file - there is an external program "cepbatch.exe" that can be used in a simple batch file to call and run the appropriate Analyst macro. So running such a batch file will cause the macro will be executed directly in analyst - moreover - user's credentials under which the macro should be run can be added in this simple batch file as a parameter - but when I looked on the version 8.1 and 8.4 (i have installed both of them) this user's credentials can be used only in 8.1, i think - for more - see the enclosed file.

The only think you need to resove then, would be running this simple batch file - an it is up to you whether you will schedule this batch file (using windows scheduler) or allow a user to run it manually from the Cognos Connection. (not sure if it is possible to add on the portal without having to do some workaround)...

Let me know if that helped...


=========== After having problems with attaching the documents - here is the overview of it========


Example of batch file :

C:
cd \
cd program files
cd Cognos
cd cer4
cd bin
CepBatch.exe -m -1 111222333 -2 RUN_Import -3 john -4 smith007 -6 "D:\Analyst_Models\logs\Import_data.log"
Exit



Where :
111222333               =   library number
RUN_Import               =   macro name
John                  =   login
smith007                            =   password
"D:\Analyst_Models\logs\Import_data.log"                =   file for logs...

Adjustments – reflecting the instalation directories must be done.

First : run cepbatch.exe /? to find out - if this syntax is supported (for 8.4 it is not iam afraid)...

Title: Re: Run Analyst Macro from Cognos Connection
Post by: mizu on 26 Mar 2010 05:37:15 AM
take a look on this, maybe it will help:
http://www.cognoise.com/community/index.php/topic,8906.0.html