Automic Workload Automation

Expand all | Collapse all

How do I code prep process report to stop sending 4 email for the results.

  • 1.  How do I code prep process report to stop sending 4 email for the results.

    Posted Sep 09, 2016 12:59 PM

    Here is the code I have so far.  Every time I run the job it sends 4 different email for each line.  How can I combine the lines to get one email for all for line.

    :SET &MISSED# = PREP_PROCESS_REPORT(,,,"*failed*")
    :SET &EMAILBODY# = ""
    :SET &CRLF# = UC_CRLF()
    :SET &MSG1 = "Do not reply this is an unattened email."
    :PROCESS &MISSED#
    :  SET &LINE# = GET_PROCESS_LINE(&MISSED#)
    :  PRINT &LINE#
    :  SET &EMAILBODY# = STR_CAT(&EMAILBODY#, "&LINE#&CRLF#")
    :  SET &OUT# = SEND_MAIL('christopher.poullard@vizientinc.com',,'Backup Failure','&MSG1 &CRLF# &EMAILBODY#')

     



  • 2.  How do I code prep process report to stop sending 4 email for the results.
    Best Answer

    Posted Sep 09, 2016 02:15 PM
    It sends 4 email because it looks like there are 4 lines in your report (&MISSED#) that has the string *failed.
    Place the SEND_MAIL *outside* of the :PROCESS

    example:
    :PROCESS &MISSED#
    :SET &LINE# = GET_PROCESS_LINE(&MISSED#)
    :PRINT &LINE#
    :SET &EMAILBODY# = STR_CAT(&EMAILBODY#, "&LINE#&CRLF#")
    :ENDPROCESS
    :SET &OUT# = SEND_MAIL('christopher.poullard@vizientinc.com',,'Backup Failure','&MSG1 &CRLF# &EMAILBODY#')