Automic Workload Automation

 View Only
  • 1.  ONE Automation Error management

    Posted Oct 14, 2019 02:51 AM
    Hi gay,
         i've got some problem about managing error scripting. I need to exit from script intercepting an error code. I used dos shell but function goto not respond because ":" interpreter is used about OneAutomation framework.
    Can you help me ?
    Tx
    Daniele

    ------------------------------
    Daniele
    Postevita
    ------------------------------


  • 2.  RE: ONE Automation Error management

    Posted Oct 14, 2019 06:29 AM
    Did you use :DATA :<label>  in your script ?

    This is indicating to the AE Engine that the : is not for an internal script command but for the shell command.

    Regards.

    Alain


  • 3.  RE: ONE Automation Error management

    Posted Oct 14, 2019 07:18 AM
    Hi Alan,
         tx about information.
    When I script I receive this:
    Error OA
    What do you think about?
    Can you send me an example about code to use to exit command script with return code? 
    Regards
    Daniele

    ------------------------------
    Employee
    Postevita
    ------------------------------



  • 4.  RE: ONE Automation Error management

    Posted Oct 14, 2019 07:22 AM
    Hi.

    I think in line 14 it's

    goto ERROR

    not

    goto:ERROR​

    Hth,



  • 5.  RE: ONE Automation Error management
    Best Answer

    Posted Oct 14, 2019 07:25 AM
    ​Also, there's a sample here:

    https://docs.automic.com/documentation/webhelp/english/AWA/11.2/AE/11.2/All%20Guides/Content/ucaadm.htm

    You need to put your line containing the colon into a :DATA block.

    :DATA ":ERROR"
    echo "File not found"


  • 6.  RE: ONE Automation Error management

    Posted Oct 14, 2019 07:42 AM
    Hi Carsten,
        it's work! 
    Thank you very much.
    Daniele

    ------------------------------
    Employee
    Postevita
    ------------------------------



  • 7.  RE: ONE Automation Error management

    Posted Oct 14, 2019 07:47 AM
    Hi Daniele,

    Nice, thank you :)

    Best regards,
    Carsten​


  • 8.  RE: ONE Automation Error management

    Posted Oct 14, 2019 07:33 AM
    Edited by Carsten Schmitz Oct 14, 2019 07:35 AM
    While​ we're at it:

    You should probably activate (by removing the comment marker, "!") the lines 3 and 4 and put them everywhere you want to check for errors. If you don't at least have them once, your job will always end ENDED_OK even if there is an error.

    If you do this after your copy statement, most likely you won't even need to check if the file exists, because then your "copy" statement will fail (and likely it prints "File not found" by itself).

    (edited, brainfart).

    Best regards,