bobby_tamayo_automic

How to pass the value(s) AE variable(s) to the OS Level

Discussion created by bobby_tamayo_automic on Nov 30, 2016
Latest reply on Dec 1, 2016 by JamesD.

Hi

https://community.automic.com/discussion/1106/using-a-password-passed-from-promptset-uc-jobmd

Thanks to the above idea, it is possible to pass the value(s) of the AE variable(s) to the OS level.

For Windows JOBS:

-On the “Variables & Prompts” tab:

ecjd1mu64maz.jpg


-In the Process tab:

 

:set &UC_JOBMD = get_var(UC_EX_JOB_MD)  ! The path and file name of the Job Messenger.

 

&UC_JOBMD CMD=">>env&$RUNID#.bat echo set VAR1=&VARIABLE1#"

&UC_JOBMD CMD=">>env&$RUNID#.bat echo set VAR2=&VARIABLE2#"

&UC_JOBMD CMD=">>env&$RUNID#.bat echo set VAR3=&VARIABLE3#"

@echo off

call env&$RUNID#.bat

del env&$RUNID#.bat

@echo off

 

echo %VAR1%

echo %VAR2%

echo %VAR3%

 

 

Result:

 

c:\>E:\Automic\agents\windows\UCXJWX6M.EXE JNR=0001438083 MNR=0001 PNR=2300 IPA=127.0.0.1 TYP=S TXT="        Job started"

Program 'UC4 Job Messenger' version '10.0.2+build.624' started

UCMDJP: *********************************************************************

UCMDJP: ** JOB 0001438083 (ProcID:0000003312) START AT 30.11.2016/17:50:35 **

UCMDJP: **                                    UTC TIME 30.11.2016/16:50:35 **

UCMDJP: *********************************************************************

Connected with agent 'MTLW04'

Program 'UC4 Job Messenger' version '10.0.2+build.624' terminated normally

 

c:\>E:\Automic\agents\windows\UCXJWX6M.EXE CMD=">>env0001438083.bat echo set VAR1="E:\Automic\Agents\windows""

 

c:\>E:\Automic\agents\windows\UCXJWX6M.EXE CMD=">>env0001438083.bat echo set VAR2="E:\Automic""

 

c:\>E:\Automic\agents\windows\UCXJWX6M.EXE CMD=">>env0001438083.bat echo set VAR3="E:\Automic\ServiceManagerDialog""

"The values are:"

E:\Automic\Agents\windows

E:\Automic

E:\Automic\ServiceManagerDialog

Program 'UC4 Job Messenger' version '10.0.2+build.624' started

UCMDJP: *********************************************************************

UCMDJP: ** JOB 0001438083 (ProcID:0000005696) ENDED AT 30.11.2016/17:50:35 **

UCMDJP: **                                    UTC TIME 30.11.2016/16:50:35 **

UCMDJP: ** --------------------------------------------------------------- **

UCMDJP: **                                    USED:          @ CPU         **

UCMDJP: *********************************************************************

Connected with agent 'MTLW04'

 

Program 'UC4 Job Messenger' version '10.0.2+build.624' terminated normally



For UNIX/Linux JOBS:

 

-In the “Variables & Prompts” tab:

to9dn7sgmt0u.jpg

-In the Process tab:

 

VAR1=`&UC_JOBMD CMD="echo &VARIABLE1#"`;export VAR1

VAR2=`&UC_JOBMD CMD="echo &VARIABLE2#"`;export VAR2

 

echo "The values are:"

echo $VAR1

echo $VAR2

 

 

Result:

************************************************************************

**  ucxjlx6m   version 11.2.2+build.622         changelist 7627775    **

**  JOB 01421877 (ProcID:0000010674) START AT 30.11.2016 / 16:30:07   **

**                                   UTC TIME 30.11.2016 / 16:30:07   **

**  TEXT="        Job started             "                           **

************************************************************************

The values are:

/home/UC4

/tmp

************************************************************************

**  ucxjlx6m   version 11.2.2+build.622         changelist 7627775    **

**  JOB 01421877 (ProcID:0000010674) ENDED AT 30.11.2016 / 16:30:07   **

**                                   UTC TIME 30.11.2016 / 16:30:07   **

**  TEXT="        Job ended               "  RETCODE=00               **

 

************************************************************************

Outcomes