Automic Workload Automation

Expand all | Collapse all

Passing shell variable to JCL variable

  • 1.  Passing shell variable to JCL variable

    Posted May 11, 2016 11:53 AM
    Is it possible to assign a value of a shell variable from Unix/Linux to a JCL variable?  ONE can process JCL variables simply by calling them within a standard shell script (ex: echo $EXAMPLE1#), but I cannot find a way to pass something from within a script back to JCL to be used within the ONE engine (ex: SET &EXAMPLE2# = $example).


  • 2.  Passing shell variable to JCL variable

    Posted May 11, 2016 01:44 PM
    Which version are you on of AE?  I assume that the script variable will be used subsequent to the execution the shell script, correct?

    On V8 we will have the shell script echo the needed value and then use the Post Process tab with a PREP_PROCESS_REPORT to capture the needed string into a script variable and do with it as needed.

    I think I read that in V11 there is a more direct method and that would probably be revealed with some type of documentation search. 


  • 3.  Passing shell variable to JCL variable

    Posted May 11, 2016 02:07 PM
    We're starting to use 11.2.  I was hoping to have everything bundled into a single Object.  Essentially we are planning to convert Dollar Universe objects which we could easily do if we could do a pull of the current configuration via uxshw and then pass the settings off to the ONE engine using delimited values.

    I'm actually working on a method currently to pass all the values outside of ONE into an .xml file for a variable object, import the object, and then pull the values from there, but it's pretty roundabout if I could just get the shell script to interact with ONE and feed it the information directly.


  • 4.  Passing shell variable to JCL variable

    Posted May 11, 2016 03:39 PM
    Not sure if I understood this correctly.

    If you want to pass a shellscript variable to an Automic Script variable this will help:
    https://community.automic.com/discussion/6159/easy-way-to-pass-win-unix-shell-variables-to-automic-script#latest



  • 5.  Passing shell variable to JCL variable

    Posted May 11, 2016 03:58 PM
    Wolfgang Brueckler said:
    Not sure if I understood this correctly.

    If you want to pass a shellscript variable to an Automic Script variable this will help:
    https://community.automic.com/discussion/6159/easy-way-to-pass-win-unix-shell-variables-to-automic-script#latest

    How on earth did I miss this? I did a forum search and it didn't return anything. Thank you so much. I think the variable table workaround I made will work for now until we get $U installed on a shared filesystem. I'll definitely have to play around with this option. 


  • 6.  Passing shell variable to JCL variable

    Posted May 12, 2016 04:17 PM
    So... it turns out that :REGISTER_VARIABLE is not documented in the 11.2 guides/docs and does not appear to be supported.  I attempted to use the function, which the engine did not throw an error on execution, but it instead goes into "Generating..." indefinitely.

    Is this feature discontinued?



  • 7.  Passing shell variable to JCL variable



  • 8.  Passing shell variable to JCL variable

    Posted May 13, 2016 09:16 AM
    Yeah, I found it now.  I had foolishly used the search function which returned no result. :/yx0ydyatp0z3.pnghttps://us.v-cdn.net/5019921/uploads/editor/wm/yx0ydyatp0z3.png" width="1600">


  • 9.  Passing shell variable to JCL variable

    Posted May 16, 2016 03:18 PM
    Hi Michael,

    The online doc search function has been fixed and it is showing up now.  Regarding this, have you been able to get it working?


  • 10.  Passing shell variable to JCL variable

    Posted May 18, 2016 09:47 AM
    Hi Luu,

    We've put this on the back-burner for a bit while we work on other aspects.  I'll likely pick it back up soon and will post results one way or the other.  Good to know that the search was broken and it wasn't just me. :)


  • 11.  Passing shell variable to JCL variable

    Posted Jun 06, 2016 04:43 AM
    I put together a short guide with examples of how to use :REGISTER_VARIABLE with Bash, Perl, Python, and PowerShell:
    :REGISTER_VARIABLE — practical examples with Bash, Perl, Python, and PowerShell


  • 12.  Passing shell variable to JCL variable

    Posted Mar 31, 2017 04:44 AM

    To solve this on a “quick-and-dirty” way on Unix/Linux platform:
    Shell variables could be captured indirectly from a temp file on the following way:
    ---
    - Unix JOBS Process Tab:

    echo $HOSTNAME > ./res.txt

    - Unix JOBS Post Process Tab:

    :SET &FILE# = PREP_PROCESS_FILE(LNX_V12_VWGSUP14,"/home/uc4/res.txt",,,,)
    :PROCESS &FILE#
    :   SET &LINE# = GET_PROCESS_LINE(&FILE#)
    :   PRINT &LINE#
    :ENDPROCESS
    ---
    The result is that the value of the shell variable $HOSTNAME is stored in the AE script variable &LINE#.