Sending generated reports by email

About this task

Reports generated by running batch programs can optionally be sent to other users by email. If you want to use this facility, perform the following steps:
  1. On your computer, create a copy of the file SENDREPORT.MAC, available in the C:\Send Report Macro directory of the TEP Int Filewatch Feat Agent CD. Change the name, but keep the extension .MAC. You can create more than one copy of this file to suit your needs; each copy must have a different name.
  2. Copy this file into the installation path of the Personal Communications tool; for example: C:\Documents and Settings\Administrator\Application Data\IBM\Personal Communications
  3. Customize this file with all the following required parameters, as shown in the following example:
    [PCOMM SCRIPT HEADER]
    LANGUAGE=VBSCRIPT
    DESCRIPTION=MAIL
    [PCOMM SCRIPT SOURCE]
    autECLSession.SetConnectionByName(ThisSessionName)
    
    
    REM This line calls the macro subroutine
    subSub1_
    
    sub subSub1_()
       autECLSession.autECLOIA.WaitForAppAvailable
       
       autECLSession.autECLPS.SendKeys "[home]"
    
       ' uncomment the following line if you selected the option "Tab to action bar 
       ' choices" in the ISPF Settings panel
       ' autECLSession.autECLPS.SendKeys "[newline]"
    
    
       autECLSession.autECLPS.SendKeys "start"
       autECLSession.autECLPS.SendKeys "[enter]"
       
       autECLSession.autECLPS.SendKeys "6"
       autECLSession.autECLPS.SendKeys "[enter]"
    
       autECLSession.autECLXfer.ReceiveFile "outputfile", "'zOSreport'", "ASCII 
    	     CRLF NOCLEAR"
    
       autECLSession.autECLPS.SendKeys "swap"
       autECLSession.autECLPS.SendKeys "[enter]"
    
       Dim wsh
       Set wsh=CreateObject("WScript.Shell")
       wsh.Run "mailto:receiveremail" + "?Subject=emailsubject" + "&Body=emailtext"
            + "&attach=outputfile"  end sub
    where:
    outputfile
    Is the report file on your PC, for example, C:\audit.txt.
    zOSreport
    Is the z/OS® report you want to send, for example, TWS.AUDIT.LIST.
    receiveremail
    Is the email address you want to send the report to, for example, user@company.com.
    emailsubject
    Is the subject of your email, for example, Automatically%20sent%20by%20zOS.
    emailtext
    Is your email body text, for example, Received%20file%20from%20zOS%20and%20prepare%20the%20email%20with%20attachment.
  4. Send the report by using either the macro icon Start a macro in the Personal Communications toolbar or, from the Actions menu, by clicking Start Playing Macro/Script...
Attention:
  • When customizing the parameters, you cannot insert spaces, but must use the %20 sequence for every single space character, for example, Automatically%20sent%20by%20zOS.
  • The Command line at bottom option of Personal Communications is not supported.