Automic Workload Automation

  • 1.  How to generate a GUID in UC4 job

    Posted Sep 08, 2015 05:01 PM
    I'd like to generate a GUID (Globally Unique Identifier) in a job, and pass it to the process as a parameter.

    What I am looking for is something buit-in so I can assign the GUID to my script/object variable.  E.g.
    :SET &tGUID# = SYS_GUID

    Any suggestion is appreciated.  Thanks




  • 2.  How to generate a GUID in UC4 job

    Posted Sep 08, 2015 06:38 PM
    If you have PowerShell support in your UC4, this PowerShell logic generates and displays a new GUID:
         $Guid = [guid]::NewGuid()
         write-host "GUID:$GUID"

    Or if you just need a unique identifier and GUID format is not important, I usually use &$runid#.  The UC4 RUNID is a 10 digit integer and is guaranteed to be unique for the UC4 environment you are running in.  It also has the additional value of giving you a tie-back to "what UC4 job generated me?"



  • 3.  How to generate a GUID in UC4 job

    Posted Sep 09, 2015 03:54 PM
    Thanks Pete.

    Yes, the PowerShell logic works.  


  • 4.  How to generate a GUID in UC4 job

    Posted Sep 09, 2015 05:58 PM
    I've discovered that Oracle and SQLServer both supply GUID functions too, so you could put the following SQL statements inside of an UC4 SQLI variable;

    Oracle;
    select sys_Guid() from dual

    SQLServer;
    SELECT NEWID()



  • 5.  How to generate a GUID in UC4 job

    Posted Nov 09, 2015 12:18 PM
    I've created a backend variable object using the following command:

    powershell -Command "[guid]::NewGuid().guid"

    The return value is nicely copied into a UC4 script variable.