Troubleshooting
Problem
Using Cognos Scheduler when machine is logged off or session is over.
Symptom
How to running scheduler in Cognos using macros and batch files?
Cause
Resolving The Problem
Basically, since scheduler is an application, it will close when you log out.
However, there is a workaround to this problem. We can use Windows scheduler to
call a batch file which in turn can call a macro with the IMR file in its
command line as an argument. I am appending an example that I found at Cognos's
support site:
Description:
How can I use a macro to open an Impromptu
report without coding the report path?
or
How can I pass a
variable to the Impromptu OpenReport method?
Solution:
An example
macro follows. Please note that this is for example purposes only and was
tested with Impromptu 6.0.
Sub Main()
Dim variable as
string
Dim objImpApp As object
Dim objImpRep As
Object
variable=Command$
Set objImpApp =
CreateObject("CognosImpromptu.Application")
objImpApp.Visible
1
MsgBox variable 'This line is to verify the report path being passed
for testing purposes
set objImpRep =
ObjImpApp.OpenReport(variable)
End Sub
In order to pass a
parameter to a macro from the command line or from within a batch file, the
following command must be used:
For early builds of
Impromptu:
C:\cognos\BI97\runmac32.exe d:\test.mac /cmd
d:\test.imr
For current versions of Impromptu:
c:\program
files\cognos\cer3\bin\runmac32.exe d:\test.mac d:\test.imr
Historical Number
PRI49389
Product Synonym
[<p><b>]Fact[</b><p>];
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21547525