Download Spool Converter User Guide

Transcript
Example:
CVTSPLPDF
FROMFILE(QSYSPRT)
EMAIL(*YES)
EMAILTO(*EMAILSQL)
EMAILSQL('select email from INVMST, CSTMST where INVMST.CUSTNO =
CSTMST.CUSTNO and INVMST.INVNO = ?' ('<:invoice_number:>'))
SPLIT(*POS)
SPLITPOS((5 9 7))
EXITPGM(*VAR)
EXITPGMPRM(*POS)
EXITPGMPOS((1 5 9 7 INVOICE_NUMBER))
Here, a spooled file called QSYSPRT (which contains a batch of invoices) is being
split into multiple PDFs every time the value on line 5 position 9 for 7 characters (the
invoice number) changes. The EXITPGM(*VAR) EXITPGMPRM(*POS) and
EXITPGMPOS parameters are being used to extract that same item of data from
page 1 of each split file and assigned the name “INVOICE_NUMBER”. That value is
then supplied as a variable to the SQL statement defined on the EMAILSQL
parameter and used to select the email address or addresses to which the PDF
should be sent.
CoolSpools Spool Converter User Guide V6R1
www.ariadnesoftware.co.uk
Page: 47