Skip to main content

IBM Software Technical Document

_______________________________________________________________
Hide details for       Document Information Document Information

Document Number:25631207
Functional Area: Print
Subfunctional Area: InfoPrint Server for iSeries
Sub-Subfunctional Area: General
OS/400 Release:V5R1M0; V5R2M0; V5R3M0; V5R4M0
Product: IBM INFOPRINT SVR FOR ISERIES (5722IP100)
Product Release:N/A


_______________________________________________________________

Document Title
Using STRPAGGRP DDS with Infoprint Server Mail Function

Document Description
The Infoprint Server for iSeries product contains a function that allows you to e-mail a pdf file. The following methods can be used to specify the recipient of the e-mail:
oUse the USRDFNDTA field of the printer file to specify a MAILTAG. This method is documented in the Infoprint Server for iSeries User's Guide.
oGroup pages of the spooled file together, and send a group of pages to an e-mail address. To do this, use the STRPAGGRP and ENDPAGGRP DDS keywords.
An example of using the STRPAGGRP and ENDPAGGRP DDS keywords follows. The capitalized words are DDS keywords:

STRPAGGRP('userone@address.net')
User data
ENDPAGE
User data.
ENDPAGGRP
ENDPAGE
STRPAGGRP('usertwo@address2.net')
User data
ENDPAGGRP
ENDPAGE

Following are some hints for using the above DDS keywords:
oSTRPAGGRP must be issued on page boundary.
oFor each STRPAGGRP, an ENDPAGGRP must be paired with it.
oENDPAGGRP must precede the ENDPAGE (or other means used to skip to new page). A record can have both ENDPAGGRP and ENDPAGE on the same record. However, the record cannot have constant text defined if the record has ENDPAGE on it.
oIf any spooled file pages are not covered by STRPAGGRP/ENDPAGGRP and there is not a MAILTAG in the USRDFNDTA field of the spooled file attributes, the pages will not be emailed.
oIf there is an exit program specified on the CRTPSFCFG, the data on the STRPAGGRP does not have to be an e-mail address. It can be an e-mail tag (a customer name, for example) that is used as a key by the exit program to retrieve the real email address. IBM® Print Services Facility™/400 passes the e-mail tag to the exit program and the exit program returns the real e-mail address. Therefore, if an e-mail address changes, you do not have to update the DDS application; but, you would have to modify the exit program. If you do not want to use an exit program, provide a real e-mail address on the STRPAGGRP keyword.
oThe example above implies that you would have multiple records in the DDS, each with its own e-mail address as the parameter of the STRPAGGRP keyword on the record. Actually, one record with a program-system field name as the parameter of the keyword is how you would probably use it. Refer to the DDS Reference manual for the syntax of the STRPAGGRP keyword and the use of the program-system field as the parameter.
The following provides more information on how to get the e-mail address from a program. You can provide a real e-mail address in the STRPAGGRP DDS; this way you would not need an exit program.

A couple of programming ideas follow. However, these ideas have not been tested and are provided as is. They assume the use of STRPAGGRP with the program-system field as the keyword parameter. See the V5R1 DDS Reference manual for the proper syntax and the proper coding of the program-system field in the DDS. The program-system field is defined in the same record which also has the STRPAGGRP keyword at the record level. In the application, try the following:

Assume the following DDS records:
         
     A          R REC1                      STRPAGGRP(&GROUP)
     A            GROUP        50A  P
     A*
     A          R REC2                      ENDPAGGRP ENDPAGE

             GROUP = 'someaddr@xyz.net'
              Write REC1.
              Write the printable data for the page.
              Write REC2.  
              GROUP = 'differentaddr@xyz.net'
              Write REC1
              Write some printable data for the next page.
              Write REC2    

Or, using department as an example, have an array filled with records that associate an email address with a numeric value:

Email@(1) = 'someaddr@xyz.net'
             
Email@(2) = 'anotheraddr@xyz.net'

Then, the exit program might perform a function similar to the following:

DO dept# = 1 to number of departments
                 GROUP = Email@(dept#)          /* dept# is an array subscript in this statement */
                 Write REC1
                  Write the data pertaining to this department
                  Write REC2   /* has ENDPAGGRP and ENDPAGE  */
            ENDDO

The following Web site contains the Infoprint Server for iSeries User's Guide:

http://publibfp.boulder.ibm.com/epubs/pdf/54457755.pdf



__________________________________________________________________
PMR Number:
Related APARs:
Related Public Documents:

    IBM disclaims all warranties, whether express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. By furnishing this document, IBM grants no licenses to any related patents or copyrights. Copyright © 1996,1997,1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 IBM Corporation. Any trademarks and product or brand names referenced in this document are the property of their respective owners. Consult the Terms of use link for trademark information.