There are various system APIs available to help in this area. A general overview of what is available can be found in the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/print1.htm”>i5/OS Information Center</a>.
Some of the system support is directly targeted to the e-mailing of spooled files and/or <i>subsets</i> of spooled files. One example is <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/xpsf400email.htm”>the Mapping Exit Program</a>support which allows you to route/distribute a report (along with attributes such as subject, encryption, etc). This relies however upon information in the spool file to direct the system processing. In the case of this exit and sending <i>subsets</i> of the spool file, the use of the DDS keyword STRPAGGRP (or similiar support) is needed. If you wanted the <i>entire</i> spool file sent, the USRDFNDTA attribute of the print file could be used, but that isn’t your current request.
To take an arbitrary spooled file and then parse it with the result being individual statements to be e-mailed you are most likely looking at having to supply your own processing program. The alternative would be modifying the program and print file currently being used to generate your debtor statements such that PSF/400 can recognize the individual debtor statements.
I hope this helps,