Inserting Banner Pages

A banner page is a page that separates one document from another on a printer. They are sometimes called separator pages. Banner pages are not considered part of any document in the print stream. You can use Enrichment to add banner pages before or after your documents by adding a Banner tag group in the control file to define the pages and using the <BANNER> command in your rules to control the placement of the pages.

Note: The banner pages themselves are not created by Enrichment. They must be created by another program in a format consistent with the print streams to which they are added.

To insert banner pages:

  1. Create a control file. For more information, see Developing a Control File.
  2. In the control file, create a Banner tag group to define the banner.
  3. In the Banner tag group, create a <NAME> tag to define the name to be used when referring to this banner in the control file.
  4. In the Banner tag group, create a <FILE> tag to specify that file that contains the banner.

    For more information about the <FILE> tag, see the Enrichment Language Reference Guide.

  5. In the Banner tag group, create a <TYPE> tag to specify the banner's print stream type (such as AFPDS, Impact, DJDE).
  6. If the banner contains inline variables that you want to replace with values, create a <SUBSTITUTE> tag in the Banner tag group.

    For example, if you needed to create the banner shown below and you wanted to replace the text %%State with the actual state, you would specify <SUBSTITUTE>Y. You would also need to define a field called %%State (using the <FIELD> tag) that would contain the actual state extracted from the print stream.

  7. Because banner pages are not considered part of any other document, they normally are not processed or included in page and document counts. You can control how Enrichment processes banners by setting the Banner group <ALLOW> tag.
    ***************************
    ***************************
    *                         *
    *                         *
    *                         *
    *        %%State          *
    *                         *
    *                         *
    *                         *
    ***************************
    ***************************
  8. Create a Rule tag group in the control file.
  9. Determine where you want to insert the banner page.

    For example, you may want to insert a banner page whenever the state in the mailing address changes.

  10. Create the appropriate Rule logic to insert the banner at the place in the print stream where you want it. To insert the banner use the <BANNER> print stream command. For more information see the Enrichment Language Reference Guide.
    Note: The <BANNER> print stream command is different from the Banner tag group.
    Note: Always specify the <OUTPUT> command before the <BANNER> command in the rules unless there is only one Output tag group.

    The following is an example Rule that inserts a banner whenever the state changes.

    <rule>
       <content>
          PRESORTED:
          if CHANGED(%%State) then
            <banner> StateCover BEFORE
          endif
       </content>
    </rule>

Example

The following example inserts a banner page. The banner page contains a variable for the department which is filled in with the appropriate department name extracted from the document.

<input>
   <name> INPUT                     <! Identifiable name.            >
   <file> DD:INPUT                  <! Input file name.              >
   <type> AFPL A       <! AFP Line data with ASCII carriage controls.>
   <doc> T %%AcctNum CHANGE           <! New document when Account   >
                                      <! number changes.             >
   <field> %%AcctNum KA               <! Find account number. Must   >
     <ref> ' ' 'Account Number:' 44   <!  reference because address  >
     <loc> 0 2 8                      <!  is not always on same line >
   </field>
   <field> %%Dept K                   <! Find department on line 3,  >
     <loc> 3 9 3                      <!  column 9, length 3 on first>
   </field>                           <!  page of each document.     >
</input>
<rule>
   <content>
    PRESORTED:
    <!   Write a banner page each time the department changes. Set  >
    <!   the name of output file to include the sequential number.  >
    if CHANGED(%%Dept) then
       <banner> DEPTCover BEFORE
       %%DSN = "'D966DZB.HANDSON.NEW" | DATE(J) | ".DPT" | %%Dept | "'"
       <filebreak>
    endif
    <output> Output1
   </content>
</rule>
<banner>
   <name> DEPTCover
   <type> I A 
   <content>1
       Department %%Dept
   </content>
   <substitute> YES
</banner>
<output>
   <name> Output1                 <! Identifiable name.              >
   <dynafile> %%DSN
   <allocate> SYSDA 1 1 TRKS VB 8204 27998
   <filemax> M
   <presort>                      <! Perform system sort.            >
      <pretype> NONE              <! Not LPC or Group1, but other.   >
      <file> DD:INPUTA       <! Indexed sort key file for processing.>
      <sortpart> %%DOCINDEX 8 L ' ' <! Document index system variable>
      <sortpart> %%Dept 3 L ' '     <! Department                    >
      <sortpart> %%TOTAL_PAGES 3 R 0 <! Total pages system variable  >
      <sortpart> %%AcctNum 8 L ' ' <! Account number                 >
   <step> SORT 0 ' SORT FIELDS=(9,3,A,12,3,A,15,8,A),FORMAT=BI,EQUALS
                      OPTION SORTIN=INPUTA,SORTOUT=OUTA'
      <outfile1> DD:OUTA 22         <! Sorted output file.           >
      <indexcol> 1                  <! Document index in column 1.   >
   </presort>
</output>