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


osirisja
2012-02-28T16:25:29Z
Hi support (or anybody)

Is it possible to create temporary variables named dynamically when a job runs, and for them to be automatically 'dropped' at the end of the job? i.e. so that they don't exist in the Variables dialogue and don't consume too many system resources.

Reason I ask is that I am querying a database for job parameters and there could be 20-30 of them. There could also be 3 or 4 'similar' jobs running in parallel doing the same thing so I need different variables so they don't overwrite each other. I want to allocate the returned values to variables in a loop - for example 'J1 through to J30' and use them in various processes and logs. Then when the job finishes I just want to get rid of them.

perhaps the most obvious way is the right way? (i.e. 'SET VARIABLE' and then 'REMOVE VARIABLE' tasks, but that would mean lots of individual task definitions? or......?

Cheers

Andy
Sponsor
Forum information
Support
2012-02-28T20:24:56Z
You could use the Set/Remove Variable approach and use the Unique Id for each execution of the Job as key:

{JOB(Active|UniqueProcessId)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2012-02-29T08:01:03Z
Hi Henrik

Thanks for your suggestion however I have discovered a slight issue. The Remove Variable task only allows you to select defined variables from a drop down list, and won't allow me to define a dynamic variable name.

Any other way I can achieve this?

Cheers

Andy
Support
2012-02-29T08:06:36Z
I thought that was open for edit. We will open it up for editing in some way.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2012-02-29T08:10:54Z
Great - thanks Henrik

Cheers

Andy
osirisja
2012-02-29T09:01:18Z
Hi Henrik

Another stumbling block, if you have any suggestions?

My SQL query returns a delimited string in STDOUT, e.g:

1|1|01/02/2012 13:37:48|28/02/2012 14:07:34|1|JTINVPDF.PRF|v|info@mavensystems.co.uk|1|na|na

(this is a shortened version that contains 11 fields where the real string will contain 30 or 40 fields) but looking at the LOOP task there doesn't seem to be a way that I can traverse across the single record and assign each of the 11 delimited fields to variables.

Am I missing something really simple here?

Cheers

Andy

osirisja
2012-03-01T22:15:25Z
hi henrik

just wondered if you had any thoughts on this?

cheers

andy
Support
2012-03-02T07:33:07Z
I think, what you need is a "line break" with option to use Tab character. This way you will be able to loop through.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2012-03-02T09:18:39Z
Hi Henrik

Yes - I was considering that approach - perhaps reformatting the returned SQL string with a Powershell script or something, but it's a little messy and not particularly generic. For example, having the ability to
traverse across a delimited record could also be a very useful feature for reading various Log files. Perhaps making use of the FOR X value in a FOR loop to dynamically assign a variable based on 'X'?

Cheers

Andy
Support
2012-03-02T09:30:54Z
Please download 6.0.8 published today - it supports the Pipe as "newline".
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2012-03-02T09:32:33Z
Also, we opened up the Remove Variable for editing.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2012-03-02T09:34:52Z
Fantastic - thanks Henrik 🙂
Scroll to Top