Automic Workload Automation

  • 1.  Can I include the whole object report in the body of an email notification?

    Posted May 08, 2019 01:26 PM

    I have a WIN job that runs some powershell code and returns the following in the report that I want to include in the body of an email notification.

     

    File Name: E:\shares\CSIportal\UL\AgVStatements20190506.TXT

    Record Count: 1

    Line Count: 46

    Date Created: 05/07/2019 14:40:28

    Date Modified: 05/06/2019 22:50:10

    File Size: 1070

     

    I thought the following code would return the whole report if I put the variable in the body of the message but all I got was the last line of the report. Is there a way to include the whole report in the body of the message?

     

    :SET &RUNID#           = 1327133
    :SET &H_REPORT#        = PREP_PROCESS_REPORT(,&RUNID#, "REP")
    :PROCESS &H_REPORT#
    :   SET &R_FILE#      = GET_PROCESS_LINE(&H_REPORT#)
    :ENDPROCESS



  • 2.  Re: Can I include the whole object report in the body of an email notification?

    Posted May 09, 2019 07:24 AM

    Dear Jason,

    The PROCESS - ENDPROCESS-Block is actually a loop on the lines of the report. That's why you get only the last line in your email body.

    Use an ARRAY Variable instead, so you can put each line into a separate array element with incementing the index number in the loop. You should find all you need in the documentation searching for ARRAY.

    There is also a command named :FILL, this fills the Array without handling the index:

    :PROCESS &HND#
    :FILL &ARRAY#[] = GET_PROCESS_LINE(&HND#)

    :ENDPROCESS

     

    I hope this helps.

    Regards, Nicole



  • 3.  Re: Can I include the whole object report in the body of an email notification?

    Posted May 09, 2019 02:19 PM

    Hi

    the easiest way is using the prep_process_report() script funtion in a CALL object.

    within the : Process clause you can use :PUT_ATT_APPEND CALL_TEXT = to put the text line into the mail body.

     

    within the post_process of the job you can use activate_uc_object89 to start the CALL object and pass the Job's runid to the call. Another way would be using the predifined variable &$ACTIVATOR_RUNID# within the call object.

     

    Instead of using activate_uc_object() you can put the jobs and the call into a workflow and pass the runid to the call.

     

    cheers, Wolfgang



  • 4.  Re: Can I include the whole object report in the body of an email notification?

    Posted May 22, 2019 04:46 AM

    Hi,

    you can also use e. g.

     

    :set &nl# = UC_CRLF()

    :set &newline# = ""

    :SET &RUNID#           = 1327133
    :SET &H_REPORT#        = PREP_PROCESS_REPORT(,&RUNID#, "REP")
    :PROCESS &H_REPORT#
    :   SET &R_FILE#      = GET_PROCESS_LINE(&H_REPORT#)

    :  set &newline# = "&newline#&nl#&R_FILE#"
    :ENDPROCESS

     

    in case of using activate_uc_object() you can use pset oder put_read_buf to pass &newline# to your mail object.

     

    Thx & rgds

    Christian