cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6838
Views
0
Helpful
23
Replies

Group Variable Issue

i defined a variable TierWinDir with a constant value of tst. on the group job i use dev. when the job runs it is not using the value on the job group.

please advise. thanks,
warren

23 Replies 23

here is my findings when i try to simulate with different scenarios.


when i use a job group variable based not on a global variable and run the job group it is working. it will not work when the child job is run by itself it has to be run from the job group.

when i use a job group variable based on a global variable. either this run as a group or not it is not working.

our goal is to use the global variable as a group variable to make that as a local variable to a specific job group. this is so we can use only the same global variable accross all tiers but the value will be different for some jobs.

Hi Warren,

That sounds like a pretty good idea, and then to treat the one-offs with a different value. So, I just wanted to expand on your findings a little bit with a job group variable not based on a global variable.

The variables defined within Definitions are known to be global variables (public), whereas variables defined within a job group are local variables. Here at the job group level, you are trying to access TierWinDir.132 which is a global variable and change its value. So, instead you would create a local variable at the job group level and call it local_variable. Then the local variable can be assigned to the value of TierWinDir.132 (but not directly to the variable itself), and have local variable passed down to the children jobs. And for the one-offs, the local_variable values can be specified differently at the job group level.

BR,

Derrick Au

hi derick,

thank you for your help. now i understand that the public variable can't be use to act as a local variable. what i am hoping is that i can use the public variable to act as a local variable but having different value for the group job only. that will not affect/change the value of the public variable when use as a group variable.

Hi Warren,

Since public variables cannot act as a local variable due to its scope, the desired output below cannot be achieved through local variables

public <TierWinDir.132> = tst

/development | local variable <TierWinDir.132> = dev
/development/group a jobs
/development/group a jobs/100 - FTP job
command: /c dir e:\Apps\SFS<TierWinDir.132>\data\in

/test
/test/group a jobs
/test/group a jobs/100 - FTP job
command: /c dir e:\Apps\SFS<TierWinDir.132>\data\in

when development job runs it will be e:\Apps\SFSdev\data\in
when test jobs runs it will be e:\Apps\SFStst\data\in

As a workaround, if you have a number of different tiers (dev, test, qa) you can use the same public variable TidalWinDir and set it to some default value of your choice. In your job stream for each tier type, you can create a dummy job (sleep 1 sec) which is primarily used for triggering a variable action to set the TidalWinDir to (dev, test, qa). Upon successful completion of this dummy job, the variable would be set accordingly, along with triggering the rest of your downstream jobs. And here you won't need to use local variables. But just becareful with the timings because you will end up with criss-crossed variable values when doing parallel runs. Maybe it is worthwhile to create separate variables for each tier type :-)

BR,

Derrick Au

Hi Warren

Thanks for trying out the suggestion. This time, looks like you are doing everything correct.

I happened to notice that someone else had reported same issue in 2014, but don't seen any response.

https://supportforums.cisco.com/discussion/12341976/local-variables-not-expanded-ftp-jobs

Based on what you said above, have you tried using the public variable(set to the respective environment name) directly in the job ? Do we really need both public and local variables, if there is only one job in the jobgroup using the variable ?

hi dinesh,

yes we somehow need the public variable to act as local variables. there are jobs that share the same variable but some needs to use a different value. this is because in one tidal tier is shared by different servers. for example our tidal development and test is on the same tidal tier. and on this development and test tier can can run both the development jobs on the development server and the test jobs on the test tier. at the same time we need to maintain or use the same public variable across all tier dev, test, qa, and prod. instead of using another public variable (e.g. TierDevWinDir).


e.g.
public <TierWinDir.132> = tst

/development | group variable <TierWinDir.132> = dev
/development/group a jobs
/development/group a jobs/100 - FTP job
command: /c dir e:\Apps\SFS<Group.<TierWinDir.132>>\data\in

/test
/test/group a jobs
/test/group a jobs/100 - FTP job
command: /c dir e:\Apps\SFS<TierWinDir.132>\data\in

when development job runs it will be e:\Apps\SFSdev\data\in
when test jobs runs it will be e:\Apps\SFStst\data\in

however, what happens is that when dev job runs it gets illegal characters in path output is:

Connected to host ftp-test.osc.state.ny.us

Multiple Get sfs-shared/9500*_D_*110215 from ftp-test.osc.state.ny.us to e:\Apps\SFS<Group.tst>\data\in

FTP JOB Completed Abnormal : Illegal characters in path.

thank you.

Hi Darren, you should be able to do it as you mentioned. For example, for the DEV job, we can set the local variable to DEV and the TST jobs will have the local variable set to TST.

Are you seeing this issue in FTP jobs alone or other jobs as well ?

If it is specific to FTP jobs, you may want to create a case with Cisco

Hi Warren,

Inside Tidal job, 100.02 - SFTP All EE1 - OSC to DOT (child job)

The variable selected should be from "Local Variables"

Once selected, local path should read:<Group.<TierWinDir.132>>

BR,

Derrick Au

thanks derrick for looking into the issue. yes the local path is read as <Group.<TierWinDir.132>>. when i run it is giving me illegal characters in path.

Review Cisco Networking for a $25 gift card