Predefined variables may be changed undesired if the Script Statement SET_SCRIPT_VAR is used before
search cancel

Predefined variables may be changed undesired if the Script Statement SET_SCRIPT_VAR is used before

book

Article ID: 115121

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Please use the following script snippet to reproduce the behavior:
 
:set &_SPLITTMP# = "TEST"
:set &_SCRIPTVAR# = "KEY#"
:set_script_var &_SCRIPTVAR# = &_SPLITTMP#
:PRINT "Clientnr: &$CLIENT#"

Add these lines to a Script Object (SCRI) and execute it. Look at the report:
 
2018-09-11 09:30:13 - U00020408 Clientnr: TEST

The predefined variable &$CLIENT# should be read-only and always give the client number of your current client. It must never be overwritten. But in this case, the client-number in &$CLIENT# was overwritten with TEST. The bug seems to affect all predefined variables (all variables beginning with &$).

If the script prints more predefined variable:
 
:set &_SPLITTMP# = "TEST"
:set &_SCRIPTVAR# = "KEY#"
:set_script_var &_SCRIPTVAR# = &_SPLITTMP#
:PRINT "Objectname: &$NAME#"
:PRINT "Clientnr: &$CLIENT#"
:PRINT "Activator: &$ACTIVATOR_RUNID#"

Not all are predefined variables are overwritten, but only one of them. In most cases the last one:

2018-09-11 09:37:13 - U00020408 Objectname: SCRI.SET_SCRIPT_VAR
2018-09-11 09:37:13 - U00020408 Clientnr: 0022
2018-09-11 09:37:13 - U00020408 Activator: TEST

Environment

Release: AUTWAB99000-12.2-Automic Workload Automation-Base Edition
Component:

Cause

This issue is still under investigation by our Sustaining Engineering.

Resolution

Install the fixed version as soon as available.