Automic Workload Automation

  • 1.  Number of columns in a VARA object

    Posted Oct 19, 2016 10:06 AM
    Hi,

    I Have a STATIC VARA object used in a script, my problem is that I have a variable that can contains 10 values and the VARA object is limitated to 5 columns.

    Is it possible to have more than 5 columns ?

    Regards,
    Kalid


  • 2.  Number of columns in a VARA object

    Posted Oct 19, 2016 10:35 AM
    Simple answer: NO.

    possible workarounds: use a seperator description in the Key name XYZ_a and XYZ_b within the VARA object, use just one column with a seperator - e.g. ; (easiest way) or use an external DB or write to a file.


  • 3.  Number of columns in a VARA object

    Posted Oct 19, 2016 10:52 AM
    Thanks very much !
    I think the separator is the best option for me !


  • 4.  Number of columns in a VARA object

    Posted Oct 19, 2016 11:17 AM
    Let's say that I have chosen ;; as a delimitor.
    val1;;val2;;val3;;

    how to retrieve the values in order to use them, I have seen that there is a function that exists :
    STR_SPLIT

    Do you have a piece of code as an example ?

    Regards,
    Kalid



  • 5.  Number of columns in a VARA object
    Best Answer

    Posted Oct 19, 2016 11:42 AM
    Your may want to review this discussion - How to process an arbitrarily-sized list of items


  • 6.  Number of columns in a VARA object

    Posted Oct 20, 2016 03:12 AM
    here is a short example:
    (you can copy-paste it into a SCRI object.

    :SET &SEPERATOR# = ";"
    :SET &RECIPIENTSLIST# = "user@local.com;mister@local.com;hero@local.com"
    :DEFINE &ARR_RECIPIENTS#, STRING, 10
    !FILL splits the string and fills the ARRAY - so no need for a loop!
    :FILL &ARR_RECIPIENTS#[] = STR_SPLIT(&RECIPIENTSLIST#,"&SEPERATOR#")
    :SET &ARR_RECIPIENTS_LEN# = length(&ARR_RECIPIENTS#[],"SIZE")
    :SET &ARR_RECIPIENTS_LEN# = FORMAT(&ARR_RECIPIENTS_LEN#)
    !only one loop is needed to get all values from the ARRAY and
    !do something with it.
    :SET &COUNTA# = 1
    :SET &COUNTA# = FORMAT(&COUNTA#)
    !loop over whole Array
    :WHILE &COUNTA# <= &ARR_RECIPIENTS_LEN#
    :  P "mailaddress: &ARR_RECIPIENTS#[&COUNTA#]"
    :  SET &COUNTA# = ADD(&COUNTA#,1)
    :  SET &COUNTA# = FORMAT(&COUNTA#)
    :ENDWHILE

    Report:
    2016-10-20 09:10:56 - U00020408 mailaddress: user@local.com
    2016-10-20 09:10:56 - U00020408 mailaddress: mister@local.com
    2016-10-20 09:10:56 - U00020408 mailaddress: hero@local.com





  • 7.  Number of columns in a VARA object

    Posted Oct 20, 2016 04:18 AM
    Hi,

    Thanks to you (both), very helpful !