Automic Workload Automation

  • 1.  Getting a value from job report to populate variable

    Posted May 26, 2018 02:33 PM

    I need to get a value (Batch Number = ??) out of the automic job report and have that value populate a variable where such variable can then be called in the next job as an input value for a modified run control to automatically update a peoplesoft run control. I've figured out the peoplesoft piece, but I need help with automic scripting to get the value. The value of the "Batch Number" does not grow by any certain increment, it will be a different number each run. 

     

    This is what the report looks like. The Batch Number value is what I need - in this instance it would be 55:

     

    psae -CT ORACLE -CD ICSSTG -CO "PRDSVSYS" -CP OPRPSWD -R SFD_ARCHIVE_CUCALMSG -I 59540425 -AI PSARCHIVE -OT 6 -FP "/opt/pscfg/icsstg/appserv/prcs/icsstg/log_output/AE_PSARCHIVE_59540425/" -OF 14
    Normal end, status=9, retcode=0, sessionid=24235
    started: 2018-05-26-11.55.06.460958, ended: 2018-05-26-12.24.32.675895
    2018-05-26-11.55.06.531236: Begin PSARCHIVE
    2018-05-26-11.55.06.993631: Archive ID = CUCALMSG, Archive Process = S, Batch Number = 55, Query = U8_ARC_CALC_MESSAGE, Audit Row = , Restart = N
    2018-05-26-11.55.08.631348: Processing CALC_MESSAGES



  • 2.  Re: Getting a value from job report to populate variable
    Best Answer

    Posted Jun 07, 2018 10:38 AM

    Got this all figured out. Added post processing to the job that generates the batch number. The post processing finds the report line with the word "Batch Number", then sorts that line by columns and returns the value of the column. That column includes the string "Batch Number = ?, so then I did a substring to remove the 17 characters that precede the actual batch number value. The substring result isolates that batch number which then populates the variable that I call in the next jobs that need their Peoplesoft run control updated automatically.

     

    Post Process:

    :SET &LINE# = PREP_PROCESS_REPORT(,,,'*Batch Number*', "COL=DELIMITER", "DELIMITER=','")
    :PROCESS &LINE#
    : SET &RET# = GET_PROCESS_LINE (&LINE#,3)
    : PRINT &RET#
    : SET &VALUE# = SUBSTR(&RET#,17,)
    : PRINT &VALUE#
    : PUT_VAR BATCH_NUMBER,"ARCHIVE_DATE", "&VALUE#"
    :ENDPROCESS
    : CLOSE_PROCESS &LINE#

     

    Returns this in the post process report:

    2018-06-06 12:52:15 - U00020408 Batch Number = 102
    2018-06-06 12:52:15 - U00020408 102

     

    Preprocess of next jobs that pulls in variable value:

     

    : SET &VALUE# = GET_VAR("BATCH_NUMBER","ARCHIVE_DATE")
    : SET &nmb = &VALUE#