Another method for locating package entries for inclusion
in the viewer is name/value filtering. You can filter package entries
that are assigned an optional name/value pair when they are created
according to specified criteria. Entries that match are included in
the rendered view. Filtering is especially powerful for searching
large, nested packages.
In our example, we filter
for all entries that have a name/value pair of type=report and include
the matching entries in the viewer. In our fictitious package, one
HTML entry matches the name/value pair and so it is filtered for inclusion
in the viewer.
Here is the fourth section
from the sample template that inserts an HTML file (according to matched
criterion) into the viewer.
<!--Section 4: Filtering an Entry-->
<SASINSERT>
<h2>Message from the President</h2>
<SASREPEAT>
$(entry="(type=report)" attribute=stream)
</SASREPEAT>
</SASINSERT>
The ENTRY="(type=report)"
attribute filters all package entries that contain a
name/value pair of type=report. The
<SASREPEAT> open tag and
the
</SASREPEAT> closing
tag surround the search string in order to perform a repetitive search
for the name/value pair. Without this tag, the search would end after
the first match. In this example, only one HTML entry is matched.
This entry is substituted as an input stream to the HTML output.
The following SAS HTML
tags are used in this example:
This section of the
template is rendered for viewing in e-mail as follows:
Message from the President
AlphaliteAirways delivers service. AlphaliteAirways is the
recognized industry leader according to its safety
record, volume of passengers served, and number of
routes serviced.
How are we able to live up to such high expectations
consistently? First and foremost, we do it through the
abilities of our top salespeople. We owe a huge debt to
these hard-working individuals who actively pursue
revenue for this company.