Using Global Variables
search cancel

Using Global Variables


Article ID: 186248


Updated On:


CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - System Agent (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) Workload Automation Agent CA Workload Automation AE


Looking for a way to use global variables in AutoSys to perform the following functions.

1) SQL query job obtains a value from the database and stores that value in an existing AutoSys global variable "BillID".  Later in the day, different jobs use the value of the variable a parameter.

2) Value of a variable is used as a condition to trigger jobs.



Release : 11.3.6

Component : CA Workload Automation AE (AutoSys)


You can create a command job to run a script to query what you need from the db and return the results to a variable.
Use that variable's value in the autosys sendevent command to set an autosys global variable.
And yes, jobs can then use that global variable as their starting condition.

--- sample script ---
c_ename=`/opt/oracle/instantclient_11_2/sqlplus -s SCOTT/tiger@orcl <set pagesize 0 feedback off verify off heading off echo off
select ename from emp
where empno = 7566;
sendevent -E SET_GLOBAL -G USER1=$c_ename

The above connects to the db and queries a table to get the username and then sets the username as the value for USER1 (the autosys global variable).

You could then use that in a 2nd job's definition.
Example :

condition: value(USER1)=JONES

For more details on conditions see:

For more details on global variables see: