Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Macro running from command prompt

Status
Not open for further replies.

collierd

MIS
Dec 19, 2001
509
0
0
DE
Hello

I have a macro that opens a powerplay report and saves it as a pdf (very basic, just learning)

How can I now automate this such that it runs from the command prompt

My next steps are to automate this to run from a batch file
Have the batch file also automate an e-mail (vbscript)
Then set this batch file to run at a specific time

Initially though, I just need an automation script

Thanks

Damian.
 
There are at least 2 ways to approach this
1. Use the Cognos Scheduler which is easy to use if you're happy to have it running in the foreground or hidden in the tasktray
2. On a server you can call macros via a batch file with the following syntax:
start "c:\Program Files\\Cognos\\cer3\\bin\\runmac32.exe" "Macroname.MCX"
and then run the batch file via a scheduler.
Can't remember why some of the path is \\ rather than \, but it works!
I allow users to put reports on this scheduler by getting the macro to read a text file which has fields for the frequency (Daily, Fortnightly or Monthly), the report name (we only use Impromptu currently) and the output type (dbf, csv, Excel, pdf)
Simon Rouse
 
For batch running use something like this:
Generate a .bat file and write this into it:

"c:\program files\cognos\cer3\bin\runmac32.exe" "c:\temp\macro.mcx"

For time scheduling use the windows scheduler (you the bat files) or the cognos scheduler (you need the mcx files)

For additional info look through the cognos help, and do a search here on the forum for "email macro".

 
I'm not 100% sure, but I think you can reference .mac file too instead of .mcx, and runmac compiles it automatically.

Cheers


[blue]Backup system is as good as the latest recovery[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top