For batch output, a similar approach was used where the needed phone number or e-mail address is obtained at job submission time. Techniques to accomplish this were a bit more involved since this information is only needed when these new output destinations have been selected from the fixed job submission screen. Further, what is required for the two options is different. However, this was accomplished by the addition of several fields and a new copycode member to edit the inputs. Of course there are also JCL changes and new parameter assignments required.
For batch faxing, the phone number (with long distance authorization code) and recipient name are obtained by the job submission routine and assigned to JCL parameters. The normal output class, form number, and destination are pre assigned to A, 0053, and NETPRT respectively -- NetPrt's definition of the fax server. The batch job then executes the new program JOBFAXER which interprets the necessary parameters and outputs the fax header to the defined print DD. (The print DD and the landscape vs portrait option are fixed in the JCL since they will not vary for a specific batch output.) This is followed by the execution of the print generation program.
For online e-mailing, our list programs will now direct the output to the source work area and after the report is produced call UANESWA to solicit and edit the address, the name of the individual receiving the e-mail, and a subject line. These are pre filled with the user's e-mail address (if available from the User Profile/User file), name of the user (from the User file), and an optionally constructed subject line (via custom code).
For batch e-mailing, the e-mail address and name are obtained by the job submission routine and assigned to JCL parameters the same as for faxes. The modifications necessary to support this are the same as for faxes, with the addition of a CMWKF10 DD SYSOUT=(B,SMTP). Note that JOBFAXER is also used to accomplish this even though for faxes a header must be output first that precedes the report while for e-mail the report must be produced in the source work area and then post processed. This is accomplished by JOBFAXER inputting the report program ID, doing a Define Printer Output 'SOURCE', Fetch Returning the program ID, and then calling UANESWAF to output to work file 10 the e-mail headers followed by the report. Note: due to this technique the report program cannot contain a Define Printer statement and must direct its output to report (1).
IF #DEFINE-PRINTER-NAME = 'E-MAIL' /* Not allowed here
SET KEY PF12 NAMED ' '
END-IF
A default subject line should also be constructed at the end of the PRINT modifiable block. This can be done only when e-mailing is being performed and is accomplished by assigning a subject to the variable #PROMPT, something like the following:
IF #DEFINE-PRINTER-NAME = 'E-MAIL'
/* Build a subject line
MOVE EDITED LSK.DATE-PAYROLL(#NSM-X) (EM=LLL^DD',
'YYYY)
TO #PROMPT
COMPRESS #PROMPT
LSK.PAYROLL-TYPE(#NSM-X)
INTO #PROMPT
COMPRESS #PROMPT
'Earnings Statement'
INTO #PROMPT
END-IF
DEFINE DATA PARAMETER 1 #MD-FA (C) 1 #MI-FA (C) 1 #TV-FA (C) /* 06-02-00
3 #E-MAIL-ADDR-FAX-NO
(A40) /* 06-02-00
3 #E-MAIL-FAX-NAME
(A32) /* "
2 #EAFN-TAG
(A8) /* 06-02-00
2 #EFTN-TAG
(A8) /* "
2 #EF-CV
(C) /* "
Report output destination ID:&XXXXXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+XXXXXXXX&XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+XXXXXXXX&XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
INCLUDE UACRODFE
'MSE.#OUTPUT-DEST-ID'
'#REPORT-DEST-CLASS'
'#REPORT-DEST-FORM'
'#REPORT-DEST-NODE'
'#REPORT-DEST-ID'
'#OUTPUT-DEST-SHORT-DESC'
'''E-MAIL'''
'#EF-CV'
'#EAFN-TAG'
'#E-MAIL-ADDR-FAX-NO'
'#EFTN-TAG'
'#E-MAIL-FAX-NAME'
Note that the 7th parameter must be '''E-MAIL''' if e-mail output
is allowed, otherwise any other constant value should be used there.
DEFINE SUBROUTINE BUILD-EFAX-OUTPUT-DEST /* 06-02-00
* Output destination with E-Mail and Fax permitted, uses Parms
1-4
* and a portion of 16
RESET #JOB-PARMS(*)
COMPRESS 'FORMS-DEST=FORMS='
#REPORT-DEST-FORM
',DEST='''
#REPORT-DEST-NODE '.' #REPORT-DEST-ID ''''
INTO #JOB-PARMS(1) LEAVING NO SPACE
COMPRESS 'O-CLASS=' #REPORT-DEST-CLASS
#PARM-DELIMITER
'O-DEST-ID=' #OUTPUT-DEST-ID
INTO #JOB-PARMS(2) LEAVING NO SPACE
SEPARATE #E-MAIL-ADDR-FAX-NO /* Parse out any fax
authorization code
INTO #JOB-PARMS(3) REMAINDER #JOB-PARMS(16)
WITH DELIMITER ','
IF #JOB-PARMS(3) = ' '
#JOB-PARMS(3) := 'N/A'
END-IF
COMPRESS 'TO-ADDR-NO=' #JOB-PARMS(3)
INTO #JOB-PARMS(3) LEAVING NO SPACE
COMPRESS 'AUTH-CD=' #JOB-PARMS(16) /* In 16 so it
is not logged
INTO #JOB-PARMS(16) LEAVING NO SPACE
IF #E-MAIL-FAX-NAME = ' '
#JOB-PARMS(4) := 'TO-NAME=N/A'
ELSE
COMPRESS 'TO-NAME=' #E-MAIL-FAX-NAME
INTO #JOB-PARMS(4) LEAVING NO SPACE
END-IF
END-SUBROUTINE
This routine should be performed once the user has committed to submit
the job, and will replace routine BUILD-OUTPUT-DEST which has typically
been used. Note that this routine utilizes the first four parms (and
16), and thus will require adjustment to the other job parameter assignments
(Build-Output-Dest used only the first two) made for the specific job --
you will need to start assigning parameter values in the 5th occurrence.
%L
JOBFAXER
[JOB-SEQ-NO],[O-DEST-ID],CMPRT0n,l
[TO-ADDR-NO],[AUTH-CD]
[TO-NAME]
xxBrptpgm
On the third line, two items require customization. The CMPRT0n
should be changed to match the report number on which the report is generated
(1 - 9). The lowercase l represents the landscape option for
fax output only. It should be left blank for portrait output or any
non-blank value will result in landscape output.
//NATBAT.CMWKF10 DD SYSOUT=(B,SMTP) -- 06-02-00
The length/size of the report is a major consideration for either fax or e-mail output. Faxing a large report will take considerable time, tieing up the fax server and the recepients fax machine. If it fails mid-way for any reason, multiple attempts will likely occurr to get it transmitted. E-mail output is restricted to the size of the source work area, if not by other e-mail constraints that might be applied on the sending or the receiving system. Though a specific limit is not known for either of these options, it is suggested that some screening or reasonableness check be applied before permitting use of these options.
Management of the fax server is an unknown. Testing has indicated that given valid numbers the above processes work reliably. However, if incorrect fax numbers are provided or other unknown problems arise it will likely be difficult to track down the problem since management of the fax server (and NetPrt) is out of our hands. Fax at your own risk.
Similarly, bad e-mail addresses and other system mal-functions will result in undelivered e-mail. The user's e-mail address as defined on the User Profile is used as the sender (or BASIS@comp.uark.edu if none exist on the User Profile), so the e-mail should be returned their if undeliverable (and if that sending address actually exists). Needless to say, tracking down delivery problems will be an on-going task as it is with print output.