SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Can't seem to use @V"file" macro

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Can't seem to use @V"file" macro
Author Message
Sean Hicken



Joined: 03 Dec 2002
Posts: 11

Post Can't seem to use @V"file" macro Reply with quote

I'm trying to use the @V"file" macro to find out if the job was initiated by semaphore files or started manually by clicking on "Run Now" but I keep getting syntax errors regardless of how I try to use it.

I have tried:

Dim strMsg, string
ConcatEx("Files that initiated this job ", "@V"file"", strMsg)
LogAddMessageEx( "INFO", @V"job_id", "@V"job_name"", strMsg)

and:

Dim strMsg, string
ConcatEx("Files that initiated this job ", @V"file", strMsg)
LogAddMessageEx( "INFO", @V"job_id", "@V"job_name"", strMsg)

I can't find any examples of how to use this macro. If I change it to @V"job_name" I don't get syntax errors so it is something about the "file" macro.

Help!?

Tue Jan 21, 2003 1:14 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: Can't seem to use @V"file" macro Reply with quote

Your first script is correct, however it will work only if the job is triggered by a semaphore file. If you run the job manually it will fail because the @V"file" macro-parameter will not be replaced and this will cause the script syntax error.

To check how the job has started use FileExists statement with the same file name or file mask that you used in the job trigger definition. If it returns True you can branch script logic to execute statements using @V"file" macro-parameter othe wise you would job to prtion of the script intended for manual job run.
If you don't want to hard code the file names you can do the following

Dim strSemFiles, string
Dim bFound, boolean
JobDescribe( @V"job_id", "FILE", strSemFiles )
FileExists( strSemFiles, bFound )
If( bFound, GOTO_AUTO_RUN_LABEL, GOTO_MANUAL_RUN_LABEL )

GOTO_AUTO_RUN_LABEL:

...
GOTO_MANUAL_RUN_LABEL:

...

: I'm trying to use the @V"file" macro to find out if the job was
: initiated by semaphore files or started manually by clicking on "Run
: Now" but I keep getting syntax errors regardless of how I try to use
: it.

: I have tried: Dim strMsg, string
: ConcatEx("Files that initiated this job ",
: "@V"file"", strMsg)
: LogAddMessageEx( "INFO", @V"job_id",
: "@V"job_name"", strMsg)

: and: Dim strMsg, string
: ConcatEx("Files that initiated this job ", @V"file",
: strMsg)
: LogAddMessageEx( "INFO", @V"job_id",
: "@V"job_name"", strMsg)

: I can't find any examples of how to use this macro. If I change it to
: @V"job_name" I don't get syntax errors so it is something about
: the "file" macro.

: Help!?

Tue Jan 21, 2003 11:21 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.