Automic Workload Automation

  • 1.  Variable setup for working directory of a job

    Posted Oct 07, 2015 02:05 PM
    Hi,
     I was just wondering if it possible to set up a variable for the working directory of a job or rather jobs. Just thinking of an alternative as opposed to going into all the jobs and manually changing the working directory everytime.



    Thanks,
    Apurva


  • 2.  Variable setup for working directory of a job

    Posted Oct 07, 2015 02:18 PM
    Yes, this is our normal approach.  We have Client specific Variable objects that contain the needed  Keywords and Values associated with the Client's environment; development, QA, production.  The values are read in the Pre Process and substituted as needed into the JCL (host commands). This allows us to use the same object, unmodified, in multiple Clients.


  • 3.  Variable setup for working directory of a job

    Posted Oct 07, 2015 03:34 PM
    AS Mark mentioned you can use the :put_att command in PREscript to assign several values Agent, Loginobject, .... and working directory for WIN jobs.

    Docu:
    http://docs.automic.com/documentation/AE/11.1/english/AE_WEBHELP/help.htm#ucaads.htm

    List of Attributes for put_att
    http://docs.automic.com/documentation/AE/11.1/english/AE_WEBHELP/help.htm#ucabao.htm

    even more simple is the usage of a variable:
    http://docs.automic.com/documentation/AE/11.1/english/AE_WEBHELP/help.htm#ucaaal.htm

    so in your case you could use a simple variable &directory# or assign the attribute workdir with
    :put_att WIN_WORK_DIR = "C:\Schubiduba" in prescript







  • 4.  Variable setup for working directory of a job

    Posted Oct 08, 2015 11:16 PM
    So say I'm using the variable method, I create a variable object as &directory# and enter the location in that variable. Then I go into all the jobs and in place of working directory in the Windows tab, I put the variable. Is that right? or will I have to declare it anywhere else?


  • 5.  Variable setup for working directory of a job

    Posted Oct 09, 2015 05:51 AM
    No you set the Script(!) Variable in prescript of the job and the Script Variable in Workdir Definition:

    tldzlbez68g9.pnghttps://us.v-cdn.net/5019921/uploads/editor/k1/tldzlbez68g9.png" width="497">

    1oc2vkq7svo7.pnghttps://us.v-cdn.net/5019921/uploads/editor/xp/1oc2vkq7svo7.png" width="561">

    i3d4l07t8q3x.pnghttps://us.v-cdn.net/5019921/uploads/editor/d2/i3d4l07t8q3x.png" width="516">

    In Job report you see:

    C:\temp>dir
     Volume in drive C has no label.
     Volume Serial Number is F81B-480F

     Directory of C:\temp
    ....
    .....





  • 6.  Variable setup for working directory of a job

    Posted Oct 09, 2015 07:45 AM
    Okay. So the next time I have to change the working directory, I have to go to the pre-script in every job and change it. Correct?
    Is there a way so that I can put the variable in all the jobs but give the variable definition in a common place, so that I wont have to go in to every job and change the working directory?



  • 7.  Variable setup for working directory of a job

    Posted Oct 09, 2015 11:30 AM
    @Apurva 

    We use the following on V8 and I assume that it would still operate properly on more current versions.  The following is a very simple example (untested) of the technique that we use.

    1. A Client specific version of a Variable object is placed in each client with its contents set appropriately.  They are distinguished by suffixing the Client number on their name.

    SETTINGS_CLIENT1:
    Validity keyword        Value
    WIN_HOST                agent
    WIN_LOGIN               login_object
    WORKING_DIRECTORY       d:\some\path\to\command

    2. An Include object is used in all Job objects that is responsible for setting the various attributes.

    SET_SETTINGS: 
    :SET &client = SYS_ACT_CLIENT()
    :SET &client = FORMAT(&client)
    :SET &settings = "SETTINGS_CLIENT&client"
    :SET &the_dir = GET_VAR(&settings,WORKING_DIRECTORY)
    :SET &the_host = GET_VAR(&settings,WIN_HOST)
    :SET &the_login = GET_VAR(&settings,WIN_LOGIN)
    :PUT_ATT HOST = &the_host
    :PUT_ATT LOGIN = &the_login

    3. Each Job object has the following in its Pre Process tab -
    :INC SET_SETTINGS

    4. Each Job object has the following in its Process tab -

    &the_dir\shell.name.ext
    In actuality the Process tab also contains an Include that determines the shell command name and  parameters to pass, if any, based upon standardized criteria.

    Hope this helps.






  • 8.  Variable setup for working directory of a job

    Posted Oct 12, 2015 10:17 PM
    Mark_Hadler_430  Definitely does help, Thank you so much!