Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


sjw
  •  sjw
  • No customer Topic Starter
2011-09-08T00:16:29Z
Greetings:

I haven't found this answer in the forum or the documentation.

I am using quite a few variables. I have setup template jobs for quick creation of similar job types (using the clone feature). Some of these jobs have set variable tasks in them.

If 2 jobs set the value of the same variable to 2 different values, is the value set differently in each job. Or does the last set win?

Thanks
Stephen
Sponsor
Forum information
Support
2011-09-08T07:30:34Z
Since they are global the last set "wins".
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
sjw
  •  sjw
  • No customer Topic Starter
2011-09-08T13:31:53Z
I assume that this also applies to the calc variable task.

Is there any way to set a variable string that is local to the job? Can I use the std out?

More specifically, (1) store a file name that includes the hour mins secs in a string, (2) use this string in rename, copy and email messages tasks later in the job.
Support
2011-09-08T13:36:44Z
No, Variables are global. You can use some kind of dynamic naming convention like JobName or JobId in the Variable name to make it "Job specific".
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
sjw
  •  sjw
  • No customer Topic Starter
2011-09-09T15:15:57Z
Thanks for the suggestion. I am having a little trouble implementing.

1) Created a variable
{USERVAR({JOB(Active|Name)}.FileSuffix)}

2) Created a Set Variable Task
Name/Unique Key: {JOB(Active|Name)}.FileSuffix
Variable Value: {DATENOWADD(Days|-1|yyyy-MMM-dd.hhmmss)}

3) Next Tasks is Write File Task
File Path: T:\PLRPT-Dev\Workbooks\FCST_IMPORT\{{JOB(Active|Name)}.FileSuffix}.txt

This creates a file named: {xx Test Tasks - swoolwine.FileSuffix}.txt

I am hoping for 2011-Sep-08.101213.txt

Do I need to use STRING method to get the value for the variable? Thought I saw that somewhere else in the forum.

Support
2011-09-09T18:02:52Z
Hmm..
{{JOB(Active|Name)}.FileSuffix}.txt will definitely be {xx Test Tasks - swoolwine.FileSuffix}.txt as the only Variable you use is {JOB(Active|Name)}. What happened to using your full user variable as you wrote it: {USERVAR({JOB(Active|Name)}.FileSuffix)}



Originally Posted by: swoolwine 

Thanks for the suggestion. I am having a little trouble implementing.

1) Created a variable
{USERVAR({JOB(Active|Name)}.FileSuffix)}

2) Created a Set Variable Task
Name/Unique Key: {JOB(Active|Name)}.FileSuffix
Variable Value: {DATENOWADD(Days|-1|yyyy-MMM-dd.hhmmss)}

3) Next Tasks is Write File Task
File Path: T:\PLRPT-Dev\Workbooks\FCST_IMPORT\{{JOB(Active|Name)}.FileSuffix}.txt

This creates a file named: {xx Test Tasks - swoolwine.FileSuffix}.txt

I am hoping for 2011-Sep-08.101213.txt

Do I need to use STRING method to get the value for the variable? Thought I saw that somewhere else in the forum.



Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
sjw
  •  sjw
  • No customer Topic Starter
2011-09-09T18:55:24Z
Thanks for idea, but it doesn't seem to work.

This variable {JOB(Active|CounterProcessId)} seems to increment for each job run. Is this correct? If so, I can use this.

Regards
Stephen
Scroll to Top