Automic Workload Automation

 View Only
  • 1.  Dynamically reading variable obect

    Posted Jan 09, 2018 09:05 AM
    Hello,

    Hope this is an easy question ..

    If I have a variable object as below:

    sh6t04hydy8y.pnghttps://us.v-cdn.net/5019921/uploads/editor/8l/sh6t04hydy8y.png" width="777">

    and I want to declare and assign all the values in it to a variable e.g.

    VAR1 = 'TEST'
    VAR2 = 'TEST2'

    Do I do something similar to:

    :SET &HND#=PREP_PROCESS_VAR(DATABASE_MAINTENANCE)
    :
    PROCESS &HND#
    :   
    SET &VK# = GET_PROCESS_LINE(&HND#,1)
    :   
    SET &VALUE# = GET_PROCESS_LINE(&HND#,2)
    :   
    PRINT "&VK# &VALUE#"
    :
    ENDPROCESS

    If so how do I get it to resolve VAR1 to equal "TEST"

    or is GENERATE_SCRIPT_VARS for this exact purpose?

    Hope this makes sense?

    Cheers,

    Dan.


  • 2.  Dynamically reading variable obect

    Posted Jan 09, 2018 10:02 AM
    Not sure if I understood that correctly.

    You hava a VARA object containing KEY & Value  -- OK
    VAR1 = 'TEST'
    VAR2 = 'TEST2'

    Do you want the KEY (VAR1, VAR2) becoing a script Variable - e.g. &VAR1#, &VAR2#... ?
    in this case GENERATE_SCRIPT_VARS would do the trick..

    OR

    Do you want to get the content of additional VARA object "TEST" and "TEST2" ?

    cheers, Wolfgang



  • 3.  Dynamically reading variable obect

    Posted Jan 12, 2018 05:12 AM
    Hi Wolfgang,

    Do you want the KEY (VAR1, VAR2) becoing a script Variable - e.g. &VAR1#, &VAR2#... ?
    in this case GENERATE_SCRIPT_VARS would do the trick..

    This is what I am trying to do yeah ... so many thanks ... 

    Cheers,

    Dan


  • 4.  Dynamically reading variable obect

    Posted Jan 12, 2018 08:09 AM
    welcome - as usual :-)