Web Development With Sas By Example 2nd Ed Frederick E Pratter
Web Development With Sas By Example 2nd Ed Frederick E Pratter
Web Development With Sas By Example 2nd Ed Frederick E Pratter
Web Development With Sas By Example 2nd Ed Frederick E Pratter
1. Web Development With Sas By Example 2nd Ed
Frederick E Pratter download
https://ebookbell.com/product/web-development-with-sas-by-
example-2nd-ed-frederick-e-pratter-928798
Explore and download more ebooks at ebookbell.com
2. Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Web Development With Sas By Example Frederick E Pratter Sas Institute
https://ebookbell.com/product/web-development-with-sas-by-example-
frederick-e-pratter-sas-institute-4109736
Web Development With Blazor An Indepth Practical Guide For Net
Developers To Build Interactive Uis With C 2nd Edition 2nd Jimmy
Engstrm Engstrom
https://ebookbell.com/product/web-development-with-blazor-an-indepth-
practical-guide-for-net-developers-to-build-interactive-uis-
with-c-2nd-edition-2nd-jimmy-engstrm-engstrom-48223998
Web Development With Django A Definitive Guide To Building Modern
Python Web Applications Using Django 4 2nd Edition 2nd Ben Shaw
https://ebookbell.com/product/web-development-with-django-a-
definitive-guide-to-building-modern-python-web-applications-using-
django-4-2nd-edition-2nd-ben-shaw-50310894
Web Development With Django Cookbook 2nd Edition Aidas Bendoraitis
https://ebookbell.com/product/web-development-with-django-
cookbook-2nd-edition-aidas-bendoraitis-52556304
3. Web Development With Node And Express Leveraging The Javascript Stack
Ethan Brown
https://ebookbell.com/product/web-development-with-node-and-express-
leveraging-the-javascript-stack-ethan-brown-52556926
Web Development With Java Using Hibernate Jsps And Servlets Tim Downey
https://ebookbell.com/product/web-development-with-java-using-
hibernate-jsps-and-servlets-tim-downey-2108836
Web Development With Node And Express Leveraging The Javascript Stack
Brown
https://ebookbell.com/product/web-development-with-node-and-express-
leveraging-the-javascript-stack-brown-22034670
Web Development With Django Ben Shaw Saurabh Badhwar Andrew Bird
https://ebookbell.com/product/web-development-with-django-ben-shaw-
saurabh-badhwar-andrew-bird-23628068
Web Development With Clojure Build Large Maintainable Web Applications
Interactively 3rd Edition Dmitri Sotnikov
https://ebookbell.com/product/web-development-with-clojure-build-
large-maintainable-web-applications-interactively-3rd-edition-dmitri-
sotnikov-23668992
8. Contents
Preface ix
Acknowledgments xiii
Part 1 Getting Started with Web
Programming
Chapter 1 SAS and the Internet 3
Introduction 3
TCP/IP and the Internet 5
Markup Languages 7
Deploying Content on the Web Server 8
Using the Apache Web Server on Windows 10
Using the Apache Web Server on UNIX/Linux 11
Using Microsoft Internet Information Server 12
References 12
Chapter 2 Introduction to HTML 15
Hypertext Markup Language 15
HTML vs. XHTML 19
Formatting HTML Using Style Sheets 22
Including User-supplied Information with Forms 25
References 29
Chapter 3 Creating Static HTML Output 31
Introduction 31
Creating Static HTML Output with SAS Tools 34
Displaying Preformatted Text 34
DATA Step Programming for Web Output 36
Macros for HTML Formatting 38
Using the Output Delivery System to Create HTML 48
The ODS HTML Statement in SAS
®
9 53
Creating Multiple Pages with a Single Program 54
Creating a Table of Contents for Procedure Output 57
Listing the Contents of a Data Set 59
Using Styles to Format ODS Output 60
Using the ODS Markup Statement to Create XHTML 64
PROC TEMPLATE: Not Just for Geeks Anymore 67
References 70
9. iv Contents
Part 2 Access to SAS with SAS/IntrNet
Software
Chapter 4 Remote Access to SAS 75
Client/Server Computing 75
Remote Data Services with SAS/SHARE 77
Editing the TCP Services File 77
Configuring TCP Security 78
Starting and Stopping the SAS/SHARE Server 79
Managing SAS/SHARE as a Windows Service 81
SAS AppDev Studio Service Manager 83
Managing Servers with SAS Management Console 83
Access to Remote Library Services 84
Remote SQL Pass-Through (RSPT) 85
Remote Compute Services with SAS/CONNECT 86
Distributed Computing with the Integrated Object Model 89
References 90
Chapter 5 Web Applications Programming 91
Server-Side or Client-Side? 91
The Common Gateway Interface 92
A CGI Example 94
Passing Parameter Values to Web Applications 96
References 100
Chapter 6 SAS/IntrNet: the Application Dispatcher 101
Overview 101
Installing the Application Broker 102
Creating an Application Dispatcher Service 106
Defining an Application Dispatcher Service for UNIX or
Linux 106
Defining an Application Dispatcher Service for
Windows 108
Configuring the Default Application Service 109
Starting and Stopping the Application Server 110
Testing the Application Service 112
Defining Application Server Libraries 117
Debugging SAS Output 119
Generating Dynamic Output with the Output Delivery System 122
References 125
10. Contents v
Chapter 7 SAS/IntrNet: htmSQL 127
SAS/IntrNet Data Services 127
htmSQL Directives 128
Generating Tables with htmSQL 130
Creating Forms with htmSQL 133
Issues with CGI Applications 134
References 135
Part 3 Server-Side Java Programming
Chapter 8 Java Servlets and JavaServer Pages 139
Introduction 140
Java Servlets 140
A Hill of Beans 141
Servlet Example 142
Deploying Servlets 144
Creating a JavaServer Page 145
Scripting Elements 146
Predefined Variables 147
A Simple JSP Example 149
JSP Custom Tag Libraries 151
Tag Handlers 151
Tag Library Descriptors 152
JSP with Custom Tags 153
Deploying Tag Libraries 154
Database Access Using JDBC and JavaServer Pages 154
JDBC Overview 154
Using SQL with JSP Custom Tags 157
Web Archive Files 163
Building a Web Archive File 164
Web Application Manager 164
References 166
11. vi Contents
Chapter 9 Developing Java Server-Side Applications with
webAF Software 169
Getting Started with webAF Software 170
Installing SAS AppDev Studio 171
The webAF Integrated Development Environment 173
Creating a JSP Project 176
A Simple JSP Example 182
Building Forms with webAF Software 183
Creating a New JavaServer Page 184
Adding Styles to JavaServer Pages 185
Writing the Java Scriptlet 185
Building the XHTML Form 186
Attributes and Models 190
Connecting to SAS Data 192
Registering Connections 193
Using the Model-View-Controller Architecture in
webAF Software 195
Modifying the Controller Servlet 197
Creating the JavaServer Page 198
Testing the Application 198
Deploying the Web Application 200
Using SAS Remote Compute Services 201
Remote Computing Using SubmitInterface 201
Using the DataSetInfo Interface 204
Using the DataBeanWizard 209
Conclusion 211
References 211
Part 4 SAS Integration Technologies
Chapter 10 Using the SAS Open Metadata Architecture
with the Integrated Object Model 215
Overview: SAS Integration Technologies 215
The Integrated Object Model 216
IOM Servers 218
The SAS Metadata Server 220
The SAS Workspace Server 220
The SAS Stored Process Server 221
IOM Client Applications 222
Windows Client Interface – Visual Basic Example 222
Visual C++ Interface 225
Java Client Interface 226
12. Contents vii
Conclusion 230
References 230
Chapter 11 Building Web Applications with SAS
and Java 233
Overview: Java Web Applications and SAS Stored Processes 234
Using the SAS Stored Process Web Application as a
Replacement for SAS/IntrNet 235
The SAS Stored Process Web Application 235
Installing the SAS Web Infrastructure Kit 235
Configuring the Server 239
High-Level Overview of the Steps 240
Using SAS Stored Processes 242
Creating a Stored Process Repository with SAS Management
Console 9.1 242
Using the Java Foundation Services Stored Process Service 251
Managing Configuration Issues 251
Creating a SAS Stored Process Web Application with
Foundation Services 251
Deploying a SAS Stored Process Web Application 256
Conclusion 258
References 258
Part 5 Appendixes
Appendix A DHTML: Dynamic Programming on the Web
Client with JavaScript 261
Appendix B Client-Side Programming with Java
Applets 269
Using Java Applets 269
Getting Into the Swing 274
Getting Plugged In 277
Creating Java Applets with webAF Software 279
A Simple Applet Example 279
Creating a New Applet in webAF Software 281
The webAF Code Generator 286
Access to Remote Data with webAF Software 289
Access to Remote Data 290
13. viii Contents
Java Security 292
Under the Hood: Deploying the Resulting Web Page 294
Using the Package Wizard to Deploy Applets 295
Appendix C SAS/IntrNet: Design-Time Controls 297
Introduction 297
Installing and Configuring the Design-Time Controls 299
Adding a SAS Table to an HTML Page 301
Microsoft FrontPage 301
Macromedia Dreamweaver 307
webAF Software 308
Adding Dynamic SAS Content with the Design-Time Controls 310
Embedding DTC in a JavaServer Page 310
Embedding DTC in an Active Server Page 311
References 312
Appendix D Online Analytic Processing with webEIS
Software 313
Introduction 313
Creating a webEIS Document 314
Creating a webEIS Connection 315
Creating a webEIS Table 316
Displaying webEIS Documents 321
Applets 322
JavaServer Pages 324
Additional webEIS Controls 325
Index 329
14. Preface
SAS Web Technologies provide a comprehensive set of tools for creating and deploying Web
applications. This book is an attempt to bring together in one volume a set of examples to
illustrate the major issues in Web development, using the tools available from SAS as the building
blocks. It is intended both as a general introduction to Web programming and a guide to using
SAS Web tools. As such, it is aimed at least three different audiences.
The first group includes experienced SAS users who want to get started delivering content on the
Web. These are the attendees at SUGI and the regional conferences who fill lecture rooms and
workshops for sessions with SAS/IntrNet, SAS Integration Technologies or SAS AppDev Studio
in the title. The second, complementary group includes of Web developers who are interested in
access to SAS data and who appreciate the ease and simplicity of the solutions SAS has provided.
The third group includes those project managers, students, and others who want to learn about
Web development and who are not well served by the current proliferation of specialized texts.
Clearly it is not possible to cover this entire topic comprehensively in a reasonably sized volume.
On the other hand, introductory users are often baffled by the wide variety of options available
and the blizzard of confusing Web terminology.
This book, then, attempts to achieve two goals: first, to organize the options for Web
programming into an understandable framework, and second, to show how the available SAS
tools fit into this framework. The strength of SAS is its ability to make difficult data analysis and
presentation tasks straightforward, if not simple. With SAS Web Technologies, users can leverage
their substantive experience without having to learn a whole new specialized set of tools. In
addition, the full power of SAS is available for data exploration, analysis, and reporting.
A Note to the Reader
A new version of SAS AppDev Studio (3.2) is planned for release later in 2006. The webAF and
webEIS components will be going away in the new version of SAS AppDev Studio; instead SAS
is moving to Eclipse, an industry standard, open source development platform (see
http://www.eclipse.org/ for more information). Since many of the examples in this volume use
webAF, initially SAS Press considered delaying the new edition a year or so to update it with the
new version of SAS AppDev Studio. Finally, however, the benefits to users from getting the book
out as scheduled outweighed the disadvantages, so it was decided to proceed as planned. The
material covered in this volume is up-to-date for SAS 9.1.3 and SAS AppDev Studio 3.1.4, and it
should serve as a comprehensive introduction to SAS Web Technologies as of the date of
publication. The good news is that plans for the third edition are in the works.
What Is Covered in This Book: Changes in the 2nd
Edition
Every example in the book has been reviewed to make sure it works with the most recent versions
of the software. All of the material from the first edition is still included, though discussion of
some of the deprecated products has been moved to the appendixes. In addition, a substantial
amount of new material has been added—in particular, an entirely new section on features
introduced or enhanced in SAS 9.1.
15. x Preface
In general, this book covers four main topics:
ƒ getting started with Web programming, including using the Output Delivery System to
create static HTML content
ƒ programming with SAS/IntrNet using the Application Dispatcher and htmSQL
ƒ programming with Java and SAS AppDev Studio
ƒ SAS Integration Technologies and the SAS Open Metadata Architecture
There are specific SAS components for each of these functions; each is described in some detail
in the chapters that follow. The focus, however, is not on the specific products, but rather on
examples of commonly (or uncommonly) performed Web development tasks and how these are
supported by SAS.
The approach throughout is progressive. Part 1 begins with a general introduction to Web
programming and the Internet protocols. The remaining chapters of the first part include a simple
HTML tutorial and a description of SAS support for static HTML pages using ODS, the SAS
Output Delivery System. Readers who are already familiar with Web programming in general and
HTML can skip straight to the discussion of ODS in Chapter 3, “Creating Static HTML Output.”
Part 2 covers server-side applications programming using the Common Gateway Interface (CGI)
and Java. The first chapter in this part is a discussion of how to connect to a remote SAS data
server using the SAS/SHARE and SAS/CONNECT components. Many of the subsequent
examples require a connection to a SAS server; this chapter has been included as an aid for Web
developers who are not familiar with these products. In addition, the SAS/CONNECT driver for
Java provides the Java classes that communicate with a SAS/CONNECT server, while the
SAS/SHARE driver for JDBC enables you to access and update SAS data through Java programs
that access a SAS/SHARE server.
Chapter 5, “Web Applications Programming,” includes some simple Perl programming examples
and may be useful to those who are interested in learning about CGI in general. The remainder of
this part covers the two main technologies included in the SAS/IntrNet product: the Application
Dispatcher and htmSQL.
Part 3 explains how to use Java to create dynamic applications using Java servlets, JavaServer
Pages (JSP) and custom tag libraries. The focus is primarily on using webAF software to create
JSP.
Part 4 has been added to introduce the new SAS Open Metadata Architecture, the Integrated
Object Model (IOM), and the use of SAS Stored Processes to build Web applications. The new
SAS BI component, SAS Enterprise Guide, can be used to create and test stored processes.
Part 5, the appendixes, covers a variety of topics that in general represent older approaches that
either have been superseded by the methods described in the body of this book, or else (as is the
case with the Design-Time Controls) have specific, narrowly defined functions. These topics
include the following:
ƒ client-side dynamic Web content with DHTML and JavaScript
ƒ Java Applets
ƒ SAS Design-Time Controls, used with third-party HTML editors to provide SAS
connectivity
ƒ webEIS software for generating OLAP reports
16. Preface xi
As should be obvious from this brief introduction, SAS Web Technologies provide an extremely
powerful and flexible collection of tools for Web development. There are also a lot of moving
parts, and new functionality is being added on an ongoing basis. The goal of this volume is to try
to put all of the pieces together in a systematic overview, so that both novice and experienced
Web programmers can find the information and examples they need to get started using these
tools effectively.
What is Not Covered in This Book
In addition to the products previously described, a number of important Web technologies not
covered in this book are included with the SAS Enterprise BI Server suite (see
http://support.sas.com/news/feature/04dec/biserver.html for a more information about these
components).
Documentation for these components is available on the SAS Web site:
1
ƒ SAS Add-In for Microsoft Office – provides to access to SAS directly from Microsoft
Office via integrated menus and toolbars
(http://www.sas.com/technologies/bi/query_reporting/addin/)
ƒ SAS Web Report Studio – provides query and reporting capabilities on the Web
(http://www.sas.com/technologies/bi/query_reporting/webreportstudio/)
ƒ SAS Information Delivery Portal – provides a single access point for aggregated
information (http://www.sas.com/technologies/bi/content_delivery/portal/)
ƒ SAS Information Map Studio – creates information maps to expedite access to
organizational data
(http://www.sas.com/technologies/bi/query_reporting/infomapstudio/)
ƒ The SAS Web OLAP Viewer for Java – provides a Web interface for viewing and
exploring OLAP data
(http://www.sas.com/technologies/bi/query_reporting/webolapviewer/)
The SAS Web Report Viewer and the Visual Data Explorer are client tools that are available
separately, but which require the BI Architecture on the server. SAS Press currently has a “BI
Cookbook” under development that will cover the BI components in detail; this book focuses on
the tools included with SAS AppDev Studio, SAS/IntrNet software, and SAS Integration
Technologies, along with Base SAS software components such as ODS and the HTML formatting
macros.
A Note on the Examples
All of the examples in this book were created using resources that are generally available. The
data sets SASHELP.SHOES, SASHELP.RETAIL and SASHELP.PRDSALES, used for many of
the sample programs, are all included with the basic SAS installation. This has two implications:
first, the examples are not terribly exciting. Second, however, all of the code illustrated can be
executed in your local environment. No special downloads or customization is necessary to run
the sample programs, assuming that the necessary products are licensed at your site. It is hoped,
thereby, that you will be prompted to try out these examples, and use them as the basis for more
sophisticated applications.
1
Since the SAS Technologies and Support sites are frequently updated to reflect new products and solutions, these
references may change in the future, but they are correct for the date of publication.
17. xii Preface
The SAS AppDev Studio setup routine assumes that you will be using a Web server and SAS data
server (such as SAS/SHARE or SAS IOM) on the same Windows PC as the Web development
environment. This is fine for Web page development, but unrealistic for training, since most sites
will probably have separate Web and SAS servers. As the first chapter of this book points out, a
more representative test environment, and one that is not terribly difficult to implement, is to use
two or three PCs: a Web server, a back-end data server, and a client system. A multiplatform
setup more closely simulates a real client-server environment, since setting up connections to
remote systems involves a great many issues which do not come up if the client, the Web server,
and the data are all on the same PC.
In order to simulate the range of platforms for which SAS is available, the examples in this book
use a small private LAN created specifically to test the programs shown. Several hosts are
available:
ƒ Odin – the client system, running Windows XP Professional SP2
ƒ Hunding – a Windows 2000 server, with Microsoft Internet Information Server (IIS) 6.0
as the Web server
ƒ Hygelac – a Red Hat Linux server platform for the Apache and Tomcat Web servers
SAS 9.1.3 SP3 was used on all of these; SAS AppDev Studio 3.1 is installed only on the
Windows XP client Odin. In general, all of the examples presented were run on all of the
platforms that were appropriate in order to increase the probability that they will work at your site.
18. Acknowledgments
For the second edition of this book I want again to thank John West, my editor at SAS Press, for
his superhuman patience as I struggled to figure out how all this stuff works. Thanks also to the
folks at SAS Press for their care and dedication in shepherding the book through the publication
process, not to mention some splendid dinners.
I owe a particular debt of gratitude to the technical reviewers who patiently corrected and
sometimes re-corrected my errors in the manuscript. In particular, Vince DelGobbo helped me to
understand proven technologies like SAS/IntrNet and the Design-Time Controls, as well as the
new SAS Stored Process Web Application. Mickey Miller answered countless questions about
using Java with SAS. Joy Lashley reviewed the entire manuscript with incredible attention to
detail and certainly saved me from many embarrassing blunders. Rich Main was also helpful in
developing my understanding of the strategy and utility of the products under his direction.
Additional SAS technical reviewers I’d like to thank include Tammy Gagliano, Scott Sweetland,
Anita Hillhouse, Cynthia Zender, Bari Lawhorn, and Chevell Parker. Whatever errors or
infelicities that remain are mine, but the resulting product is far superior to what it might have
been without their help.
I also appreciate the support I have received from my friends in the SAS User community. In
particular, Elizabeth Axelrod and Ray Pass at NESUG, Pete Lund and Curtis Mack at PNWSUG,
Diana Suhr at WUSS, and Margaret Hung and Sandra Minjoe at PharmaSUG all provided
sponsorship and encouragement as I presented various drafts of this material at SUGI and the
regional conferences. Thanks also to Art Carpenter, the other éminence grise, for his friendship,
sense of humor, and especially for his patience with my stories.
The faculty here at Eastern Oregon University deserve my gratitude for both moral and financial
support. This is a wonderful place to work and think. Initial funding for research on the new
technologies in SAS was provided by a summer stipend grant from the EOU Faculty Research
and Grants Committee. Dr. Marilyn Levine, Dean of the College of Arts and Sciences, provides
enthusiastic support for my research activities along with approving all of my conference travel
requests without a murmur. Dr. Richard Croft and John Clever, my colleagues in the Computer
Science and Multimedia Studies Program, covered my classes and made it possible for me to have
some time to work over the two-year gestation process of this book.
Finally, to Linda, for her wisdom, patience and understanding. Thanks for sharing me with this
book project.
20. P a r t 1
Getting Started with Web Programming
Chapter 1 SAS and the Internet 3
Chapter 2 Introduction to HTML 15
Chapter 3 Creating Static HTML Output 31
22. C h a p t e r 1
SAS and the Internet
Introduction 3
TCP/IP and the Internet 5
Markup Languages 7
Deploying Content on the Web Server 8
Using the Apache Web Server on Windows 10
Using the Apache Web Server on UNIX/Linux 11
Using Microsoft Internet Information Server 12
References 12
Introduction
SAS provides a powerful and sophisticated suite of products for Web application development.
As is often the case with SAS, there are usually at least three different ways to accomplish the
same task with the available Web programming tools. What is more, many of these tools are new
even to experienced SAS users. In order to understand how to use these tools and what they do,
the user also needs to be familiar with several other SAS products, including the Output Delivery
System (ODS), Remote Computing and Remote Data Services, and SAS Integration
Technologies. In addition, although it is not essential, it is extremely helpful to have some
familiarity with HTML coding, CGI scripts, and Java programming in order to understand how
the various SAS components work.
23. 4 Web Development with SAS by Example, Second Edition
While it may be true that a wrench and a pair of pliers do pretty much the same thing, there are
times when one will work and the other won’t. Learning to use the tools that SAS has provided is
largely a question of figuring out when the wrench won’t fit. The goal of this book, therefore, is to
introduce the entire SAS Web development tool kit, to explain what each component does, and to
suggest when to use specific features and functions. Some familiarity with SAS syntax is
assumed, specifically the DATA and PROC steps, but the discussion of Web programming begins
with the most basic kinds of information.
Currently there are hundreds if not thousands of books about Web application development,
ranging in coverage from the fundamental to the monumental; several of the more useful ones are
referenced at the end of each chapter. Nonetheless, it is not easy to find a one-volume introduction
to the subject of Web development that manages to combine comprehensiveness with
intelligibility.
At the other end of the spectrum, it would be possible to write entire volumes about each of the
topics covered in this book. Consequently, compromises had to be made about how much or how
little detail needed to be included. The goal of this book is to discuss the design challenges and
available solutions, and to attempt to demonstrate by example how the tools available from SAS
fit into this conceptual framework. Note too that this is not a book about Web usability.
1
Content
and page design are assumed. The focus in this book is on how to get the page designers’
brainstorms to work in practice.
As used in the SAS documentation and in the rest of this book, SAS AppDev Studio includes the
following product components: SAS Integration Technologies, SAS/IntrNet, SAS/CONNECT,
SAS/SHARE, webAF, and webEIS. Since these products are not household words (at least not in
most households), all of these additional components will be described in their place, as part of
the overall conceptual framework that is the SAS Web development suite.
Strictly speaking, however, the new content in SAS AppDev Studio is just the two modules
webAF and webEIS; both of these are available only for the Microsoft Windows environment.
ƒ webAF is an Interactive Development Environment (IDE) for building Java applications
to access your SAS data and present it on the Web.
ƒ webEIS is an Online Analytical Processing (OLAP) report builder for the Web; it is a
point-and-click application builder for creating documents and publishing them on the
Web as Java applets or JavaServer Pages. (Note that webEIS has been deprecated in
SAS
®
9, although it is still supported in SAS AppDev Studio 3.1.)
Don’t worry if you don’t know what an IDE or an OLAP is; we will get to them in due course.
Learning about Web programming is largely a matter of learning to navigate through a haze of
jargon. To explain what all these tools do, it is necessary to use a lot of TLAs (three-letter
acronyms). There are also quite a few four-letter acronyms, and even some five-letter ones.
1
A classic one-volume treatment of this topic is by Jakob Nielson, Designing Web Usability: The Practice of Simplicity
(New Riders Press, 2000).
24. Chapter 1 SAS and the Internet 5
People have different styles of learning, but relatively few people are blessed with the ability to
look at a page of documentation and come away with a picture of what the software is supposed
to do. Consequently, much of this book consists of examples. The hope is that if you can decode
what the documentation is talking about, it will begin to be useful to you, and you can proceed
beyond the simple problems in this book. The remainder of this book takes up the challenge of
defining these new technologies and illustrating how SAS tools can be used to create distributed
information processing systems.
TCP/IP and the Internet
The protocol used to communicate among different computers is now almost universally the
Transmission Control Protocol/Internet Protocol (TCP/IP). In general, a diplomatic protocol is a
set of previously agreed-upon rules for negotiation. In order to send data from one computer to
another, there must also be an agreed-upon set of rules for how that data should be addressed and
formatted. Computers use different sets of protocols to manage this process. Each protocol is
designed for a different purpose, depending on how much reliability and control is needed.
In the case of network-based data transmittal, the important concern is that all of the data arrive in
the correct order. The TCP/IP protocol was developed back in the 1970s by a team of scientists
working on the Department of Defense Arpanet (Advanced Research Projects Agency Network)
project.
2
The original project had a number of goals, one of which was to assure that command
and control messages could still go out and be received in the event of a thermonuclear attack on
the United States.
In order to meet this requirement, the researchers created a protocol that would allow messages to
be sent as discrete packets of information via any number of possible routes. They would then be
reassembled at the receiving end in the correct order. The Internet Protocol, or IP, is responsible
for forwarding the packets to the specified Internet address; TCP is the set of rules for sending and
receiving packets over the physical network, and for catching and correcting transmittal errors.
(See http://directory.google.com/Top/Computers/Internet/Protocols for a list of available
resources on TCP and IP.)
The global network that became known as the Internet consists of a great many loosely connected
clusters of networked computers, all using TCP/IP to communicate. The computers in your home
or office network can all talk to one another using TCP/IP, and your network can talk to all the
other networks in the world using the same mechanism. It should be noted that there are
alternative networking protocols, most notably IPX, which runs on Novell networks, and LAN
Manager, which was IBM’s contribution. These alternative protocols are dwindling in use,
however, due to the enormous impact of the Internet and the World Wide Web, which run on
TCP/IP. In this book, the focus is on how SAS AppDev Studio makes use of the features of
TCP/IP to manage Web communication.
2
See Katie Hafner and Matthew Lyon, Where the Wizards Stay Up Late: The Origins of the Internet
(Touchstone Press, 1998).
25. 6 Web Development with SAS by Example, Second Edition
The existence of the Internet as a shared resource led to an interest in simplifying the user
interface. Clearly, a standardized method for access and display was necessary. In 1989, Tim
Berners-Lee, a British computer scientist working at CERN, proposed a global project to allow
sharing information over this new medium. He developed the first Web server, using the
Hypertext Transfer Protocol (HTTP), and the first Web client. He called the combination of these
technologies the World Wide Web (WWW). The World Wide Web first became available on the
Internet in the summer of 1991. It is the conjunction of the physical network and the World Wide
Web user interface that has led to the enormous growth in Internet connectivity and Web
development.
Berners-Lee’s brilliant contribution was defining how documents could include embedded links,
or hypertext, which would allow users to connect seamlessly to documents on widely distributed
computers. The HTTP standard uses the client/server model previously described. A program
running on the server continuously listens for client messages; a second program, called a Web
browser, runs on the client.
The browser has two jobs. First, it can send messages to the server, correctly encoded in HTTP,
using TCP/IP to format and address each message. When the user types the address of a Web
server in the browser window, the client sends something like the following request over the
Internet to the server at that Internet address:
GET /index.html HTTP/1.1
The HTTP protocol defines how messages are formatted and transmitted, and what actions Web
servers and browsers should take when receiving a request. When the Web server receives a
transmission encoded using the HTTP standard, it attempts to respond appropriately. In this
example, it responds by sending back the document index.html from a specified Web page
directory on the server.
In order to find the right server, the local client has to figure out the correct IP address. It does this
by sending a preliminary message to a Domain Name System (DNS) server with the name of the
Web server it has been asked to locate. The DNS server receives this Uniform Resource Locator
(URL) and replies with a numeric IP address where the Web server can be reached. The browser
then inserts this IP address into the header of the outgoing message and transmits it to the
requested Web server.
You can also type in an IP address directly as the URL. IP addresses are familiar to most Web
users as a set of four three-digit numbers. For example, 66.218.71.81 is the IP address that
corresponds to the www.yahoo.com home page. Each of the four fields separated by dots is a
number in the range 0 through 255; these are the decimal numbers that can be represented in
computer binary language in 8 bits—that is, 2
8
or 256 possible combinations. On most modern
computers, 32 bits equals one word in storage. Thus four 8-bit numbers were used as the original
format of an IP address. As a consequence of the enormous expansion of the Internet, the system
is rapidly running out of addresses, and new standards such as IPV6 are currently being advanced
to increase the size of possible IP addresses.
The second function the browser provides is the capability to display the received file, using the
rules for decoding Hypertext Markup Language (HTML) documents. HTML is the set of rules
describing the contents of Web files. The development of the HTML standard was what
transformed the World Wide Web from an academic curiosity to the ubiquitous entity it is now.
26. Chapter 1 SAS and the Internet 7
Markup Languages
Standard Generalized Markup Language (SGML) is the standard for organizing the elements of a
document. SGML was developed and proposed by the ISO in 1986. This system uses markup tags
enclosed in angle brackets (<>) to identify and delimit the various parts of a document (header,
body, paragraph, and so forth). Although SGML itself is too large and cumbersome to have wide
appeal, various subsets of the standard, including HTML and Extensible Markup Language
(XML) have become tremendously important for international e-commerce. Note that markup
languages such as HTML are not programming languages. In form, encoded texts are more like
the familiar word processing documents, containing instruction as to how the information
contained is to be formatted and displayed. The markup language is simply a set of rules for
encoding the text.
XML uses customized tags to provide for verifiable transmittal of data between applications and
between organizations. In contrast to HTML, XML was designed to support only the information
content of the message; in HTML, this content is combined with the presentation and formatting
of the data as well. Most recently, Extensible Hypertext Markup Language (XHTML) has been
proposed as a way to combine the validation features of XML with HTML formatting capabilities.
Finally, Dynamic HTML (DHTML) refers to Web content that can change each time it is viewed.
It is important to note that the term is frequently used to refer to two quite different things. The
first meaning, which is the one that is used in this book, is simply Web content that can change
each time it is viewed.
The second use refers to competing proposals from Microsoft and Netscape to the World Wide
Web Consortium (W3C) for various extensions to HTML that allow a Web page to react to user
input without sending requests to the Web server. The current position of the W3C on DHTML is
as follows:
“Dynamic HTML” is a term used by some vendors to describe the combination of HTML,
style sheets and scripts that allows documents to be animated. The W3C has received several
submissions from members companies on the way in which the object model of HTML
documents should be exposed to scripts. These submissions do not propose any new HTML
tags or style sheet technology. The W3C DOM WG is working hard to make sure
interoperable and scripting-language neutral solutions are agreed upon.
(See “Why the Document Object Model?” http://www.w3.org/DOM/)
Interested users can find more information on DHTML and DOM in the references at the end of
this chapter.
There are two main strategies for managing dynamic Web page content:
ƒ Client-side DHTML uses JavaScript, cascading style sheets (CSS) or Java applets.
ƒ Server-side content can be distributed using Common Gateway Interface (CGI) scripts,
PHP: Hypertext Preprocessor, Java servlets, or JavaServer Pages (JSP).
27. 8 Web Development with SAS by Example, Second Edition
In addition, Microsoft has developed a parallel set of technologies, including JavaScript and
Visual Basic Scripting Edition (VBScript) which can be used to create Active Server Pages (ASP)
on the server.
3
These latter all require some version of the Windows operating system, and are
explicitly integrated with Microsoft Internet Information Services (IIS) and SQL Server, the
Microsoft relational database management system.
Since the introduction of SAS 5 in the 1980s, SAS software is and has been largely platform-
independent. The SAS AppDev Studio toolkit is available only for Windows, however.
Nonetheless, Web pages developed with SAS AppDev Studio can be deployed equally well in the
UNIX and mainframe server environments as on the Windows platform, although there are
necessarily some differences in implementation. The examples in this book show how to use the
tools available for the Linux environment as well as for the Windows XP and Windows 2000
platforms.
Deploying Content on the Web Server
So far, the term “Web server” has been loosely used to mean two quite different things. Strictly
speaking, a Web server is not a computer; it is a computer program. Still, most people use the
term “server” to refer both to the software and to the hardware on which it runs.
The usual model for a three-tier Web computing environment looks something like the following
figure:
Figure 1.1 Typical Web Client/Server Configuration
In this design, the client computers are connected to the Internet (via TCP/IP), which in turn is
connected to the computer on which the Web server software is running. In addition, the Web
server can talk to a database server running on a third computer system.
3
ASP is an older technology from Microsoft; the current platform for delivering active server content is called ASP.NET 2.0;
see http://www.asp.net/ for more information.
Windows/
Mac client
Web Server
Internet
Linux
client
Database
28. Chapter 1 SAS and the Internet 9
While this is a common model, in principle all three programs—the client, the Web server, and
the database server—could be on two computers, or even all on one. In the previous figure, the
data server is located on a different hardware platform from the Web server. In many installations,
the two servers are both on the same system. In either case, the SAS/SHARE, SAS/CONNECT or
SAS Integration Technologies products must be licensed in order to use SAS as the back-end
database service; see Chapter 4, “Remote Access to SAS Data” for more detail on how to
implement this connection.
The neat trick about TCP/IP is that it does not know or care where the destination IP address is
actually located. The client computer is perfectly happy talking to a Web server that happens to
physically reside on the same machine. When you install SAS AppDev Studio on a Windows
client, the installation routine offers to install a Web server for you so that you can test your Web
pages. The server that currently comes bundled with SAS AppDev Studio is from the Apache
Software Foundation (http://www.apache.org).
The Apache HTTP server has been the most popular Web server on the Internet since 1996, with
about 70% of the installed server base of 75 million sites (as of December 2005, according to
http://www.netcraft.com/survey). Several other Web server programs are available, in particular
Microsoft IIS with about a 20% market share,
4
along with various others, none of which has more
than 3% penetration.
As a historical note, the Apache HTTP server software was originally developed as a voluntary,
part-time project:
In February of 1995, the most popular server software on the Web was the public domain
HTTP daemon developed by Rob McCool at the National Center for Supercomputing
Applications, University of Illinois, Urbana-Champaign. However, development of that httpd
had stalled after Rob left NCSA in mid-1994, and many webmasters had developed their own
extensions and bug fixes that were in need of a common distribution. A small group of these
webmasters, contacted via private e-mail, gathered together for the purpose of coordinating
their changes (in the form of “patches”).
(“How Apache Came to Be,” http://httpd.apache.org/ABOUT_APACHE.html)
Consequently, the project became known as “a patchy” server.
The two main reasons why Apache is so dominant are (1) it works, and (2) it’s free. In addition,
because there are over 50 million Apache installations worldwide, there is a great deal of free
support available from user groups and other resources. The big drawback with Apache (and
corresponding advantage for IIS) is that since the former is open source, if it doesn’t work you
have to figure it out yourself. There is no service number to call when things go wrong (but no
service fees, either!).
If you are working in an environment where you have access to a remote Web server, you need to
find out from your system administrator whether it is (1) an Apache server on Windows, (2)
Microsoft IIS, or (3) an Apache server on UNIX (or Linux). The examples that follow focus on
Apache, but IIS is conceptually similar. All Web server programs serve HTML pages from a
specific directory; the main difference is just the name of the folder where the pages are located.
4
A recent Microsoft press release indicates that in June 2005 ASP and ASP.NET represented about 44% of the content
on Fortune 1000 corporate application servers. This is probably a result of the fact that larger companies are less
likely to reply on free software. (http://www.port80software.com/about/press/060105)
29. 10 Web Development with SAS by Example, Second Edition
Using the Apache Web Server on Windows
Apache was originally written to run on various flavors of the UNIX operating system. While
earlier versions of Apache, notably 1.3, came with warnings that the Windows performance was
inferior to the UNIX versions, the newest releases (starting with version 2.0) are said to work
reliably with current versions of the Windows operating system. You can download a copy of the
binary executables for most operating systems from the Apache Web site at
http://httpd.apache.org/, or if you are installing SAS AppDev Studio on a client system, the setup
routine will ask you if you want to install a copy locally.
Since SAS AppDev Studio is a Windows-only product, the version of the Apache Web server
supplied is intended for Windows NT, 2000, and XP. SAS has automated the installation and
configuration of the server program so that it is fairly simple to operate in the Windows
environment. On a Windows system, you can define Apache as a service, and start and stop it
from the Start X Programs menu. This is the recommended approach, since that way the Web
server will start automatically when you reboot your computer. Just go to Programs X Apache
Web server X Apache as a Service and select Install Service. You can start and stop the service
from the same menu.
In order to display HTML content, the pages must first be copied to a specific directory on the
Web server system. Under Windows, it is possible to copy HTML documents to the server by
mapping a network drive (Z: for example) using Windows Network Neighborhood, and then just
dragging or dropping the HTML files to this drive. (As we shall see, this task is somewhat more
complex on a UNIX or Linux system.) Even if the Web server is on the same PC you are using, it
is still a good idea to map a drive to the directory where you want to display your Web pages.
Unless otherwise requested, the SAS AppDev Studio setup routine will install the Apache 2.0
server in C:Program FilesApache GroupApache2. Within the Apache folder, the
executable file apache.exe is located in the subdirectory bin. The default root directory for
HTML documents is htdocs. Default file locations for Apache are specified in the configuration
directory confhttpd.conf. Unless you know what you are doing, you should not try to change
these yourself. On a corporate Web server, you almost certainly will not have permission to edit
this file; if you have installed Apache on your local workstation, you probably do not need to
change the defaults anyway.
As noted above, the folder C:/Program Files/Apache Group/Apache2/htdocs is the default
Apache document root directory. Unless you tell it otherwise, Apache will try to serve Web pages
from this folder. You do not need to (nor should you) try to specify “htdocs” in the URL. If the
name of the Web page is example.htm, located in the htdocs folder, the URL for this Web page
would be http://<server-name>/example.htm.
At most sites, users do not have write access to the htdocs folder on the Web server. In this case,
the user has to contact the system administrator for a directory structure with the correct access
and permissions. The URL would thus contain an alias to this folder—for example http://<server-
name>/~username/example.htm. If you get the nasty message “The page you are looking for is
currently unavailable,” the HTML file is most likely not in the right directory. This would be a
good time to get help from someone who has tried this before on your Web server.
If your Web server is on a different network, including one on the other side of the world, it is still
possible to map a drive locally using WebDAV (Web-based Distributed Authoring and
Versioning). If your server is configured to support Web DAV, you can set up a client PC to
access a Web directly using HTTP. Although it is technically possible to do this using Web
Folders in Microsoft Office or Internet Explorer, most people prefer to use a dedicated client
30. Chapter 1 SAS and the Internet 11
application such as NetDrive or WebDrive; see the resources listed at the end of this chapter for
information about these products. Using WebDAV greatly simplifies the process of managing
Web content. Check with your system administrator to find out whether WebDAV is supported in
your environment.
Using the Apache Web Server on UNIX/Linux
In a Windows environment, as long as you have permission to write to the public documents
folder, you can just map a drive to this folder and drag and drop your Web pages there. On UNIX
systems, transferring documents is slightly more complex. The default directory paths are
specified in the file conf/httpd.conf under the server root directory. As noted above, these
values must be supplied at installation time by the system administrator. If you are the system
administrator and you installed Apache yourself, change to the Apache directory and try typing
the following command:
grep DocumentRoot conf/httpd.conf
This should list out the line in the file containing the value assigned to this parameter. One
common location for sites running Apache 2 is /usr/local/Apache2/htdocs. Earlier versions
of Apache such as 1.3 used /var/www/html, and the configuration files were in
/etc/apache2/conf.
The UNIX system administrator has to set up a password and some space on the Web server for
each user. Ask what directory you should use for your Web pages, and whether you should use
File Transfer Protocol (FTP) or Secure File Transfer Protocol (SFTP) to transfer them. FTP is the
TCP/IP protocol for copying files from one computer to another. You can use it for copying files
from one UNIX system to another, or from a Windows system to a UNIX server. FTP is a
relatively old protocol. Unfortunately it has one major security problem. When you type in your
user name and password, they are sent over the network unencrypted. This is bad enough when
connecting to an FTP server on your LAN or Intranet, but it is a real no-no when sending a file
over the Internet to a remote server. Anyone can find out your password just by monitoring the
network traffic. Consequently most sites are now requiring SFTP. This is easy to set up, but again,
you need to talk to your system administrator about what you need to do at your specific
installation.
In either case, the syntax is easy, if you just follow these steps:
1. On a Windows client, open an MS-DOS window. On a UNIX system, open a terminal
window. In either case, you should have a prompt character after which you can type
commands.
2. Open a connection to the remote system by typing ftp host-name or ftp host-name,
where host-name is the name or IP address of the remote computer.
3. You will be prompted for your user name and password. Use the ones you got from your
system administrator.
4. You may need to change to your directory. Type cd name, where name is the path to the
directory where you want to put your HTML pages.
5. To transfer the files, type put name, where name is the name of the HTML document you
want to display.
6. Type quit.
Note that a variety of GUI-based clients support FTP and SFTP; using these allows you to drag
and drop files to server directories, assuming your user ID has the proper permissions to do so.
31. 12 Web Development with SAS by Example, Second Edition
You should now be able to open a Web browser on your PC and type in the URL of the document
you have just copied. Just as with the Windows version, this URL will consist of the name of the
server (which you found out from the system administrator), followed by any specific directory
locations (like sasweb), followed by the name of the HTML page you want to display.
Using Microsoft Internet Information Server
The Microsoft Windows Server and Windows XP Professional editions come with IIS included.
This product does not run under UNIX, but for sites with Windows servers, it is an ideal choice.
The Web server can be installed in a few minutes from the operating system installation CD, or by
going to Start X Control Panel X Add or Remove Programs X Add/Remove Windows
Components.
The default installation directory for IIS is C:InetPub; the folder wwwroot is the root directory
for serving Web pages. Once IIS has been installed on the server, you can get detailed instructions
on use by opening http://<server-name>/iishelp, where <server-name> is the host name for your
Web server.
Whether your server is running Apache or IIS, locally on your PC or in Australia, the idea is the
same. There will be one specific directory on the server where you want to copy your HTML
documents. The URL to this directory will consist of the server name, possibly followed by the
path to your folder, followed by the name of your HTML document.
Now that you know how to deploy Web pages, it is time to start creating a few. The following
chapter is a short introduction to using HTML to create Web pages. If you are familiar with
HTML, you may want to go directly to Chapter 3, “Creating Static HTML Output,” which covers
several options for creating static Web pages with SAS.
References
SAS Publications
URL references are current as of the date of publication.
ƒ SAS Institute Inc. 2001. Getting Started with AppDev Studio. 2nd ed. Cary, NC: SAS
Institute Inc.
ƒ SAS Institute Inc. 2001. SAS Web Tools: Overview of SAS Web Technology (Course
Notes). http://support.sas.com/training/us/crs/wovr.html
Web Programming
As of December 2005, there were 2200 volumes on the topic “Web programming” at
http://www.amazon.com. The following are the works cited in the text.
ƒ Cooper, Alan. 2004. The Inmates Are Running the Asylum: Why High Tech Products
Drive Us Crazy and How To Restore The Sanity, 2nd ed. Indianapolis, IN: Sams.
ƒ Hafner, Katie and Matthew Lyon. 1998. Where the Wizards Stay Up Late: The
Origins of the Internet. New York, NY: Touchstone Press.
ƒ Krug, Steve. 2005. Don't Make Me Think: A Common Sense Approach to Web Usability.
2nd ed. Indianapolis, IN: New Riders Press.
32. Chapter 1 SAS and the Internet 13
ƒ Nielson, Jakob. 2000. Designing Web Usability: The Practice of Simplicity.
Indianapolis, IN: New Riders Press.
ƒ Torvalds, Linus and David Diamond. 2001. Just for Fun: The Story of an Accidental
Revolutionary. New York, NY: HarperBusiness.
Links
ƒ Apache HTTP Server Project – http://httpd.apache.org/ABOUT_APACHE.html
ƒ Document Object Model – http://www.w3.org/DOM/
ƒ Internet Protocols – http://directory.google.com/Top/Computers/Internet/Protocols
ƒ Microsoft Internet Information Services (IIS) –
http://www.microsoft.com/WindowsServer2003/iis/
ƒ Novell NetDrive 4.1 –
http://www.novell.com/documentation/ifolder21/netdrive/data/a2iii88.html
ƒ South River Technologies WebDrive – http://www.webdrive.com/products/webdrive/
ƒ WebDAV – http://www.webdav.org/
ƒ Web Server Survey – http://www.netcraft.com/survey
ƒ Working with Distributed Authoring and Versioning (DAV) and Web Folders –
http://support.microsoft.com/kb/q221600/
34. C h a p t e r 2
Introduction to HTML
Hypertext Markup Language 15
HTML vs. XHTML 19
Formatting HTML Using Style Sheets 22
Including User-supplied Information with Forms 25
References 29
Hypertext Markup Language
There are many good how-to books on learning HTML; a selection of titles is included in the
references at the end of this chapter. Since this book is mostly about SAS AppDev Studio, the
discussion of HTML features is confined to those that are likely to be most useful to the SAS user.
Specifically these include tables, forms and images, all of which are used by the Output Delivery
System (ODS) to format and display output (see Chapter 3, “Creating Static HTML Output,” for
an introduction to ODS). If you are already familiar with using these tools, feel free to skip this
chapter.
All markup languages use tags to annotate the document content. In HTML, there is a relatively
short list of standard tags that you need to learn. Once these are mastered, it is simply a question
of assembling them into the desired order. Of course in practice it is rarely so simple, but the
general principles are not difficult to learn.
Writing HTML can be very tedious, since there is necessarily a lot of repetition. For this reason, a
number of tools are widely available to automate the process. These are generally referred to as
IDEs (for Integrated Development Environment or Integrated Design Environment). The webAF
software that ships with SAS AppDev Studio is such an IDE, as we shall see later on in this book.
35. 16 Web Development with SAS by Example, Second Edition
However, many professional Web developers avoid relying on formal IDEs, preferring instead to
construct HTML from scratch using a text editor such as vi, Notepad, KEDIT,
1
or TextPad
2
.
A Web page is just an ASCII text file, with some markup tags inserted to format and display the
text. Some of the most common markup tags are listed in Table 2.1:
Table 2.1 Commonly Used HTML Tags
Tag Function
<a href=“URL”>text</a> Insert an anchor tag, link to the URL
<blockquote>text</blockquote> Indent the text one tab position
<br /> Insert a new line (no closing tag)
<div>text</div> Separate out a block of text for formatting
<em>italic</em> Emphasize the text
<hr /> Insert a single horizontal line (no closing tag)
<img /> Insert a graphic image or picture (no closing tag)
<li>list element</li> Bullet or number the item, keep the text together (The
item must be enclosed in a numbered or bulleted list.)
<ol>ordered list</ol> Number the items in the list
<p>paragraph</p> Keep the text together, new line at the end
<pre>preformatted text</pre> Maintain the original formatting, including white
spaces and line breaks
<span>text</span> Separate out a segment of text within a larger block
for formatting
<strong>bold</strong> Create bold text
<table>table</table> Insert a table
<td>table cell</td> Define the beginning and end of a table cell
<th>column heading</th> Define the beginning and end of a table header cell
<tr>table row</tr> Define the beginning and end of a table row
<u>underline</u> Create underlined text
<ul>unordered list</ul> Bullet the items in the list
The best way to understand how to use these tags is by example; Display 2.1 shows a sample
HTML page as it would appear in a Web browser.
1
KEDIT is a trademark of Mansfield Software Group, Inc.
2
TextPad is a trademark of Helios Software Solutions.
36. Chapter 2 Introduction to HTML 17
Display 2.1 Sample Web Page
Clicking on View X Source in the browser menu displays the following page source code for the
page index.html. This code may appear intimidating at first, but as noted previously it is
constructed simply by repeating standard elements; see the discussion in the following section for
an explanation of the markup.
Example 2.1 Sample HTML Page Source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html public="public" xhtml="xhtml"
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Eastern Oregon University Computer Science &
Multimedia Studies Program</title>
<link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div><img class="hdr" src="http://cs.eou.edu/images/csmm.jpg"
alt="EOU Computer Science/Multimedia Studies Program" />
</div>
<table summary="Program Information">
37. 18 Web Development with SAS by Example, Second Edition
<tr>
<td colspan="2" class="row_hdr">Program Information</td>
</tr>
<tr>
<td class="row1">
<ul>
<li><a href="programinfo.htm">Program Overview</a></li>
<li><a href="http://www.eou.edu/advising/checklist/CSMM.pdf">
Major & Minor Requirements (PDF)</a></li>
<li><a href="http://www.eou.edu/catalog/compmulti.html">
Course Descriptions</a></li>
<li><a href="http://cs.eou.edu/CSMM/EOU_tour_site/index.html">
Tour the EOU Campus</a></li>
</ul>
</td>
<td class="row1">
<ul>
<li><a href="cslab.htm">Computer Science Lab</a></li>
<li><a href="http://cs.eou.edu/cslabuse.htm">
Lab Use and Behavior</a></li>
<li><a href="mmlab.htm">Multimedia Lab</a></li>
<li><a href="http://www.oregonetic.org/
05-07/ETICSuccessStoriesRevC.pdf">
ETIC Success Stories (PDF)</a></li>
</ul>
</td>
</tr>
<tr>
<td colspan="2" class="row_hdr">People</td>
</tr>
<tr>
<td class="row2">
<ul>
<li><a href="http://cs.eou.edu/faculty.htm">
Faculty</a></li>
</ul>
</td>
<td class="row2">
<ul>
<li><a href="http://cs.eou.edu/students.htm">
Students</a></li>
</ul>
</td>
</tr>
</table>
<hr />
<p><a href="http://www.eou.edu">
<img class="logo"
src="http://cs.eou.edu/images/eoulogow2.gif"
alt="EOU logo" /></a></p>
</body>
</html>
38. Chapter 2 Introduction to HTML 19
HTML vs. XHTML
The World Wide Web Consortium (W3C), the standards body responsible for HTML, advocates
using “a stricter and cleaner reformulation” called Extensible Hypertext Markup Language
(XHTML):
XHTML is a family of current and future document types and modules that reproduce, subset,
and extend HTML 4. XHTML family document types are XML based, and ultimately are
designed to work in conjunction with XML-based user agents.
(http://www.w3.org/TR/xhtml1/)
The main difference between XHTML and HTML is the requirement that XHTML documents be
“well-formed.” This means that all elements must be in lower case, have closing tags, and nest
properly. In addition, attributes must be quoted. It turns out that it’s not very difficult to make
your HTML pages meet these requirements; in fact, it’s good practice. The examples shown in
this chapter use the XHTML conventions, but that should not distract from the essential
information.
The most important difference between HTML and XHTML is that the latter must conform to a
Document Type Definition (DTD) for XML-based Web pages. What this means in practice is that
you cannot use <font> tags or other formatting instructions in your pages. In the 15 years that
the Web has been around, developers have recognized the importance of separating the
appearance of the page from the content. The XHTML standard requires that all page formats
must be included in style sheets, not as part of the markup. The big advantage of this requirement
is that it enhances internationalization, as well as making it much easier to achieve a consistent
look and feel across your site.
A Web browser uses the markup tags to determine how to display the document. All tags are
constructed in the same way. Each tag is surrounded by angle brackets. For example, the page
shown in Example 2.1 begins with a <!DOCTYPE> tag. This tells the browser which HTML or
XHTML specification is used in the document, in this case strict XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
In the XHTML standard, the enclosing tag for the Web page, known as the root element, must be
<html>, as shown in the second line:
<html public="public"
xhtml="xhtml"
xmlns="http://www.w3.org/1999/xhtml">
The tag shown includes additional information that is required for XHTML, in particular the
namespace that is used. In this case, the page is using the public namespace xmlns (XML name
space). Namespaces are a way of defining groups of tags; for more information, see the resources
listed at the end of this chapter.
All XHTML tags must have a closing tag to set off the included text. These are just like the
opening tags, except that they begin with </ rather than just <. The very last tag at the end of the
document is the HTML closing tag </html>, which balances the opening tag and closes the
document.
The next section of the preceding example shows how tags can be nested. The <head></head>
tags identify the section of the document containing the page header. A <title> tag specifies the
text that should appear in the title bar (not on the Web page itself). The </title> tag closes the
39. 20 Web Development with SAS by Example, Second Edition
text string, and then the </head> tag closes the header. Other information that can go in the
HTML head includes <style> tags, used to create cascading style sheet (CSS) styles (see the
following section) and <meta> tags, which convey information to Web search engines.
Note that HTML 4.0 tags are not case sensitive: you can say <HEAD>, <head>, <Head>, or even
<hEaD>. The standard, however, is that all tags should be in lower case. The HTML standard does
not specify the order of the closing tags, so long as all open tags get closed. As noted previously,
allowing unclosed tags is perceived as a defect in the HTML specification that has been remedied
in the newer XHTML specification. In addition, like SAS, HTML ignores white space. You can
indent your page source code any way that seems helpful, and you can use comments with a
spendthrift hand.
The <link> tag is used to include another Web source document
3
. This tag can appear only in
the <head> section of a document and cannot have any included text. In the example, it is
included to specify a link to a user-defined CSS called styles.css in the current directory. (See
the discussion of style sheets in the next section for an explanation of how this works.)
The HTML specification indicates that tags may also have associated attributes. Attributes consist
of pairs of standard names and values, separated by an equals sign. Use quotes around attribute
values; the current HTML standard does not require them, but XML and XHTML do, and it is a
good idea to get into the practice. In this case, three attributes are used on the <link> tag:
ƒ href – location of the source document to be included (required)
ƒ type – content type, specifies the style sheet language
ƒ rel – relationship, specifies link type
The main section of this document is delimited by the tags <body> and </body>. Logically
enough, these enclose the body of the document, the content displayed in the browser window.
The example illustrates the XHTML convention that all tags must be enclosed in an outer block.
In the example, a <div> tag is used to set off an <img> tag. Image tags, as the name suggests, are
used to include pictures in HTML documents, as the example illustrates:
<img class="hdr"
src="http://cs.eou.edu/images/csmm.jpg"
alt="EOU Computer Science/Multimedia Studies Program" />
The <img> tag differs from those described above in that there is no corresponding closing tag; all
of the necessary information is conveyed by the attributes included in the tag. It is consequently
considered good form to indicate that this is an empty tag by using /> as the closing symbol.
3
See http://www.w3.org/TR/html4/struct/links.html for more information about links.
40. Chapter 2 Introduction to HTML 21
Three attributes are used on the <img> tag:
ƒ class – a format defined in the accompanying style sheet
ƒ src – a link to the image displayed (required)
ƒ alt – alternate text that appears if the image cannot be displayed (required)
SAS uses <img> tags to display the output of SAS/GRAPH procedures. Images can be generated
in either of two Web-compatible forms:
ƒ GIF (Graphics Interchange Format) – an older image format usually used for drawings
and icons
ƒ JPEG (Joint Photographic Experts Group) – a compressed format that is used to display
photographs and other images with a lot of detail. On DOS systems, the extension .jpg
was used since the operating system did not support the four-letter extension .jpeg.
Windows and UNIX systems can recognize either.
In SAS 6 the GOPTIONS statement could be used to redirect graphical output to a GIF file. In
SAS 7 and subsequent releases, the SAS Output Delivery System can now create image files from
SAS/GRAPH output (see Chapter 3, “Creating Static HTML Output”).
Tables can be an extremely useful formatting technique, of which ODS makes good use. Example
2.1 includes a table that has four rows and two columns, delimited by the opening and closing
<table></table> tags. The <table> tag illustrated includes a user-defined label for the table
as an optional attribute:
<table summary="Program Information">
The <tr> and </tr> tags delimit table rows whereas <td> and </td> enclose the cell contents;
these tags can appear only nested inside of <table></table> elements. Note in the example
that each row of this table has two columns, so there are two sets of <td> tags for each row.
The first row of the table has only a single cell, spanning both columns:
<tr>
<td colspan="2" class="row_hdr">Program Information</td>
</tr>
This tag uses a class attribute to identify the presentation format from the included style sheet;
see the following discussion on CSS.
The contents of a table cell are not limited only to data values. Tables can hold images,
multimedia clips, and even other tables. Web designers often employ nested tables in order to
achieve more control over page layout, although current practice is to use <div> tags and styles
to achieve the same end.
The second row of the table contains two bulleted lists, one in each column. HTML has three
kinds of lists. See http://www.w3.org/TR/html401/struct/lists.html for more details about
HTML lists.
ƒ unordered – bulleted
ƒ ordered – numbered
ƒ definition – a series of term/definition pairs
The elements in each type of list are enclosed in <li> tags.
41. 22 Web Development with SAS by Example, Second Edition
The lists include links to other files, as indicated by anchor tags <a>. The href attribute on an
<a> tag indicates that the attribute value is to be treated as a hypertext reference or link.
Two kinds of links are shown: relative and absolute. An anchor tag like the following indicates
that the referenced document is on the same Web server as the one displayed, in this case in the
same directory.
<a href="programinfo.htm">Program Overview</a>
Clicking on the tag causes that file to be loaded into the memory of the client computer and
displayed in the browser window.
Absolute tags work the same way, except that they are qualified with the name of the Web server.
For example, the following tag displays the message “Major & Minor Requirements (PDF)” as a
link to the indicated file on the EOU main server.
<a href="http://www.eou.edu/advising/checklist/CSMM.pdf">
Major & Minor Requirements (PDF)
</a>
The string & is an entity code. Since the ampersand is a special character in HTML, it must
be written as an entity, as shown. See http://www.ascii.cl/htmlcodes.htm for a complete list of the
codes corresponding to various ASCII characters.
The <hr> tag inserts a dividing line on the page. Since this tag has no end tag, the convention
used is to include a slash before the concluding bracket, as shown.
The last section of the example message body consists of a paragraph, delimited by <p> and
</p> tags. This paragraph illustrates the use of an <img> tag for a hyperlink. Clicking on the
picture takes you to the URL provided. Note that since the opening <a> tag occurs after the
opening <p> tag, the closing </a> tag must occur before the closing </p> tag. This is what the
W3C refers to as proper nesting.
Finally, the </body> tag closes the description of the body of the document, and the </html> tag
closes the document itself.
Formatting HTML Using Style Sheets
Style sheets are used to create a uniform appearance for a Web site by separating the page content
from the presentation. They also simplify Web page maintenance. When the marketing folks
decide at the last minute that the shade of green on all of the Web page headers isn’t quite right—
they’d like a darker, more forest green—the clever designer, who coded the heading color on a
style sheet, can make the change in one place rather than separately on every Web page.
In office automation suites such as Microsoft Office, style sheets, also known as templates, are
maintained as separate files or forms that specify the document layout. Web developers can use
the same principal, storing page formats and other style information in a separate file on the
server. The World Wide Web Consortium (W3C) has developed a standard for HTML called
cascading style sheets or CSS. A single file with the extension .css can be used to apply a
common format to many Web pages. The term “cascading” derives from the fact that multiple
style sheets can be applied to the same Web page, so that individual users can customize
organizational formatting rules by appending their own styles after the standard ones.
42. Chapter 2 Introduction to HTML 23
It also is possible to code user-specified formats directly into an HTML document, using the
<style></style> tags. Styles specified in these tags share a common syntax with external CSS
files. The advantage of external style sheets is that one style can be used to format many different
HTML pages. With inline formatting, a global change requires editing all of the affected pages.
If you are using SAS to create output pages, you can specify a CSS file to format your pages
according to the rules at your site or your own personal preferences. A number of tutorials are
available on CSS. Type “cascading style sheets” into your favorite search engine and you will be
directed to a good many of them. See http://www.w3.org/Style/CSS/ for a list of useful
references.
The following simple example illustrates how to create and link an external style sheet to an
HTML page. First, create a text file (in your favorite editor) that contains just the formatting
instructions. The syntax of CSS requires an element name followed by a set of style instructions,
separated by semicolons, all enclosed in curly braces {}:
Example 2.2 Sample Cascading Style Sheet
body{ background-image: url("underwater.jpg") }
h1{ color: red; font-weight: bold; text-align: center }
h2{ color: blue; font-weight: bold; text-align: center }
p{ color: yellow; font-size: 14 pt; text-align: left }
These instructions specify that the image file underwater.jpg should be used as the background.
Headings are in bold and centered. Main titles (h1) are in red; sub-heads (h2) are blue. Paragraph
text is black and the font size is 14 point.
Save this file with the extension .css (for example, as mystyle.css) and add a link to the new file
in the header of your HTML document:
Example 2.3 Sample Page with Link to External CSS
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<h1>heading 1</h1>
<h2>heading 2</h2>
<p>paragraph1</p>
<p>paragraph2</p>
<p>paragraph3</p>
</body>
</html>
This will cause the specified format to be applied to any document that contains this <link> tag.
The following example shows the resulting HTML page.
43. 24 Web Development with SAS by Example, Second Edition
Display 2.2 Sample Output Formatted with CSS
The example illustrated in Display 2.1 also includes a link to an external style sheet. As noted
above, using a single style sheet to format multiple Web pages allows the developer to create a
consistent look across the site. The included style sheet is called styles.css as shown in
Example 2.4 below:
Example 2.4 Sample Cascading Style Sheet with Table Formats
body {
background-color: #FFFFFF;
font-family: verdana, helvetica, arial;
}
:link {
color: #000080;
}
:visited {
color: #0000FF
}
:active {
color: #800000
}
table {
width:100%;
44. Chapter 2 Introduction to HTML 25
height:300px;
border: 0;
}
td {
width: 50%;
font-size: 10pt;
vertical-align: top;
padding: 2pt;
}
td.row_hdr {
color: #800000;
background-color: #C0C0C0;
font-size: 12pt;
font-weight: bold;
height: 20px;
width: 100%;
}
img.hdr {
height: 100px;
width: 400px;
}
img.logo {
border: 0;
float: left;
height: 55px;
width: 165px;
}
This document is quite similar to Example 2.2, with the addition of a few more formats.
Altogether, nine different values are defined in this style sheet:
ƒ body – applies to all content between the <body> and </body> tags
ƒ :link – defines a link style (or pseudoclass) for hyperlinks that have not been visited—
that is, pages that are not in the browser cache
ƒ :visited – describes any hyperlink that has been cached
ƒ :active – describes a hyperlink that has been clicked but not yet released
ƒ table – applies to all content between the <table> and </table> tags
ƒ td – applies to all table cells
ƒ td.row_hdr – defines a style that applies only to table cells labeled with
class=row_hdr
ƒ img.hdr – applies only to images labeled with class=hdr
ƒ img.logo – applies only to images labeled with class=logo
For more information about formatting pages with style sheets, see the references at the end of
this chapter.
Including User-supplied Information with Forms
HTML forms provide a way to collect user input. Most people are familiar with Web pages that
are used to log on to services or order products; these are usually managed by using forms.
Display 2.3 shows a sample form with a variety of controls:
45. 26 Web Development with SAS by Example, Second Edition
Display 2.3 Sample HTML Form
The source code for this form is shown in Example 2.5:
Example 2.5 Sample HTML Source Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample Form</title>
<style type="text/css">
h1 { text-align: center; color: #0000FF }
.label { font-weight: bold; color: #0000FF }
</style>
</head>
<body>
<h1>Student Questionnaire</h1>
<form name="students" method="get" action="index.html">
<blockquote>
<p>
<span class="label">Last Name:</span>
<input type="text" name="lastname" />
</p>
<p>
46. Chapter 2 Introduction to HTML 27
<span class="label">First Name:</span>
<input type="text" name="firstname" />
</p>
<p>
<span class="label">Year:</span>
</p>
<blockquote>
<input type="radio" name="year" value="1" />Freshman<br />
<input type="radio" name="year" value="2" />Sophomore<br />
<input type="radio" name="year" value="3" />Junior<br />
<input type="radio" name="year" value="4" />Senior<br />
<input type="radio" name="year" value="5" />Graduate<br />
<input type="radio" name="year" value="9" />Other
</blockquote>
<p>
<span class="label">Major:</span>
<select name="major">
<option value="CS">Computer Science</option>
<option value="B">Business</option>
<option value="F">Forestry</option>
<option value="M">Media Arts</option>
<option value="O">Other</option>
<option value="U">Undecided</option>
</select>
</p>
<p>
<span class="label">Check if this is your first computer class</span>
<input type="checkbox" name="firstCS" value="Y" />
</p>
<p>
<span class="label">Thank you for completing this form.</span>
</p>
<p>
<input type="reset" value="reset" />
<input type="submit" value="submit" />
</p>
</blockquote>
</form>
</body>
</html>
As in the previous HTML example, this Web page starts out with an <html> tag followed by the
<head> and </head> tags enclosing the title bar information. In this case, the style sheet
information is local to the page:
<style type="text/css">
h1 { text-align: center; color: #0000FF }
.label { font-weight: bold; color: #0000FF }
</style>
The first instruction indicates that the heading at the start of the body of the document is centered
and displayed in blue. The second format is a user-defined one that can be referenced with the
name label. The initial period indicates that this format is not restricted to a particular element
but may be used anywhere.
47. 28 Web Development with SAS by Example, Second Edition
The reader is here cautioned to take a deep breath, since the description is now going to get a little
hairy. The following statement opens a new HTML form:
<form name="students" method="get" action="index.html”>
Forms are used to collect input from the user. Usually a <form> tag would have at least two
attributes in addition to the optional name:
ƒ action, which supplies the name of the program to be run when the form is submitted
ƒ method, either GET or POST, which tells the browser how to send the form data to the
server
When the form is submitted, the browser runs the script or program specified by the action
attribute on the form. The script can either be local (in VBScript or JavaScript) and executed by
the browser, or a server-side script, such as a CGI program or a Java servlet. The script can
reference objects on the form based on the name attributes on the form tags. How these work, and
when to use them, will be described in subsequent chapters. At this point it is sufficient to note
that the sample form shown only gathers data; it does not actually do anything with it.
The rest of the page describes the contents of this form, down to the closing </form> tag, and
concludes with </body> and </html>. The labels associated with each of the input fields are
formatted using the CSS label style defined in the document header. A <span> tag is used to
limit the formatting only to this text.
<span class="label">Last Name:</span>
The first form control (or widget in SAS/AF terminology) is the <input> tag. The HTML
standard currently defines eight different kinds of inputs, specified by the type attribute that
appears on the tag:
ƒ Text – a one-line input string
ƒ Password – text that is not displayed when enterned
ƒ Checkbox – a yes or no choice
ƒ Radio – a yes or no choice, but only one can be selected
ƒ Hidden – a field that is not displayed, used to pass information to the server
ƒ Reset – a button that clears all fields on the form
ƒ Submit – a button that sends the form to a Web server
ƒ Image – the same as Submit except it displays a picture instead of a button
The first two input boxes on the form (“lastname” and “firstname”) store the text that the user
enters in fields specified in the name attribute. An <input type="text"> tag only allows the
user to enter one line of text; pressing the ENTER key goes to the next form control instead of
inserting a newline character. In order to input more than one line of text, it is necessary to use the
<textarea> tag.
The third form control, “year”, gets its values from the radio buttons. With this type of control
only one choice can be selected. Note that form variables are not typed; you can enter characters
or numbers. All values are stored as text, even if the quotes around the values are omitted, as in
this example.
48. Chapter 2 Introduction to HTML 29
The <select> tag is an alternative to the <input> tag; it allows the user to choose from the list
specified by the <option> tags. As with the radio buttons and the checkbox, the value attribute
determines the test string returned from the control.
An input box of type checkbox allows the user to select a single value; the value attribute is the
text string returned when the box is checked.
Finally, the submit and reset input types display command buttons; the label on the button is
determined by the value attribute. As noted previously, reset clears the form and submit sends
it to the server. There can be only one submit button and one reset button on a form.
To summarize, HTML tags are used to indicate the layout of the Web page. In addition, <style>
tags or style sheets can be used to specify generic formats that can be applied to specific page
items. The <table> tag allows data to be displayed in a tabular format, whereas the <form> tag is
used to collect information from the user. Pictures and animations can be inserted into the page
using <img> tags.
References
HTML
URL references are current as of the date of publication.
ƒ Beginners Guide to HTML –
http://archive.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimer.html (A classic)
ƒ Castro, Elizabeth. 2002. HTML for the World Wide Web with XHTML and CSS: Visual
QuickStart Guide. 5th ed. Berkeley, CA: Peachpit Press.
ƒ Lissa Explains it All: The first and original HTML help JUST for kids –
http://www.lissaexplains.com/basics.shtml (This site was developed by a 12-year-old
girl.)
ƒ Musciano, Chuck and Bill Kennedy. 2002. HTML & XHTML: The Definitive Guide.
5th ed. Sebastopol, CA: O'Reilly & Associates.
ƒ Powell, Thomas. 2003. HTML & XHTML: The Complete Reference. 4th ed. Emeryville,
CA: McGraw-Hill/Osborne Media.
ƒ W3C CSS Home Page – http://www.w3.org/Style/CSS/
ƒ W3C HTML Home Page – http://www.w3.org/MarkUp/
ƒ W3C XHTML Home Page – http://www.w3.org/TR/xhtml1/
CSS
ƒ Meyer, Eric A. 2004. Cascading Style Sheets: The Definitive Guide. 2nd ed. Sebastopol,
CA: O'Reilly & Associates.
ƒ Shea, Dave and Molly E. Holzschlag. 2005. The Zen of CSS Design: Visual
Enlightenment for the Web. Berkeley, CA: Peachpit Press.
50. C h a p t e r 3
Creating Static HTML Output
Introduction 31
Creating Static HTML Output with SAS Tools 34
Displaying Preformatted Text 34
DATA Step Programming for Web Output 36
Macros for HTML Formatting 38
Using the Output Delivery System to Create HTML 48
The ODS HTML Statement in SAS
®
9 53
Creating Multiple Pages with a Single Program 54
Creating a Table of Contents for Procedure Output 57
Listing the Contents of a Data Set 59
Using Styles to Format ODS Output 60
Using the ODS Markup Statement to Create XHTML 64
PROC TEMPLATE: Not Just for Geeks Anymore 67
References 70
Introduction
In the earliest days of the World Wide Web, all content was static. That is, there was no way for a
user to modify the appearance or contents of a Web page viewed in the browser window. This
worked fine for the original hypertext model, designed for information display only, but it was
obviously inadequate for electronic commerce. Later sections of this book introduce the tools for
creating dynamic HTML Web pages. In this chapter, however, the focus is on programs that
simply generate an HTML file for display by the Web browser.
51. 32 Web Development with SAS by Example, Second Edition
The examples in this chapter assume that you would like to capture the output from a SAS
procedure to display as a Web page. Since this is static HTML, you will need to replace the
HTML source each time the values change. If the data is retrospective and unchanging, however,
this approach is convenient. You only have to create the output file once, by hand, and then copy
it to your Web server directory for display.
An example of static vs. dynamic HTML pages would be two standard reports: one produced
periodically and another that relies on results generated in real time. The information in a
quarterly or annual report is fixed; the user is not expected (or allowed) to change it. A year-to-
date sales report, on the other hand, requires the ability to summarize results dynamically. As
noted in the previous chapter, the only way to collect information using HTML forms is to run
some kind of program or script when the Submit button is pressed. Static HTML is more than
adequate for disseminating scientific articles or brochures, but it would not be very effective for
making airline reservations.
Note that there are a number of advantages to providing static HTML content. Since they do not
require running any additional programs other than the HTTP server, static HTML pages can be
served very quickly. At the same time, development effort is minimized. The main drawback is
that in order to change the information displayed, the page must be recreated and recopied to the
server. As noted previously, it is the responsibility of the designer to determine which data is
likely to be static and which dynamic. Effective Web site design requires using the right tool for
the right job, and that can mean setting up standardized reports for information that changes
infrequently or not at all.
For purposes of comparison, all of the examples in this chapter feature the same program, the
following simple TABULATE procedure. The Base SAS installation disks include a number of
sample data sets in the default SASHELP library. This sample data is used for the examples in
this chapter. Consequently, they can be run at any site without obtaining or installing any special
data sets.
When a SAS program is run in batch mode, two output files are created by default: the .log file
shows the execution time messages and any error messages, while the .lst file contains the
results. Example 3.1 shows a sample program, and Display 3.1 shows the resulting plain vanilla
.lst file when the program is run from the command line. Readers unfamiliar with the syntax of
PROC TABULATE are referred to the SAS documentation.
1
The following code is reasonably self-evident; it uses the SASHELP.RETAIL data set to generate
various statistics on retail sales by year for a hypothetical company.
Example 3.1 Sample PROC TABULATE Program
options noovp nodate nonumber nocenter ls=80;
proc tabulate data=SASHELP.RETAIL
formchar="|----|+|---+=|-/<>*";
title "Retail Sales In Millions Of $";
class YEAR/descending;
var SALES;
table YEAR="" all="Total", SALES="" *
(sum="Total Sales"*f=dollar8.
1
See especially Lauren E. Haworth, PROC TABULATE By Example (Cary, NC: SAS Institute Inc., 1999).
52. Chapter 3 Creating Static HTML Output 33
pctsum="Overall Percent"*f=8.2
n="Number of Sales"*f=8.
mean="Average Sale"*f=dollar8.2
min="Smallest Sale"*f=dollar8.
max="Largest Sale"*f=dollar8.)/
box="Year" rts=8;
run;
Most of the program code in this example consists of labels and formats to get the page to display
nicely. The FORMCHAR= option, for example, is included to ensure that the resulting output
uses the standard ASCII form delimiters, rather than the SAS defaults, which do not work in a
Web browser. Without a FORMCHAR= option specified, the output is not useable. The resulting
text is formatted for a line printer, as shown below.
Display 3.1 Sample PROC TABULATE Output
Retail Sales In Millions Of $
--------------------------------------------------------------
|Year | Total |Overall | Number |Average |Smallest|Largest |
| | Sales |Percent |of Sales| Sale | Sale | Sale |
|------+--------+--------+--------+--------+--------+--------|
|1994 | $1,874| 5.97| 2| $937.00| $876| $998|
|------+--------+--------+--------+--------+--------+--------|
|1993 | $3,578| 11.40| 4| $894.50| $758| $991|
|------+--------+--------+--------+--------+--------+--------|
|1992 | $3,204| 10.21| 4| $801.00| $692| $889|
|------+--------+--------+--------+--------+--------+--------|
|1991 | $2,947| 9.39| 4| $736.75| $703| $807|
|------+--------+--------+--------+--------+--------+--------|
|1990 | $2,734| 8.71| 4| $683.50| $606| $749|
|------+--------+--------+--------+--------+--------+--------|
|1989 | $2,592| 8.26| 4| $648.00| $594| $670|
|------+--------+--------+--------+--------+--------+--------|
|1988 | $2,412| 7.69| 4| $603.00| $546| $643|
|------+--------+--------+--------+--------+--------+--------|
|1987 | $2,164| 6.90| 4| $541.00| $484| $595|
|------+--------+--------+--------+--------+--------+--------|
|1986 | $1,922| 6.13| 4| $480.50| $419| $541|
|------+--------+--------+--------+--------+--------+--------|
|1985 | $1,596| 5.09| 4| $399.00| $337| $448|
|------+--------+--------+--------+--------+--------+--------|
|1984 | $1,528| 4.87| 4| $382.00| $342| $413|
|------+--------+--------+--------+--------+--------+--------|
|1983 | $1,393| 4.44| 4| $348.25| $299| $384|
|------+--------+--------+--------+--------+--------+--------|
|1982 | $1,252| 3.99| 4| $313.00| $284| $343|
|------+--------+--------+--------+--------+--------+--------|
|1981 | $1,148| 3.66| 4| $287.00| $247| $323|
|------+--------+--------+--------+--------+--------+--------|
|1980 | $1,030| 3.28| 4| $257.50| $220| $295|
|------+--------+--------+--------+--------+--------+--------|
|Total | $31,374| 100.00| 58| $540.93| $220| $998|
--------------------------------------------------------------
53. 34 Web Development with SAS by Example, Second Edition
Creating Static HTML Output with SAS Tools
Before SAS 8, there were three choices for creating static HTML output:
ƒ using the HTML <pre> and </pre> container tags to enclose results
ƒ using a DATA step to insert HTML tags into SAS output
ƒ using the HTML Formatting Tools, a series of SAS macros for generating Web pages
All of these are still available in Base SAS, but unless the only SAS release you have available at
your site is one of these earlier versions, there is little reason to use the older tool set. ODS, the
Output Delivery System introduced in SAS 7, can be used to produce a wide variety of output
formats, including HTML and XML. Even though the earlier approaches are now superseded, it is
instructive to examine how they work.
Displaying Preformatted Text
Display 3.2 displays the same information shown in Display 3.1, the output from the sample
PROC TABULATE. This example was created by editing the SAS .lst file produced by the
preceding program, saving it to the server as an HTML file (shown in Example 3.2), and
displaying the result in a Web browser.
Example 3.2 Using HTML Preformatting
<html>
<head>
<title>Retail Sales Table</title>
</head>
<body>
<h1 style="font-family: helvetica, tahoma, arial; color: blue">
Retail Sales in Millions of $</h1>
<pre>
--------------------------------------------------------------
|Year | Total |Overall | Number |Average |Smallest|Largest |
| | Sales |Percent |of Sales| Sale | Sale | Sale |
|------+--------+--------+--------+--------+--------+--------|
|1994 | $1,874| 5.97| 2| $937.00| $876| $998|
|------+--------+--------+--------+--------+--------+--------|
|1993 | $3,578| 11.40| 4| $894.50| $758| $991|
|------+--------+--------+--------+--------+--------+--------|
|1992 | $3,204| 10.21| 4| $801.00| $692| $889|
|------+--------+--------+--------+--------+--------+--------|
|1991 | $2,947| 9.39| 4| $736.75| $703| $807|
|------+--------+--------+--------+--------+--------+--------|
|1990 | $2,734| 8.71| 4| $683.50| $606| $749|
|------+--------+--------+--------+--------+--------+--------|
|1989 | $2,592| 8.26| 4| $648.00| $594| $670|
|------+--------+--------+--------+--------+--------+--------|
|1988 | $2,412| 7.69| 4| $603.00| $546| $643|
|------+--------+--------+--------+--------+--------+--------|
|1987 | $2,164| 6.90| 4| $541.00| $484| $595|
|------+--------+--------+--------+--------+--------+--------|
|1986 | $1,922| 6.13| 4| $480.50| $419| $541|
|------+--------+--------+--------+--------+--------+--------|
|1985 | $1,596| 5.09| 4| $399.00| $337| $448|
|------+--------+--------+--------+--------+--------+--------|
56. figure in the midst of unlovely things; the children stared as
they would have stared at a man with a monkey, or any
other show; there was nothing in him to attract unusual
notice. But he felt so unusual himself, that it took him some
time to make sure of this. Then, the awkwardness wearing
off, his spirits rose. He found the situation amusing. He
rather wished to meet some one whom he knew that he
might test his disguises to the utmost. It was a beautiful
morning, and there was a novelty in the impossibility of
shocking probabilities by calling a hansom, which in itself
was absolutely exhilarating.
When he reached the Hospital his pleasure increased. It was
too early in the day for many of the old men to be out
sunning themselves, but he became immediately aware of
the peaceful and old-world atmosphere which hung about
the place. A morning breeze was blowing up the river, and
delicate white clouds sailed across the sky. In the midst of
its trees lay the Hospital, warm red brick, with white
pointings and grey stone pillars, on which the sunshine
rested softly mellow; with its broad frontage of green turf,
and its iron gates, and its little graveyard, where lie the old
heroes waiting for the “last trumpet’s sounding.” Everitt had
not been there for years; it seemed to him almost as if he
had never been before—as if all those years he had lost
something. When one or two old men, in long blue coats
and brass buttons, and broad three-cornered hats, strolled
out of the side gates and stared at him, he felt as if the
picture were complete, except that he began to hate himself
for being the incongruous feature.
He was directed to one of the brick houses which cluster
near the Hospital itself, and closely resemble it in their
details; his guide hobbling before him, and now and then
throwing at him a suspicious glance. Everything was
exquisitely trim and clean; the warm colours, the tender
57. shadows on the old brick, the sunshine, the sober
cheerfulness, the lilacs just breaking out in the gardens, the
filmy green which daintily touched the trees, were full of
delightful charm; and, though the river was not visible, a
sort of feeling of its neighbourhood—a freshness in the air,
an opening in the distance—added to this charm.
They were not long in reaching the Lascelles’ house, built,
like the others, of substantial, warm red brick, square and
solid, with well-grown trees about it, and gay flowering
shrubs, in which blackbirds were singing, as if London were
miles away. It must be owned that, as Everitt walked up the
back staircase—which was, however, of oak—he began to
feel unusually embarrassed.
The little room into which he was ushered was as different
from his own lofty and convenient studio as could be
imagined, yet it was all in keeping with the rest. A rough
sandy English terrier, with prick ears and bright dark eyes,
made an immediate dash at him, and was seized by his
mistress. This gave Everitt time to glance round him, and to
observe that the room was panelled with old oak, and
painted above a dull green; that the light was excellent, and
the furniture of a somewhat scanty description; that a good
many vigorous studies were stuck about; and that the
whole aspect of the place looked like business.
Then he surveyed Miss Lascelles, who was pacifying her
dog.
She was not at all the sort of person he had expected to
see, though it must be owned he had built his ideas without
a vestige of foundation. She was small and very girlish-
looking, with a bright, happy face and pretty, graceful
movements. Her dress was of some soft brown material,
58. with velvet of a darker shade about the neck which matched
the brown hair lying smoothly on her little head.
“Sandy, be quiet!” she said; then looking at Everitt, “You
are sent by Mr Everitt?”
“Signorina, yes.” He felt that on this score, at any rate,
there could be no question.
“I have been expecting you for some time,” she went on; “I
should like you to be more punctual another morning. But
now I will show you where you are to stand.”
To stand! Everitt’s heart sank; he had hoped he might sit.
“I want,” said Miss Lascelles, calmly—“I want you to stand
with your hand above your eyes, shading them—so. You are
to be one of a group of peasants who are coming into Rome
with all their goods, escaping from an inundation—you must
have seen them, I’m sure? You are leading the string, and
looking before you eagerly, perhaps to see whether some
one who is missing is in front. You understand?”
“Signorina, yes. But—”
“What?”
“The sun with an inundation?”
“It has broken out, and is shining on the pools of water in
the road.”
Everitt felt much more capable of criticising and suggesting
than of posing as she desired, but there was no help for it.
She had even looked a little astonished at receiving his last
remark. He exerted himself now to stand in such a position
that he could see her at work at her easel, and he was
59. sufficiently experienced to be able to judge from her
manner of handling her brush that she worked with vigour
and freedom. He was conscious at the same time that he
was not himself a good model; he even suspected that he
now and then read a little disappointment in her face.
Keeping his arm raised was fatiguing; he knew that he
swayed, then began to feel as if pins and needles were all
about him, then as though he were turned to stone. The
ordinary hour had seemed to double itself before Miss
Lascelles inquired gently whether he wished to rest. Rest!
Never had the word a sweeter sound.
He sat down by the window. Outside and below there was a
little old-fashioned garden with a brick wall and gravel
paths. Two or three children ran out into these paths, and
began a joyful onslaught upon square little plots where
mustard and cress were sprouting into different
combinations of the letter L. Further on a swing was
fastened between two fine elm trees which grew out of the
turf. There was a great deal of sunshine, and as yet little
shade: only a finely outlined delicate network of shadows
cast by the branches on the grass. Everitt had never in his
life been more glad to sit down, and he thought the look-out
delightful.
Presently the door opened, and another young lady came
in.
He looked round idly, but the next moment a very
disagreeable sensation shot through him. He recognised her
at once—the girl who had come to his studio with Mrs
Marchmont. Supposing she also remembered him? What a
fool he had been not to take such a possibility into account!
Good Heavens! what was to prevent Mrs Marchmont herself
from arriving?
60. He took refuge in the garden, and in a corner of his cloak,
horribly conscious that in a few minutes he would have to
stand up before her with the full light striking upon him. But
if she did not know him at the first glance, she might
become more hesitating and confused the longer she
thought of it; and he trusted a good deal to his hat.
Meanwhile the two girls were talking, too low for him to
hear.
“Well, Kitty, are you satisfied?”
“I’m not sure. It’s a good dress—isn’t it? But, Bell, he’s not
—I assure you, he’s not—a good model.”
“Not?” repeated Bell. “Mr Everitt seemed to think him
splendid. He said he was the best possible, but,”—lowering
her voice—“a dreadful ruffian.”
“He is a very mild-looking ruffian, then.”
“Oh, Kitty, there’s a horrid expression in his eye!”
“Put it in, then; I can’t see it. But he can’t stand—he
fidgets. He wanted to rest long before the hour.”
“That,” said Bell, severely, “was laziness.”
“Perhaps. I don’t know,” said the other, doubtfully. “There
are all your things; what shall you do?”
“Only his head. But I wish his hat wasn’t a necessity for
you. It is, I suppose?”
“Yes, my dear, an absolute necessity. You needn’t mind so
much, though, for his hair is quite short.”
“Short? How very odd! How—”
61. Kitty interposed with a pretty little motion of her hand.
“I really think he has rested long enough. Will you please
stand again?” she said in her young, clear voice.
Everitt rose with decided unwillingness. He was reluctant to
face Miss Aitcheson, and began to think that what he had
undertaken so lightly might turn out a serious matter. A
hundred possibilities flashed through his mind: and then, it
annoyed him that Miss Aitcheson placed herself where he
could not judge whether she made any discoveries or not.
Still, he got through this hour better than the last.
There can be no doubt that silence is a power of which we
underrate the force. Hours of ordinary small talk would not
have affected Everitt so strongly as these quiet moments in
the old oak-panelled room, with the sunlight, the birds, and
the children outside; and inside, this girl—for he could not
see her companion—working steadily, and, he was sure,
well, with quiet, simple intentness. Sometimes she stepped
back a foot or two, and stood looking from her picture at
him, throwing back her head, and showing clearly the soft
whiteness of her throat and the pretty shape of her head.
Instead of looking before him at his unseen comrades, he
more than once found himself watching her with steady
interest, and thinking in what fashion he would paint her if
he got the chance. Standing as she was standing now, he
determined, for it was difficult to conceive anything prettier.
Suddenly Sandy, who had given himself over to sleep to
avoid looking at Everitt, jumped up, pricked his ears, trotted
to the door, and stood with his head on one side. Then a
step was heard coming heavily along the passage.
“That’s my father,” said Bell. “He has come here to talk over
something or other, and he said he’d look in. Don’t mind
62. him, Kitty; go on.”
“I don’t know if I can,” Kitty answered a little nervously.
The answer surprised Everitt for a moment; the next he
understood. The new-comer was an upright, square, red-
faced man, and when he came in he seemed to bring with
him a dozen elements of disturbance. His boots creaked, his
voice was loud.
“Here you are, here you are, eh?” he began. “Well, Kitty,
how are you getting on with this fad of yours? I’ve just been
telling your father I don’t thank him—I don’t indeed. If it
weren’t for you, Bell would be at home, working at her
needle, or doing something with a little sense in it. Painting!
What’s the good of it when you’ve done it, eh? that’s what I
want to know. Who have you got here? Italian? No more
Italian than I am, I’ll be bound. Here, you Smith, Jones,
whatever you’re called, I should very much like to know
whether you’ve ever seen any country but England, eh?”
Bell interposed.
“Father, you mustn’t interfere with Kitty’s models.”
“Models, nonsense! If you want models, why don’t you draw
one another, eh? Save your money, and not have these
fellows hanging about. I wouldn’t allow it if I were Lascelles,
not I! Well, I’ll take myself off, Kitty; I don’t want to disturb
you, but take my advice, don’t you believe he’s an Italian,
and don’t let yourself be taken in. If you’re ready in half an
hour, Bell, I’ll take you home.—Hallo! what have I knocked
over now? If you will have these bothering things on three
legs standing about— Never mind? But I do mind; I mind
uncommonly. Don’t talk to me, Bell; if you had decent
furniture, a man needn’t knock his shins against it.”
63. He went away grumbling. The girls looked at each other and
laughed.
“It is a little like an earthquake,” remarked Bell, calmly.
“He is delightful everywhere but in a studio,” said Kitty. “He
knows nothing about pictures, but he makes me feel I know
less. Bell, is it all a waste of time?”
“I don’t know,” said Bell. “Make as good a waste of it as you
can, at all events, and go on with your picture.” To Everitt
—“Keep up your hand, please; it drops more and more. Are
you used to standing for artists?”
Everitt felt that he reddened.
“I have not been standing lately, signorina,” he stammered.
“So I thought,” returned Bell, inexorably. Silence followed
for a time; then Kitty put her easel on one side.
“That will do for to-day,” she said. “I don’t think you can go
on longer. Perhaps to-morrow you will be better able to
stand, and pray be more punctual.”
“To-morrow, signorina?” faltered Everitt. This was too much.
“Yes, to-morrow. Are you engaged?”
“I am engaged every day this week.”
“Every day? Oh, how tiresome! how very tiresome! What
can we do?”
“Is it to Mr Everitt?” inquired Bell, applying a little
turpentine to a spot of paint on her dress.
“Signorina, yes.”
64. “Do you know, I think he will let you off?” she said, raising
her head and regarding him calmly. “I am almost sure of it.”
“Do you think so?” cried Kitty, joyfully. “Then,”—to Everitt
—“will you ask him? Ask him to let you come, at any rate,
to-morrow; and we will leave it in this way, that if he cannot
spare you he will let us know.”
“But I think you will be here,” repeated Bell, in the same
assured tone.
65. Chapter Three.
A Second Venture.
As Everitt walked home he was a prey to many conflicting
feelings. It must be owned that he had entered upon this
freak of his in a very inconsequent manner; he had not so
much as reflected what results might not grow out of the
necessity for repeating it. Moreover, he had lost the first
sense of amusement in his masquerade, and hated the
business. Why on earth had he not accepted Mrs
Marchmont’s proposal, gone with her to see Miss Lascelles,
and avoided this extremely false position in which he had
planted himself?
Why, indeed!
As it was, it was with a feeling of rage that he thought of
the next day, when he would be expected to stand up again
before her—like a fool, as he said bitterly. Besides, it was a
great deal more uncomfortable than he had expected—he
was still cramped and stiff from the position. He made a
swift resolution to have nothing more to do with it. It was
easy enough to write a letter, as coming from him—Everitt—
to say that the model could not be spared, but that he
would do his best to send her another in a day or two. That
was certainly what he would do.
The relief of the decision did not, however, last long.
It was all very well to throw up the engagement, but was it
fair upon Miss Lascelles? Everitt knew by experience that
one model was by no means the same as another, and, as
artist, he found his solution questionable. Also, he now felt
an insurmountable objection to introducing the real
66. Giuseppe to that little studio—it had an air of desecration
repugnant to his good taste, if to nothing more. And thirdly,
in spite of fooling, in spite of cramps, it must be owned he
had a lurking desire to find himself there again; the
homeliness of the place, its old-fashioned solidity, its
mellow brick, its sunshine, its trees, its birds, its
associations—one and all had, as he was obliged to
acknowledge, taken a certain hold on his imagination. The
girls were merely an accident—a pleasant and harmonious
accident, it is true—but their surroundings had an
extraordinary fascination; he could not reconcile himself to
have no second peep at them. Mrs Marchmont might no
doubt take him there if he announced himself as penitent
for rejection of her good offices; stupidly enough, however,
he had effectually shut himself out, since the risk of
discovery in going to call upon the lady who has been
painting you in an assumed character was rather more than
even his audacity could face.
It appeared, under all these circumstances, as if the best
thing he could do was to figure as a ruffian once more.
“It will be a lesson to me,” he said, with a half laugh, “even
if fate lets me off this time without playing me a scurvy
trick.”
Fate spared him. He got into his studio unseen of Hill or
Jack. Jack came thundering at his door not three minutes
after he had changed his clothes.
“A pretty fellow you are!” he began indignantly, when
Everitt let him in. “Out larking all this morning, while we
poor wretches toil and slave! And down upon me for taking
an hour now and then! Where have you been?”
“Find out,” said Everitt, grimly.
67. “A polite way of suggesting that I should mind my own
business. Well, it’s my turn now. I’m off. But as I am more
civil than you, I will inform you that I am going to study
effects on the Thames. Silvery reaches, sweeping clouds—
all that style of thing. Excellent practice, isn’t it?”
“Oh, excellent,” Everitt said in the same tone; “especially
studied as you will study them. What a fool you are, Jack,
to fling away your chances!”
“Turn and turn about,” said Jack. “It’s a heavenly day, and
you’ve had your go at it. I’m off.”
He marched away, stopped at the door, scrawled a spirited
charcoal caricature of Everitt on a spare board, ducked to
avoid a mahl-stick which was promptly flung at his head,
and whistled himself out of hearing.
“Pont-aven,” reflected Everitt. But somehow the notion of
the little fishing-village, with its colony of artists, its wealth
of models, its picturesque points, its wind-tossed seas, had
lost a charm which the day before had seemed, irresistible.
It might be good for Jack, it might not. He had that talent
for idleness which can extract it under almost any pressure
of circumstances. It was exceedingly likely that he would
succeed in amusing himself very well at Pont-aven—
probably learn to handle a boat like a native, and all the
while avoid steady work with all his present ingenuity. In
that case, there was not much use in going. Of his
yesterday’s wish to be off on his own account, of his
sickening over his Saturdays, of his general impatience with
London—Everitt remembered nothing. It seemed to him, on
the contrary, that few places were so good to live in, and he
hoped that Mary Marchmont might come again on Saturday.
Then he looked round upon his walls with dissatisfaction.
There were beautiful and costly things hanging about in
68. finely harmonised colours, rich curtains, ancient rugs, and
Arabic lamps; there were choice pictures, and two or three
admirable bronzes from a neighbouring studio; but it
seemed to him that, in spite of the value of these things
and their artistic beauty, the place had no touch of the
charm which belonged to the little room in which he had
found himself that morning—a room which was so simple,
so unassuming, and so cheerful!
In short, it was evident that he had received an impression.
This was all very well, but it was equally evident that he
could not have produced one, except in the character of a
ruffian; and that, moreover, he had himself cut away the
ground from under his feet. It is true he did not get so far
as to admit that this gave him more than a general reason
for annoyance, but he did feel that a good-natured impulse
had placed him in a hateful position from which he could not
even now retire.
Then his model arrived, and he flung himself into his
painting, and kept the other subject out of his head, except
that he had never been so merciful in the matter of rests.
He dined out, and the first person he saw on entering the
room was Mrs Marchmont. She came towards him very
cordially.
“You were as good as your word, and sent the dreadful
man.”
“Did Miss Lascelles say that he was dreadful?” asked Everitt,
flattering himself that he spoke indifferently.
“Bell told me he had a very fierce expression. I have not
seen Kitty. But it was nice of you to take the trouble.”
69. “Oh,” said he, a little spitefully, “I had promised a ruffian.”
“You had,” she said. “Do you find people always carry out
their promises? I don’t.”
“I sometimes wish they wouldn’t,” he retorted. “But this
Miss Lascelles—what has attracted you so much towards
her?”
“No one could help it,” she said. “I should like you to meet
her, and then you would understand what I mean.”
“Evidently she would be dangerous,” he said, shaking his
head. “I daren’t risk it. Has she a father, or any one
belonging to her?”
“Of course she has a father,” she replied, “Women don’t hold
military appointments yet. A very nice, particular father—
Oh, here is Bell!”
She hurried across the room. Everitt remaining behind with
very unenviable feelings. It seemed a particularly bad piece
of luck that Miss Aitcheson and her father should appear at
this party; for already he was not free from the suspicion
that she had recognised him. There was nothing for it but to
brazen it out. He strolled across the room towards her; but
at this moment dinner was announced, and his course was
diverted. At dinner they were on the same side, out of sight
of each other; then he began to reflect that with a large
party in a double drawing-room a little management might
prevent any actual contact.
When the ladies had gone. Colonel Aitcheson came over to
speak to Marchmont, who was near Everitt. Everitt would
have drawn off, but that Marchmont made some remark to
him, and Colonel Aitcheson faced round, shoulders and all.
70. “You must excuse me, sir, but your face is extraordinarily
familiar to me.”
Everitt bowed.
Marchmont hastened to introduce him. “Perhaps you know
the name?”
“Not at all, not at all. I’ve no head for names—forget my
own some days; but a face is another sort of thing—never
forget a face.” He threw his head back and looked
frowningly at Everitt. “I could have sworn I’d seen you
somewhere lately, eh? Well, it’s odd, it’s odd. I must ask
Bell.”
“I dare say you’re right,” Everitt said coolly. “I’m about a
good deal.”
Upstairs he took some pains to barricade himself in a
subdued corner, as remote as possible from Miss Aitcheson,
and made such unusual efforts for the entertainment of the
young ladies who were round him, and whom he earnestly
desired might stay, that he gained quite a new character for
agreeability. Unfortunately, his hostess routed him from his
retreat—some lady was anxious to make his acquaintance.
When this was over he found his cousin at his elbow, and
close to her was Bell.
“You haven’t been very nice to me tonight,” said Mrs
Marchmont; “and it is too late now, for we are going. But
you may talk a little to Bell about pictures. You can be very
intelligent, can’t you, Bell? Good night.”
Everitt felt desperate.
“You paint, I suppose?” he inquired, “A little,” she said
demurely. “Figures.” He looked keenly at her, but she was
71. engaged in examining a gold bangle on her arm.
“That,” he said, “is ambitious.”
“And often disheartening,” she returned carelessly. “My
experience of London models has not been very
satisfactory.”
“No?” he said in the same tone. “Well, I suspect the
experience of a good many artists goes along with yours.
Where is your studio?”
“I have none. You see I am not ambitious, after all. When I
paint it is with my friend, Miss Lascelles, whom, I think, you
know?”
Was it a chance thrust, or a well-directed blow?
“I have seen Miss Lascelles,” said Everitt coolly.
She glanced at him as he spoke, then, as it seemed to him,
rather forcibly changed the subject. She left him, however,
in a state of perplexity; he found it impossible to decide
whether she were utterly unsuspecting or very well
informed. Under these circumstances it might have been
supposed that Everitt would have again gone through the
pros and cons which had already assailed him, and have
found a few more prudential reasons for abandoning to-
morrow’s scheme. This was not the case. He had rather an
obstinate trick of sticking to the thing to which he had once
committed himself: it had its merits and its dangers, but it
might be called a characteristic.
When the morning came, matters did not go so smoothly as
on the preceding day. Jack Hibbert was seized with the fit of
remorseful industry which afflicted him on the rarest
possible occasions. He came at an unheard-of hour to the
72. studio, and Everitt had all the difficulty in the world to get
rid of him. He must ask no end of inconvenient questions—
what had become of the Italian, and how bad Everitt filled
his place with Miss Lascelles? Then, seized with unusual
meekness, he begged advice, and wanted his last picture
looked over; next, he was scandalised at hearing that
Everitt was going out again for the morning; finally, he
besought that he might work in his friend’s studio upon a bit
of tapestry which took his fancy. All these attacks had to be
parried, the indignant Jack had with immense difficulty to
be got out of the way; then Everitt dressed himself as
rapidly as he could. He took pains about his lace; a few
adroit touches he trusted modified the risk of detection, and
might baffle Miss Aitcheson. As cautiously as before he
reconnoitred the court, but with Jack about there was more
difficulty in escaping, and he had not reached the entrance
when he heard a cheerful hail, which was evidently intended
for his ears. There was no help for it, Everitt took to his
heels and fled, bolting across the road and down a side-
street, to the great astonishment of the beholders.
All this had taken time—he was late again, and Miss
Lascelles greeted him with a little reproach, which it must
be owned did not affect him; for he was merely conscious of
an extreme pleasure in finding himself again alone with her.
He had been curious enough to know whether his first day’s
impressions were altogether correct, whether they
depended upon their unexpectedness, or on some merely
subtle atmospheric charm. This second day they were
stronger. The room seemed to be more delightful, its simple
grace more apparent; it improved with familiarity, as the
best things improve. And for Miss Lascelles herself, there
was a delicate sweet freshness about her, which he did not
attempt to analyse or put into words, only he was dimly
conscious that it gave him a dreamy pleasure, and that he
liked to watch the deft movements of her hand as she
73. painted. He lost himself sufficiently in their contemplation to
forget fatigue, and to stand more steadily than on the
previous day; but there was something he had to say, and
he seized the opportunity of the first rest.
“Signorina!”
She was softly singing to herself, and looked up with a
start.
“I am too much engaged to come again. Mr Everitt says,
will the signorina kindly finish what is necessary, and he will
send another model in the same costume.”
She did not immediately answer; when she did it was to ask
—
“Is not the costume yours?”
“Signorina, yes.”
“I did not know you lent your clothes to one another.”
Everitt muttered something about not wanting that
particular costume this week, and she went on to inquire in
what character he was sitting for Mr Everitt, to which he
had to reply that he did not know. She followed this up by
asking a good many questions about himself, to which he
responded in a deprecatory manner, though he was
conscious of dangerously dropping the stupid vacancy
behind which he had at first entrenched himself. Everitt,
indeed, who had gone through a succession of London
seasons without a heartache, had fallen a helpless victim in
a few hours. There was an extraordinary fascination for him
in this girl and her surroundings; he watched her furtively,
called himself a fool for being there, and would not have
been anywhere else for the world.
74. Once she flung up the window and leaned out, resting on
her finger-tips, to call to the children, who this time had
Sandy with them in the garden. She was greeted by a
shout.
“Come out, Kitty! Leave that stupid old painting. It’s lovely
out-of-doors.”
She laughed and shook her head.
“Kitty, I want something out of your garden.”
“What?”
“That pink flower.”
“Oh, you robber! Well, you may have it, but move it very
carefully, and give it plenty of water. Where’s mother?”
“Gone to the infirmary to see old Dickson. Kitty!” in a
pleading voice.
“No; I can’t spare any more. My poor garden will be bare.”
“Only a clump of forget-me-nots. Yours are such beauties!”
She drew back laughing, and shut the window. For the first
time Everitt regretted the absence of Miss Aitcheson. Had
she been here Kitty, might have gone on talking, and he
thought her voice the prettiest that he had ever heard; but,
after all, though he was unconscious of it, it was her silent
presence, and the opportunity for imagination which it
afforded him, which momentarily strengthened the spell. As
for not seeing her again, that idea had vanished for ever.
See her he would, at whatever risk; and even the waiting a
few days—to which prudence, driven from all her
strongholds, fell back upon at the last—seemed a miserable
75. concession, to which it was more than doubtful if he would
yield. Why, in those few days some other man might come
to the front!
It will be seen that Everitt was very far gone indeed.
He was trying to forget the stiffness of his arm, and he had
quite succeeded in forgetting Miss Aitcheson when she came
in.
“Oh, Bell!” reproachfully from Kitty.
“Yes, my dear, it’s too tiresome! But father has taken this
fancy for coming with me, and he has kept me waiting for
ages. I made Hugh walk with me, after all, and it is too late
for any painting, and I am very much disappointed.”
“Yes,” said Kitty regretfully, “it is too late. The time is up.”
To Everitt—“You can go now, and please tell Mr Everitt that I
am sorry you cannot come again. Oh, and I will pay you.”
Pay! Horrible humiliation, of which he had never thought,
and yet which he dared not refuse! He murmured
something about waiting, but Kitty had already her little
purse in her hand, and was counting out the shillings. It
seemed to him as if he hardly knew where he was, as he
went out of the room with reluctant feet, and down the oak
staircase into the ground between the house and the
Hospital, where the old men stood about or sat in the
warmly sheltered corners.
76. Chapter Four.
Discovery.
Kitty Lascelles watched her model out of the room with
some intentness. When she turned away at last, she gave a
little troubled sigh, and looked at Bell, standing before her
picture. Bell answered the look by an extremely brief
question. “Well?”
“Bell,” said the other girl, in a very low voice, “does it strike
you that there is anything odd about that—Italian?”
“Odd?” repeated Bell.
“I can’t make him out,” said Kitty, uneasily. “It must be
fancy, of course, but still I don’t really think he is quite what
he seems.”
“In what way?”
“You’ll laugh, Bell, but—do you think he looks like a
common man? He doesn’t talk like one, at any rate. I think
it is just as well he is not coming again. I—”
“Well,” interrupted her friend, “what do you say to his
hands?”
“Then, that struck you too?” exclaimed Kitty eagerly. “Why
what is it?”
For Bell had flung herself into a chair in a sudden paroxysm
of laughter, so long and so unchecked that for a time she
could not speak.
77. “So you suspect at last?” she cried. “Oh, Kitty, Kitty!”
“What do you mean?” cried the girl. “Bell, I shall shake you
if you are so dreadfully silly. What do you mean? What do
you know? Oh, Bell, don’t be provoking!”
“But I want you to guess. I shan’t tell you until you have
had at least six guesses. Who do you suppose—only you
never will suppose, that’s the worst of it!—still, who, of all
unlikely persons, has been your model?”
Kitty drew herself up.
“I don’t know; and if you knew and did not tell me, I am not
sure that I shall ever forgive you.”
This terrible threat appeared in no way to disconcert her
friend.
“Guess.”
Kitty shook her head, and walked to the window.
“Come back, or I won’t tell you.”
Kitty hesitated; then marched back.
“Tell me directly.”
“It was Mr Everitt himself.”
“Bell!”
The hot colour surged up all over the girl’s face and throat;
after that one word, she stood speechless. Her model Mr
Everitt, the painter—the great painter, as she called him! It
was impossible, impossible! But Bell’s amusement was
intense, “I don’t know that I should have told you yet, if
78. you had not suspected something in that innocent little way
of yours. Still, it was almost more than I could keep to
myself; and oh, Kitty, imagine the situation when last night
I met him at a dinner-party!”
But Kitty did not laugh.
“Bell,” she said gravely, “I can’t believe it. I am sure you
must be making some extraordinary mistake.”
“My dear, I am quite, quite certain. Why, even my father,
who only saw him here yesterday, fidgeted all last night
about some likeness. I didn’t say a word. It wouldn’t do
with papa.”
“It will not do with any of us,” said Kitty, with spirit.
“You won’t tell your father?”
“I shall tell mother, and she can act as she likes.”
“Take care,” said Bell, more seriously. “You don’t want a
regular fuss to grow out of a bit of absurdity. What has he
done?”
“He has come here in a false position and under false
pretences. I think it dreadful. What could make him behave
so?”
“Shall I tell you what I believe? That it was laziness or
good-nature. I dare say he forgot all about the model, and
then was afraid you would be awfully disappointed. Mrs
Marchmont said so much about it. It is all over now, and
remember, he did his utmost to get out of coming to-day.”
“Mother must judge.”
79. “Well, I think you are extremely hard on the poor man. You
would not have liked it at all if you had waited through
yesterday morning and had no model. I am sure he was
very uncomfortable himself.”
“And that was the reason he stood so badly!” cried Kitty. “I
hope he was uncomfortable.”
“Kitty,” said Bell earnestly, “if I were you I would say
nothing about it. You don’t know what mischief you may set
going. It is over and done with; he is not coming again, and
if you appear to remain in ignorance, you will be in a far
more dignified position than if our fathers bring a clatter
about his ears. If he really took the character in order to do
you a kindly turn, it will be very ungrateful of you to
damage his reputation.”
“Then, you allow,” said Kitty, with her head thrown back,
“that it is damaging?”
“I think he has done a thing which might tell against him
immensely; but I don’t think a scrap the worse of him
myself. There!” said Bell.
Kitty was silent, but there was that in her face which did not
satisfy the other girl.
“I believe you are dreadfully unforgiving,” she said. As she
spoke, she walked to the window and knelt on the low
window-seat. Kitty followed her, looking pale.
“Bell, I really am vexed. I think it is particularly
unfortunate,” she said. “You know that it has cost father a
great deal to let me have my way, and make a profession of
my painting; there have been a dozen lions in the way at
least. But such a lion as this never entered our heads. Don’t
you see that if he hears of a gentleman dressing up and
80. coming here as a model, there will be an end of everything?
Supposing, even, that it is as you say, a mere good-natured
freak, do you think that he is likely to understand it in that
light?”
There was a pause; then Bell said slowly—
“And yet you would tell him?”
The girl’s colour rose.
“Yes,” she said very proudly; “whatever comes of it, he shall
never say that I have deceived him. I shall tell mother, and
she will do what is best.”
“Whenever,” murmured her companion—“whenever you
sweet-tempered people take the bit between your teeth, I
have noticed that it is absolutely hopeless to attempt to
turn you. Well. Kitty, since you are determined to set a
torch to the gunpowder, I hope we shan’t all go up with the
explosion. My father is good for a magnificent fizz. I hear
him now in the passage.”
Another moment saw him in the room, and with him came
Mrs Lascelles, a large, kindly-faced woman, in whose brown
eyes gleamed the same clear brightness which met you in
her daughter’s. The old colonel was as stormily benevolent
as usual.
“So you gave me the slip after all, eh, Miss Bell? I’ve just
been telling your godmother that she hasn’t brought you up
well; little Kitty here would never dare to be so undutiful.
Eh? I met your precious rascal of an Italian close by here;
can’t think how you admit such a fellow within the gates. I
stopped him, but he was as sulky as a bear. I have it,
though, I have it!” he cried, slapping his thigh; “to be sure!
That’s the man the painter-fellow last night was like. What
81. was he called?—Egerton—Elliott—friend of Marchmont’s,
you know, Bell. ’Pon my word, the most extraordinary
likeness, eh, Bell, eh?”
“There was a likeness, certainly,” said his daughter calmly.
“A likeness! This man is his double. It’s been annoying me
all the night. I never will be beaten by a likeness.”
“But I hope the model is not such a disreputable being as
you describe,” said Mrs Lascelles, a shade of anxiety in her
voice. “If he is, it cannot be very pleasant for you, Kitty.”
“He behaved well enough,” said the girl, in a low voice.
“And he is not coming again; he has not the time to spare,”
Bell said cheerfully. “Kitty has been very successful with
him, and ought to be exceedingly obliged. Look, Mrs
Lascelles!”
“Obliged!” grumbled her father. “The fellow gets paid, eh?
Well, upon my word, that’s not at all bad, Kitty. I tell you
what I’ll give you your first order, and I’ll sit for you myself.
Then you needn’t have those fellows sneaking about the
place. They’ll be bringing dynamite one of these days. If I
were Lascelles I wouldn’t stand it—I wouldn’t stand it.”
“Father,” said Bell promptly, “I’m ashamed of you! You’re
only saying this to tease Kitty, and she’s just as white as a
ghost already. Come home with me at once; and, Kitty,
don’t you think about anything that he has said.”
Then she flung herself upon her friend, and kissed her with
the warmth which marks a certain phase in young ladies’
friendships.
82. Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com