11.07.2015 Views

Automate Scheduler Using Macros

Automate Scheduler Using Macros

Automate Scheduler Using Macros

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6: PropertiesExampleThis example creates a new task which saves the scheduled report into asnapshot.Sub Main()Dim objSchedApp As ObjectDim objScheduledTasks As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")'ensure that <strong>Scheduler</strong> has access to Impromtpu automationobjSchedApp.MutuallyExclusive FalseSet objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My snapshot task".ScheduleName = "C:\Program Files\Cognos\Impromptu 5.0\" & _"Imp.5.0 Samples\Reports\Annual Product Sales.imr".ScheduleType = 0.RunAtHour = 18.RunAtMin = 45.EffectiveFrom = Date'save the report as a snapshot.CreateSnapshot = True'must be a valid path and unique filename.SnapshotFileName = "C:\MyResults\MySnapshot.imr".SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd SubStartTime PropertySyntaxCompletedJob.StartTimeApplies ToCompletedJobDescriptionReturns the date and time the scheduled task was started.DiscussionUse this property to obtain the date and time the task started. If thecompleted task was remote, it is the time the task started on the client,which is then localized to the time on the server using Universal TimeCoordinates (UTC).Use the EndTime property to obtain the date and time the taskcompleted. The difference between the StartTime and EndTimeproperties gives you the duration of the task.For more information on UTC, see the Request Server Guide.134 <strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!