Viewer Processing |
AlpineAirways Sales Force Briefing
John Smith 32 NE Gary DeStephano 20 SE Arthur Allen 40 MW Jean Forest 3 NW Tony Votta 30 SW Dakota Smith 3 HA
The viewer contains sections that format each package entry using the appropriate technique.
Here is the first section from the sample template that formats a single variable from a SAS data set into a list.
<!--Section 1: Formatting a Data Set Variable in an HTML List--> <SASINSERT> <h2>Congratulations!</h2> $(entry=1 attribute=description) <ul> <SASTABLE ENTRY=1> <li>$(VARIABLE=fname) </SASTABLE> </ul> </SASINSERT>The ENTRY=1 attribute is necessary to identify the SAS data set as the first entry in the package. The description attribute extracts the description of the package.
The <UL> HTML tag specifies an unordered list after which the <SASTABLE> tag with the ENTRY=1 option are necessary to identify the SAS data set as the first entry in the package. The <LI> HTML tag is used with variable substitution syntax to identify that the variable fname is to be extracted from the SAS data file and formatted as a list entry in the rendered view. Implicit in the <SASTABLE> construct is looping. Each observation in the data set is read and formatted until the end of file is reached.
The SAS HTML tags that are used in this example are
This section of the template is rendered for viewing in e-mail as follows:
Here is an example of a template that extracts three of four variables from a SAS data set into a table.
<!--Section 2: Formatting a SAS Data Set into a Table--> <SASINSERT> <h2>Record Sales from these Salespeople</h2> $(entry=1 attribute=description) <table border cellspacing=0 cellpadding=5 rules=groups> <thead> <tr> <th>First Name</th> <th>Last Name</th> <th>Territory</th> </tr> </thead> <tbody> <SASTABLE ENTRY=1> <tr> <td> $(Variable=fname)</td> <td> $(Variable=lname)</td> <td> $(Variable=territory)</td> </tr> </tbody> </SASTABLE> </table> </SASINSERT>The ENTRY=1 attribute is necessary to identify the SAS data set as the first entry in the package. The description attribute extracts the description of the entry from the package. Standard HTML table tags set up the tabular framework that defines a row with three columns of header text and accompanying tabular data. The <TD> tag is used with the variable substitution syntax to identify the following variables for extraction and insertion into the table: fname, lname, and territory. Implicit in the <SASTABLE> construct is looping. Each observation in the data set is read and formatted until the end of file is reached.
The SAS HTML tags that are used in this example are
This section of the template is rendered for viewing in e-mail as follows:
First Name | Last Name | Territory |
---|---|---|
John | Smith | NE |
Gary | DeStephano | SE |
Arthur | Allen | MW |
Jean | Forest | NW |
Tony | Votta | SW |
Dakota | Smith | HA |
Here is the third section from the sample template that inserts a text file and a reference URL into the viewer.
<!--Section 3: Inserting a Text File and a Reference URL--> <SASINSERT> <h2>Letter of Congratulations</h2> Below is a copy of the letter that was sent to each recipient of the top sales award. $(entry=2 attribute=stream) <p> See <a href="$(entry=3 attribute=stream)"> for detailed sales figures. </SASINSERT>The <H2> tag defines a descriptive heading for the text document and the reference URL. The ENTRY=2 attribute identifies the entry (a text document) to be substituted as an input stream to the HTML output. The ENTRY=3 attribute identifies the reference URL.
The SAS HTML tags that are used in this example are
This section of the template is rendered for viewing in e-mail as follows:
December 30, 2000 International Sales AlpineAirways Headquarters Dear AlpineAirways Salesperson, Congratulations on your much deserved recognition as outstanding salesperson for AlpineAirways for 2000. To express our gratitude for your excellent contribution, we wish to present you with 25 stock options in AlpineAirways. Wishing you continued success in your career with AlpineAirways. Sincerely, Alvin O. Taft, Jr. Director-in-Chief See http://www.AlpineAirways.com/headquarters/sales for detailed sales figures.
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 SAS HTML tags that are used in this example are
This section of the template is rendered for viewing in e-mail as follows:AlpineAirways delivers service. AlpineAirways 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.
Viewer Processing |