Automic Workload Automation

 View Only
Expand all | Collapse all

Using script/object variables in BACKEND VARAs

  • 1.  Using script/object variables in BACKEND VARAs

    Posted Jan 25, 2018 10:15 AM

    The documentation for BACKEND VARA objects states the following about the command field:

    You can include PromptSet variables here...

    This implies that it’s also possible to use script/object variables in the command field. Unfortunately, I have not been able to get it to work.
    feao6o8q6j8b.pnghttps://us.v-cdn.net/5019921/uploads/editor/t4/feao6o8q6j8b.png" width="772">
    Attempting to access this VARA using GET_VAR (after setting the value of the &Filesystem# variable of course) resulted in the following error:

    U02000172 Command with RunID '267736618' ended on return code '1'. Command: '/bin/df -h &Filesystem# | grep -v Mounted'.

    Is this supposed to work?



  • 2.  Using script/object variables in BACKEND VARAs

    Posted Jan 25, 2018 11:59 AM
    Interesting.  Promptsets are always processed before scripts begin executing, so the state of their variables are more stable/dependable at script execution time.  But it seems unnecessarily strict of the VARA to not also accept script variables(?)

    (We aren't using backend variables so I don't have any personal experience with this)


  • 3.  Using script/object variables in BACKEND VARAs

    Posted Jan 25, 2018 05:42 PM
    Pete Wirfs said:
    Interesting.  Promptsets are always processed before scripts begin executing, so the state of their variables are more stable/dependable at script execution time.  But it seems unnecessarily strict of the VARA to not also accept script variables(?)
    Yes, prompt set variables do appear to be special. The different behaviors of different types of variables is a frequent source of confusion and frustration. Perhaps someday some kind soul will document a list of all of the different types, how they are set/inherited, and where & when they can be used.
    (We aren't using backend variables so I don't have any personal experience with this)
    If you can believe it, this was the first time I had ever created a BACKEND VARA for actual use, as opposed to just testing. Seems like s good idea, but only partially implemented. I guess object/script variables are simply not meant to work in this context.

    I have already begun to convert this BACKEND VARA to a JOBS + EXEC VARA combo, by generalizing the approach I used to make a similar conversion of an SQL VARA. With the advent of EXEC VARAs, most of the other dynamic VARA types seem comparatively limited.


  • 4.  Using script/object variables in BACKEND VARAs

    Posted Jan 25, 2018 05:50 PM
    I have built background jobs and invoked them with WAIT.   In general, a job has far more capabilities than a variable.


  • 5.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 03:22 AM
    Interesting Discussion !,
    we usually use PREP_PROCESS + OS Command for these tasks.

    Some time ago I experimented with Backend VARAs but put the Idea of using them aside - for the same reason as Michael - it is a good Idea but as some other ideas only halfway implemented... :p

    If my memory isn't completely wrong I think i got Backend VARAs in combinationwith scriptvaras to work somehow.. with god's help and devils support .... :-)

    If you want I can look if I can find my testing objects from his time...

    chers, Wolfgang


  • 6.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 07:15 AM
    Here is what I came up with: 

    EXEC VARA to check file system free space



  • 7.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 08:33 AM
    Hi Michael,

    This implies that it’s also possible to use script/object variables in the command field. Unfortunately, I have not been able to get it to work.

    I was intrigued and after some testing could get this to work with a :PSET command in the calling job.

    Example:

    ui7n42xykauu.pnghttps://us.v-cdn.net/5019921/uploads/editor/g3/ui7n42xykauu.png" width="725">

    What's true, however, is that it may not make much sense to use a VARA.BACKEND when also using an OS job...

    Best regards,
    Antoine



  • 8.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 08:35 AM
    :PSET does not appear to work if the calling executable is an SCRI.

    Update: I just tried again with a JOBS and got the same result. I'm using v12.0.3 HF3.


  • 9.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 08:45 AM
    It does, but you have to explicitely declare the agent and the login with :PSET as well, because the VARA.BACKEND cannot inherit the task's login and host if this task is a SCRI.


    kfe6lkxrd8aq.pnghttps://us.v-cdn.net/5019921/uploads/editor/kn/kfe6lkxrd8aq.png" width="715">

    Best regards,
    Antoine


  • 10.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 09:02 AM
    Update: I just tried again with a JOBS and got the same result. I'm using v12.0.3 HF3.

    Strange... I'm using 12.0.3+hf4.

    Not sure if it's version-related... Did you check boxes 'Apply task host' and 'Apply task login'?


    Best regards,

    Antoine



  • 11.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 09:04 AM
    I tried enabling those options. It made no difference.


  • 12.  Using script/object variables in BACKEND VARAs

    Posted Jan 26, 2018 09:14 AM
    Well... It must be related to your version then. It also works like this with 12.0.3+hf4.

    jcwcf0jfz82z.png

    [UPDATE]

    It also works under v12.1 but only if the script is generated at activation time. If not, the script will fail to parse the VARA.

    a35p6dknkx4k.pnghttps://us.v-cdn.net/5019921/uploads/editor/pq/a35p6dknkx4k.png" width="985">

    Best regards,
    Antoine