AutoSys Workload Automation

 View Only
  • 1.  Pass the output value of the jobs predecessor to the next job

    Posted Oct 23, 2017 10:25 PM

    Hi,

     

    I have scenario like this. This scenario is requested by my customer:

    - Job A: Capture the date within file. I use vbs to handle this instead use the text file reading and monitoring.

    - Job B : Capture the system date of the PC. I created vbs to capture the system date of the PC

    - Job C: showing the date captured by Job A and Job B into the message box. The message box should be providing "Yes" and "No" button. If the date captured by Job A and Job B is appropriate, then click "Yes" button to continue to the next job. If the date between Job A and Job B are not same, then click "No" button and turns Job A to "On Hold".

     

    For Job C I use vbs script like this:

    Set objArgs = WScript.Arguments
    T1 = objArgs(0)
    T2 = objArgs(1)
    mas="Date within file is" & T1 & chr(10) & "Date from system " & T2 & chr(10) & "Are those date are same?"
    x=MsgBox(mas,4,"Operation Alert")

    I name this script as messagebox.vbs.

     

    I expected T1 and T2 are used to accommodate the date captured by Job A and Job B.

     

    how to pass the date captured by Job A and Job B to script/argument in job C?

    Please give me idea to this case.

     

     

    Regards,

    Rio



  • 2.  Re: Pass the output value of the jobs predecessor to the next job
    Best Answer

    Broadcom Employee
    Posted Oct 24, 2017 11:03 PM

    Hi,

    In DE you can use Job Output Variables.  The value of one job can passed to another within the same application.  You will have to make some changes on the agentparm.txt of the agent.  Then you will have to define the variables name in a very specific manner.

     

    Please see this link for more details.

     

    Thank you,

    Nitin Pande

    CA Technologies



  • 3.  Re: Pass the output value of the jobs predecessor to the next job

    Posted Oct 25, 2017 12:31 AM

    Hi Nithin,

     

    Thank you for your reply. after I read the link, I have several question:

    1. Which JOB that I should have this javascript?

    2. If in one JOB needs 2 variables, then should I define 2 Javascripts within this JOB?

     

    What I'm doing right no to test JOB C is following:

    Command to run   :   cscript

    Argument to pass   : C:\messagebox.vbs %(APPL._user1) %(APPL._user2)

     

    When I'm going to trigger JOB C, I set User Parameter to Pass to Event with a dummy value

    Parameter 1: 25102017

    Parameter 2: 24102017

    The result is, JOB C work as expected. But I use a dummy value, not the return value from JOB A and JOB B.

     

    Thanks

    Rio



  • 4.  Re: Pass the output value of the jobs predecessor to the next job

    Broadcom Employee
    Posted Oct 27, 2017 02:56 PM

    Hi,

    Please note that 'Job output variable' supports a few job types.  The link I mentioned, lists all the supported job types.  It appears you may be trying to use a Windows job type and pass some values.  The Windows Job type does not return any variable from the agent so you will have to think of another way. 

    One way you can get OS environment variable (envvar) back to DE is by using SETVAR in CLI to setup a global variable. Here is an example: 

    OS_VAR=/tmp/`date +%y_%m_%d_%a`

    cli de.example.com 7500 DE_USER password 'SETVAR name('VAR09') value("'$OS_VAR'")'

     

    So, first set the OS variable, which can be anything.  Set the output of your JOBA to OS_VAR.  The you use the the CLI and connect to DE server with a valid user and being the OS_VAR value to DE.  Next pass the OS_VAR and the value in DE to your next JOBB or JOBC. 

     

    Note:  You will need to install the CLI on the host where you are going to run the job.  The CLI referred here is CA Workload Automation DE CLI.  It's a very lightweight CLI utility that comes with CA WA DE DVD.

     

    Let me know if this works for you. 

     

    Thank you,

    Nitin Pande

    CA Technologies



  • 5.  Re: Pass the output value of the jobs predecessor to the next job

    Posted Oct 30, 2017 07:39 AM

    Hi Nitin

     

     

     

    I have created the global variable with value GET_DATE. Now how to set the output the JOB A to GET_DATE and how to pass the output of Job A to next jobs?

     

     

     

     

     

    Regards,

     

    Rio Satriyo

     

    Solution Architect

     

    085640311677



  • 6.  Re: Pass the output value of the jobs predecessor to the next job

    Broadcom Employee
    Posted Oct 30, 2017 03:12 PM

    Hi,

    Please see my previous post on to get the values from OS variable to DE side variable.  

     

    Thank you,

     

    Nitin Pande

    CA Technoliges