0% found this document useful (0 votes)
5 views56 pages

68499

The document provides information on various SAS programming resources, including the 'Step-by-Step Programming with Base SAS 9.4, Second Edition' and other SAS certification prep guides. It includes links for downloading these resources and outlines the contents of the SAS documentation. Additionally, it emphasizes the importance of copyright and legal usage of the materials.

Uploaded by

adppwtfjm0600
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views56 pages

68499

The document provides information on various SAS programming resources, including the 'Step-by-Step Programming with Base SAS 9.4, Second Edition' and other SAS certification prep guides. It includes links for downloading these resources and outlines the contents of the SAS documentation. Additionally, it emphasizes the importance of copyright and legal usage of the materials.

Uploaded by

adppwtfjm0600
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Step by Step Programming with Base SAS 9 4

Second Edition Sas Institute download

https://textbookfull.com/product/step-by-step-programming-with-
base-sas-9-4-second-edition-sas-institute/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

SAS Certification Prep Guide Base Programming for SAS 9


4th Edition Sas Institute

https://textbookfull.com/product/sas-certification-prep-guide-
base-programming-for-sas-9-4th-edition-sas-institute/

SAS Certified Specialist Prep Guide Base Programming


Using SAS 9 4 Sas

https://textbookfull.com/product/sas-certified-specialist-prep-
guide-base-programming-using-sas-9-4-sas/

SAS certification prep guide base programming for SAS 9


Fifth Edition. Edition Sas Sas Sas

https://textbookfull.com/product/sas-certification-prep-guide-
base-programming-for-sas-9-fifth-edition-edition-sas-sas-sas/

Python Programming A Step By Step Guide From Beginner


To Advance Second Edition Eddison

https://textbookfull.com/product/python-programming-a-step-by-
step-guide-from-beginner-to-advance-second-edition-eddison/
Learn to Program with Python 3: A Step-by-Step Guide to
Programming Irv Kalb

https://textbookfull.com/product/learn-to-program-with-
python-3-a-step-by-step-guide-to-programming-irv-kalb/

Learn to Program with Python 3: A Step-by-Step Guide to


Programming, 2nd Edition Irv Kalb

https://textbookfull.com/product/learn-to-program-with-
python-3-a-step-by-step-guide-to-programming-2nd-edition-irv-
kalb/

ANSI C Programming Learn ANSI C Step by Step 1st


Edition Yashavant Kanetkar

https://textbookfull.com/product/ansi-c-programming-learn-ansi-c-
step-by-step-1st-edition-yashavant-kanetkar/

Serial Attached SCSI 4 SAS 4 r10b 6777

https://textbookfull.com/product/serial-attached-
scsi-4-sas-4-r10b-6777/

Visual Basic For Kids A Step by Step Computer


Programming Tutorial Philip Conrod

https://textbookfull.com/product/visual-basic-for-kids-a-step-by-
step-computer-programming-tutorial-philip-conrod/
Step-by-Step Programming with
Base SAS 9.4 ®

Second Edition

SAS Documentation
®
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2016. Step-by-Step Programming
with Base SAS® 9.4, Second Edition. Cary, NC: SAS Institute Inc.
Step-by-Step Programming with Base SAS® 9.4, Second Edition
Copyright © 2016, SAS Institute Inc., Cary, NC, USA
ISBN 978-1-62959-894-9 (Hard copy)
ISBN 978-1-62960-806-8 (PDF)
All Rights Reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission
of the publisher, SAS Institute Inc.
For a web download or e-book: Your use of this publication shall be governed by the terms established by the
vendor at the time you acquire this publication.
The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of
the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not
participate in or encourage electronic piracy of copyrighted materials. Your support of others’ rights is appreciated.
U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer
software developed at private expense and is provided with RESTRICTED RIGHTS to the United States
Government. Use, duplication, or disclosure of the Software by the United States Government is subject
to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR
227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S. federal law, the minimum restricted
rights as set out in FAR 52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provision serves as notice under
clause (c) thereof and no other notice is required to be affixed to the Software or documentation. The Government’s
rights in Software and documentation shall be only those set forth in this Agreement.
SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414
November 2016
SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
SAS software may be provided with certain third-party software, including but not limited to open-source software,
which is licensed under its applicable third-party software license agreement. For license information about third-
party software distributed with SAS software, refer to http://support.sas.com/thirdpartylicenses.
9.4-P2:basess
Contents

About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii


What’s New in Step-by-Step Programming with Base SAS 9.4 . . . . . . . . . . . . . . . . . . . xix
Accessibility Features of Step-by-Step Programming with Base SAS 9.4 . . . . . . . . . . . xxi

PART 1 Introduction to the SAS System 1

Chapter 1 • What is the SAS System? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


Introduction to the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Components of Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Output Produced by the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Ways to Run SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Running Programs in the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . 13
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Chapter 2 • Working with Output Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17


Working with Output Defaults Starting in SAS 9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

PART 2 Getting Your Data into Shape 25

Chapter 3 • Introduction to DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27


Introduction to DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The SAS Data Set: Your Key to the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
How the DATA Step Works: A Basic Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Supplying Information to Create a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

Chapter 4 • Starting with Raw Data: The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51


Introduction to Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Examine the Structure of the Raw Data: Factors to Consider . . . . . . . . . . . . . . . . . . . . 52
Reading Unaligned Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Reading Data That Is Aligned in Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Reading Data That Requires Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Reading Unaligned Data with More Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Mixing Styles of Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Chapter 5 • Starting with Raw Data: Beyond the Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71


Introduction to Beyond the Basics with Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Testing a Condition Before Creating an Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Creating Multiple Observations from a Single Record . . . . . . . . . . . . . . . . . . . . . . . . . 73
Reading Multiple Records to Create a Single Observation . . . . . . . . . . . . . . . . . . . . . . 77
iv Contents

Problem Solving: When an Input Record Unexpectedly Does Not


Have Enough Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

Chapter 6 • Starting with SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91


Introduction to Starting with SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Understanding the Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Reading Selected Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Reading Selected Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Creating More Than One Data Set in a Single DATA Step . . . . . . . . . . . . . . . . . . . . . . 99
Using the DROP= and KEEP= Data Set Options for Efficiency . . . . . . . . . . . . . . . . . 101
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

PART 3 Basic Programming 105

Chapter 7 • Understanding DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107


Overview of DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Adding Information to a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Defining Enough Storage Space for Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Conditionally Deleting an Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

Chapter 8 • Working with Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117


Introduction to Working with Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
About Numeric Variables in SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Calculating with Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Comparing Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Storing Numeric Variables Efficiently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

Chapter 9 • Working with Character Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129


Introduction to Working with Character Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Identifying Character Variables and Expressing Character Values . . . . . . . . . . . . . . . 131
Setting the Length of Character Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Handling Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Creating New Character Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Saving Storage Space by Treating Numbers as Characters . . . . . . . . . . . . . . . . . . . . . 142
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

Chapter 10 • Acting on Selected Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147


Introduction to Acting on Selected Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Selecting Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Constructing Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Comparing Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Contents v

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

Chapter 11 • Creating Subsets of Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169


Introduction to Creating Subsets of Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Selecting Observations for a New SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Conditionally Writing Observations to One or More SAS Data Sets . . . . . . . . . . . . . . 175
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

Chapter 12 • Working with Grouped or Sorted Observations . . . . . . . . . . . . . . . . . . . . . . . . . . 183


Introduction to Working with Grouped or Sorted Observations . . . . . . . . . . . . . . . . . . 183
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Working with Grouped Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Working with Sorted Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

Chapter 13 • Using More Than One Observation in a Calculation . . . . . . . . . . . . . . . . . . . . . . . 199


Introduction to Using More Than One Observation in a Calculation . . . . . . . . . . . . . 199
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Accumulating a Total for an Entire Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Obtaining a Total for Each BY Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Writing to Separate Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Using a Value in a Later Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

Chapter 14 • Finding Shortcuts in Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215


Introduction to Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Input File and SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Performing More Than One Action in an IF-THEN Statement . . . . . . . . . . . . . . . . . . 217
Performing the Same Action for a Series of Variables . . . . . . . . . . . . . . . . . . . . . . . . . 219
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

Chapter 15 • Working with Dates in the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225


Introduction to Working with Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Understanding How SAS Handles Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Entering Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Displaying Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Using Dates in Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Using SAS Date Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Comparing Durations and SAS Date Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

PART 4 Combining SAS Data Sets 247

Chapter 16 • Methods of Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249


Introduction to Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Definition of Concatenating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
vi Contents

Definition of Interleaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250


Definition of Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Definition of Updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Definition of Modifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Comparing Modifying, Merging, and Updating Data Sets . . . . . . . . . . . . . . . . . . . . . . 254
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255

Chapter 17 • Concatenating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257


Introduction to Concatenating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Concatenating Data Sets with the SET Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Concatenating Data Sets By Using the APPEND Procedure . . . . . . . . . . . . . . . . . . . . 274
Choosing between the SET Statement and the APPEND Procedure . . . . . . . . . . . . . . 278
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

Chapter 18 • Interleaving SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281


Introduction to Interleaving SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Understanding BY-Group Processing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Interleaving Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

Chapter 19 • Merging SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289


Introduction to Merging SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Understanding the MERGE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
One-to-One Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Match-Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Choosing between One-to-One Merging and Match-Merging . . . . . . . . . . . . . . . . . . . 310
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

Chapter 20 • Updating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317


Introduction to Updating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Understanding the UPDATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Understanding How to Select BY Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Updating a Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Updating with Incremental Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Understanding the Differences between Updating and Merging . . . . . . . . . . . . . . . . . 326
Handling Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

Chapter 21 • Modifying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335


Introduction to Modifying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Modifying a SAS Data Set: The Simplest Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Modifying a Master Data Set with Observations from a Transaction Data Set . . . . . . 338
Understanding How Duplicate BY Variables Affect File Update . . . . . . . . . . . . . . . . 343
Handling Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

Chapter 22 • Conditionally Processing Observations from Multiple SAS Data Sets . . . . . . . . 349
Introduction to Conditional Processing from Multiple SAS Data Sets . . . . . . . . . . . . 349
Input SAS Data Sets for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Determining Which Data Set Contributed the Observation . . . . . . . . . . . . . . . . . . . . . 353
Contents vii

Combining Selected Observations from Multiple Data Sets . . . . . . . . . . . . . . . . . . . . 358


Performing a Calculation Based on the Last Observation . . . . . . . . . . . . . . . . . . . . . . 359
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

PART 5 Debugging SAS Programs 363

Chapter 23 • Analyzing Your SAS Session with the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Introduction to Analyzing Your SAS Session with the SAS Log . . . . . . . . . . . . . . . . . 366
Understanding the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Locating the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Understanding the Log Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Writing to the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Suppressing Information in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Changing the Appearance of the Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388

Chapter 24 • Directing SAS Output and the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391


Introduction to Directing SAS Output and the SAS Log . . . . . . . . . . . . . . . . . . . . . . . 391
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Routing the Output and the SAS Log with PROC PRINTTO . . . . . . . . . . . . . . . . . . . 393
Storing the Output and the SAS Log in the SAS Windowing Environment . . . . . . . . 395
Redefining the Default Destination in a Batch or Noninteractive Environment . . . . . 396
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398

Chapter 25 • Diagnosing and Avoiding Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399


Introduction to Diagnosing and Avoiding Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Understanding How the SAS Supervisor Checks a Job . . . . . . . . . . . . . . . . . . . . . . . . 400
Understanding How SAS Processes Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Distinguishing Types of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Diagnosing Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Using a Quality Control Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412

Chapter 26 • Finding Logic Errors in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415


Finding Logic Errors in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Using the DATA Step Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Basic Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Using the Macro Facility with the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419

PART 6 Producing Reports 431

Chapter 27 • Producing Detail Reports with the PRINT Procedure . . . . . . . . . . . . . . . . . . . . . . 433


Introduction to Producing Reports with the PRINT Procedure . . . . . . . . . . . . . . . . . . 434
Input File and SAS Data Sets for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Creating Simple Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Creating Enhanced Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Creating Customized Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
viii Contents

Making Your Reports Easy to Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465


Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472

Chapter 28 • Creating Summary Tables with the TABULATE Procedure . . . . . . . . . . . . . . . . . 473


Introduction to Creating Summary Tables with the TABULATE Procedure . . . . . . . . 474
Understanding Summary Table Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Understanding the Basics of the TABULATE Procedure . . . . . . . . . . . . . . . . . . . . . . . 476
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Creating Simple Summary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Creating More Sophisticated Summary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499

Chapter 29 • Creating Detail and Summary Reports with the REPORT Procedure . . . . . . . . . 501
Introduction to Creating Detail and Summary Reports with the REPORT Procedure . 501
Understanding How to Construct a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Creating Simple Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Creating More Sophisticated Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527

PART 7 Producing Plots and Charts 529

Chapter 30 • Plotting the Relationship between Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531


Introduction to Plotting the Relationship between Variables . . . . . . . . . . . . . . . . . . . . 531
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Plotting One Set of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Enhancing the Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Plotting Multiple Sets of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549

Chapter 31 • Producing Charts to Summarize Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551


Introduction to Producing Charts to Summarize Variables . . . . . . . . . . . . . . . . . . . . . 552
Understanding the Charting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Charting Frequencies with the CHART Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Customizing Frequency Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Creating High-Resolution Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590

PART 8 Designing Your Own Output 593

Chapter 32 • Writing Lines to the SAS Log or to an Output File . . . . . . . . . . . . . . . . . . . . . . . . 595


Introduction to Writing Lines to the SAS Log or to an Output File . . . . . . . . . . . . . . . 595
Understanding the PUT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Writing Output without Creating a Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Writing Simple Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Contents ix

Writing a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603


Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611

Chapter 33 • Understanding and Customizing SAS Output: The Basics . . . . . . . . . . . . . . . . . 613


Introduction to the Basics of Understanding and Customizing SAS Output . . . . . . . . 614
Understanding Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Locating Procedure Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Making Output Informative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
Controlling Output Appearance of Listing Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
Controlling the Appearance of Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
Representing Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642

Chapter 34 • Understanding and Customizing SAS Output: The Output


Delivery System (ODS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
Introduction to Customizing SAS Output By Using the Output Delivery System . . . . 644
Input Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
Understanding ODS Output Formats and Destinations . . . . . . . . . . . . . . . . . . . . . . . . 645
Selecting an Output Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Creating Formatted Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Selecting the Output That You Want to Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
Customizing ODS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Storing Links to ODS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683

PART 9 Storing and Managing Data in SAS Files 685

Chapter 35 • Understanding SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687


Introduction to Understanding SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
What Is a SAS Library? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Accessing a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Storing Files in a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Referencing SAS Data Sets in a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694

Chapter 36 • Managing SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695


Introduction to Managing SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Choosing Your Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Understanding the DATASETS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
Looking at a PROC DATASETS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698

Chapter 37 • Getting Information about Your SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 701


Introduction to Getting Information about Your SAS Data Sets . . . . . . . . . . . . . . . . . 701
Input Data Library for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
Requesting a Directory Listing for a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
Requesting Contents Information about SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . 704
Requesting Contents Information in Different Formats . . . . . . . . . . . . . . . . . . . . . . . . 708
x Contents

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710

Chapter 38 • Modifying SAS Data Set Names and Variable Attributes . . . . . . . . . . . . . . . . . . . 713
Introduction to Modifying SAS Data Set Names and Variable Attributes . . . . . . . . . . 713
Input Data Library for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Renaming SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Modifying Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724

Chapter 39 • Copying, Moving, and Deleting SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 725


Introduction to Copying, Moving, and Deleting SAS Data Sets . . . . . . . . . . . . . . . . . 725
Input Data Libraries for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
Copying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
Copying Specific SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
Moving SAS Libraries and SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Deleting SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
Deleting All Files in a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737

PART 10 Understanding Your SAS Environment 739

Chapter 40 • Introducing the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741


Introduction to the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
Starting a SAS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Selecting a SAS Processing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751

Chapter 41 • Using the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753


Introduction to Using the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . 754
Getting Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
Finding Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Using SAS Windowing Environment Command Types . . . . . . . . . . . . . . . . . . . . . . . . 758
Working with SAS Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
Working with Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Working with Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
Working with SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
Working with Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792

Chapter 42 • Customizing the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793


Introduction to Customizing the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
Customizing Your Current Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
Customizing Session-to-Session Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
Customizing the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
Contents xi

PART 11 Appendix 811

Appendix 1 • Complete DATA Steps for Selected Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 813


Complete DATA Steps for Selected Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
The CITY Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
The UNIVERSITY_TEST_SCORES Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
The YEAR_SALES Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
The HIGHLOW Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
The GRADES Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
The USCLIM Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
The CLIMATE, PRECIP, and STORM Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820

Appendix 2 • DATA Step Debugger Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823


Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
xii Contents
xiii

About This Book

Syntax Conventions for the SAS Language

Overview of Syntax Conventions for the SAS Language


SAS uses standard conventions in the documentation of syntax for SAS language
elements. These conventions enable you to easily identify the components of SAS
syntax. The conventions can be divided into these parts:
• syntax components
• style conventions
• special characters
• references to SAS libraries and external files

Syntax Components
The components of the syntax for most language elements include a keyword and
arguments. For some language elements, only a keyword is necessary. For other
language elements, the keyword is followed by an equal sign (=). The syntax for
arguments has multiple forms in order to demonstrate the syntax of multiple arguments,
with and without punctuation.
keyword
specifies the name of the SAS language element that you use when you write your
program. Keyword is a literal that is usually the first word in the syntax. In a CALL
routine, the first two words are keywords.
In these examples of SAS syntax, the keywords are bold:
CHAR (string, position)
CALL RANBIN (seed, n, p, x);
ALTER (alter-password)
BEST w.
REMOVE <data-set-name>
In this example, the first two words of the CALL routine are the keywords:
CALL RANBIN(seed, n, p, x)
The syntax of some SAS statements consists of a single keyword without arguments:
DO;
xiv About This Book

... SAS code ...


END;
Some system options require that one of two keyword values be specified:
DUPLEX | NODUPLEX
Some procedure statements have multiple keywords throughout the statement syntax:
CREATE <UNIQUE> INDEX index-name ON table-name (column-1 <,
column-2, …>)
argument
specifies a numeric or character constant, variable, or expression. Arguments follow
the keyword or an equal sign after the keyword. The arguments are used by SAS to
process the language element. Arguments can be required or optional. In the syntax,
optional arguments are enclosed in angle brackets ( < > ).
In this example, string and position follow the keyword CHAR. These arguments are
required arguments for the CHAR function:
CHAR (string, position)
Each argument has a value. In this example of SAS code, the argument string has a
value of 'summer', and the argument position has a value of 4:
x=char('summer', 4);

In this example, string and substring are required arguments, whereas modifiers and
startpos are optional.
FIND(string, substring <, modifiers> <, startpos>
argument(s)
specifies that one argument is required and that multiple arguments are allowed.
Separate arguments with a space. Punctuation, such as a comma ( , ) is not required
between arguments.
The MISSING statement is an example of this form of multiple arguments:
MISSING character(s);
<LITERAL_ARGUMENT>argument-1<<LITERAL_ARGUMENT>argument-2 ... >
specifies that one argument is required and that a literal argument can be associated
with the argument. You can specify multiple literals and argument pairs. No
punctuation is required between the literal and argument pairs. The ellipsis (...)
indicates that additional literals and arguments are allowed.
The BY statement is an example of this argument:
BY <DESCENDING> variable-1 <<DESCENDING> variable-2 …>;
argument-1 <option(s)> <argument-2 <option(s)> ...>
specifies that one argument is required and that one or more options can be
associated with the argument. You can specify multiple arguments and associated
options. No punctuation is required between the argument and the option. The
ellipsis (...) indicates that additional arguments with an associated option are
allowed.
The FORMAT procedure PICTURE statement is an example of this form of multiple
arguments:
PICTURE name <(format-option(s))>
<value-range-set-1 <(picture-1-option(s))>
<value-range-set-2 <(picture-2-option(s))> …>>;
Syntax Conventions for the SAS Language xv

argument-1=value-1 <argument-2=value-2 ...>


specifies that the argument must be assigned a value and that you can specify
multiple arguments. The ellipsis (...) indicates that additional arguments are allowed.
No punctuation is required between arguments.
The LABEL statement is an example of this form of multiple arguments:
LABEL variable-1=label-1 <variable-2=label-2 …>;
argument-1 <, argument-2, ...>
specifies that one argument is required and that you can specify multiple arguments
that are separated by a comma or other punctuation. The ellipsis (...) indicates a
continuation of the arguments, separated by a comma. Both forms are used in the
SAS documentation.
Here are examples of this form of multiple arguments:
AUTHPROVIDERDOMAIN (provider-1:domain-1 <, provider-2:domain-2, …>
INTO :macro-variable-specification-1 <, :macro-variable-specification-2, …>
Note: In most cases, example code in SAS documentation is written in lowercase with a
monospace font. You can use uppercase, lowercase, or mixed case in the code that
you write.

Style Conventions
The style conventions that are used in documenting SAS syntax include uppercase bold,
uppercase, and italic:
UPPERCASE BOLD
identifies SAS keywords such as the names of functions or statements. In this
example, the keyword ERROR is written in uppercase bold:
ERROR <message>;
UPPERCASE
identifies arguments that are literals.
In this example of the CMPMODEL= system option, the literals include BOTH,
CATALOG, and XML:
CMPMODEL=BOTH | CATALOG | XML |
italic
identifies arguments or values that you supply. Items in italic represent user-supplied
values that are either one of the following:
• nonliteral arguments. In this example of the LINK statement, the argument label
is a user-supplied value and therefore appears in italic:
LINK label;
• nonliteral values that are assigned to an argument.
In this example of the FORMAT statement, the argument DEFAULT is assigned
the variable default-format:
FORMAT variable(s) <format > <DEFAULT = default-format>;

Special Characters
The syntax of SAS language elements can contain the following special characters:
xvi About This Book

=
an equal sign identifies a value for a literal in some language elements such as
system options.
In this example of the MAPS system option, the equal sign sets the value of MAPS:
MAPS=location-of-maps
<>
angle brackets identify optional arguments. A required argument is not enclosed in
angle brackets.
In this example of the CAT function, at least one item is required:
CAT (item-1 <, item-2, …>)
|
a vertical bar indicates that you can choose one value from a group of values. Values
that are separated by the vertical bar are mutually exclusive.
In this example of the CMPMODEL= system option, you can choose only one of the
arguments:
CMPMODEL=BOTH | CATALOG | XML
...
an ellipsis indicates that the argument can be repeated. If an argument and the ellipsis
are enclosed in angle brackets, then the argument is optional. The repeated argument
must contain punctuation if it appears before or after the argument.
In this example of the CAT function, multiple item arguments are allowed, and they
must be separated by a comma:
CAT (item-1 <, item-2, …>)
'value' or "value"
indicates that an argument that is enclosed in single or double quotation marks must
have a value that is also enclosed in single or double quotation marks.
In this example of the FOOTNOTE statement, the argument text is enclosed in
quotation marks:
FOOTNOTE <n> <ods-format-options 'text' | "text">;
;
a semicolon indicates the end of a statement or CALL routine.
In this example, each statement ends with a semicolon:
data namegame;
length color name $8;
color = 'black';
name = 'jack';
game = trim(color) || name;
run;

References to SAS Libraries and External Files


Many SAS statements and other language elements refer to SAS libraries and external
files. You can choose whether to make the reference through a logical name (a libref or
fileref) or use the physical filename enclosed in quotation marks. If you use a logical
name, you typically have a choice of using a SAS statement (LIBNAME or
FILENAME) or the operating environment's control language to make the reference.
Syntax Conventions for the SAS Language xvii

Several methods of referring to SAS libraries and external files are available, and some
of these methods depend on your operating environment.
In the examples that use external files, SAS documentation uses the italicized phrase
file-specification. In the examples that use SAS libraries, SAS documentation uses the
italicized phrase SAS-library enclosed in quotation marks:
infile file-specification obs = 100;
libname libref 'SAS-library';
xviii About This Book
xix

What’s New in Step-by-Step


Programming with Base SAS 9.4

Overview

Step-by-Step Programming with Base SAS 9.4 shows you how to create SAS programs
step by step. You are provided with conceptual information and examples that illustrate
the SAS concepts. You can execute the programs in this document and view the results.
This document contains the basic information that you need to begin writing and
debugging your SAS code.
The following enhancements have been made to the documentation:
• additional information about debugging SAS programs
• new method of concatenating SAS variables
• updated sections on Output Delivery System (ODS)
In the third maintenance release for SAS 9.4, the following enhancements have been
made to the documentation:
• discussion of the DSD option was added to the documentation about list input
• directions for viewing ODS style templates were updated (see “Customizing ODS
Output at the Level of a SAS Job” on page 667)
• discussion of the IN= data set option was added to the documentation about merging
data sets

Debugging SAS Programs

Additional information and examples of SAS log output have been added. Items in the
SAS log are explained so that you can more easily debug your own SAS programs.
Documentation for the DATA step debugger has been added. The DATA step debugger
is a tool that enables you to find logic errors in your program. A description of the tool
and examples are provided. A list of commands that you use with the debugger is also
provided.
xx Step-by-Step Programming

Concatenating SAS Variables

A preferred method of concatenating SAS variables has been introduced. You use the
CAT function to return a concatenated character string.

Output Delivery System (ODS)

The sections about the Output Delivery System (ODS) have been updated, and new
information has been added. ODS gives you greater flexibility in generating, storing, and
reproducing SAS procedure and DATA step output along with a wide range of
formatting options. ODS provides formatting functionality that is not available when
using individual procedures or the DATA step without ODS.
Beginning with SAS 9.3, the default destination in the SAS windowing environment is
HTML, and ODS Graphics is enabled by default. These new defaults have several
advantages. Graphs are integrated with tables, and all output is displayed in the same
HTML file using a new style. This new style, HTMLBlue, is an all-color style that is
designed to integrate tables and modern statistical graphics. The examples in this
document now show HTML output.
xxi

Accessibility Features of Step-by-


Step Programming with Base SAS
9.4

Overview
For information about the accessibility of Base SAS, see the SAS 9.4 Companion for
Windows.
xxii Accessibility Features of Step-by-Step Programming with Base SAS 9.4
1

Part 1

Introduction to the SAS System

Chapter 1
What is the SAS System? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Chapter 2
Working with Output Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2
3

Chapter 1
What is the SAS System?

Introduction to the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


Components of Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Overview of Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Data Management Facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Data Analysis and Reporting Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Output Produced by the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Traditional Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Output from the Output Delivery System (ODS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Ways to Run SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Selecting an Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
SAS/ASSIST Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Noninteractive Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Batch Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Interactive Line Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Running Programs in the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . 13
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Introduction to the SAS System


SAS is an integrated system of software solutions that enables you to perform the
following tasks:
• data entry, retrieval, and management
• report writing and graphics design
• statistical and mathematical analysis
• business forecasting and decision support
• operations research and project management
• applications development
4 Chapter 1 • What is the SAS System?

How you use SAS depends on what you want to accomplish. Some people use many of
the capabilities of the SAS System, and others use only a few.
At the core of the SAS System is Base SAS software, which is the software product that
you will learn to use in this documentation. This section presents an overview of Base
SAS. It introduces the capabilities of Base SAS, addresses methods of running SAS, and
outlines various types of output.

Components of Base SAS Software

Overview of Base SAS Software


Base SAS software contains the following:
• a data management facility
• a programming language
• data analysis and reporting utilities
Learning to use Base SAS enables you to work with these features of SAS. It also
prepares you to learn other SAS products, because all SAS products follow the same
basic rules.

Data Management Facility


SAS organizes data into a rectangular form or table that is called a SAS data set. The
following figure shows a SAS data set. The data describes participants in a 16-week
weight program at a health and fitness club. The data for each participant includes an
identification number, name, team name, and weight (in U.S. pounds) at the beginning
and end of the program.

Figure 1.1 Rectangular Form of a SAS Data Set

variable

IdNumber Name Team StartWeight EndWeight

1 1023 David Shaw red 189 165

2 1049 Amelia Serrano yellow 145 124 observation

3 1219 Alan Nance red 210 192

4 1246 Ravi Sinha yellow 194 177 data value

5 1078 Ashley McKnight red 127 118

data value

In a SAS data set, each row represents information about an individual entity and is
called an observation. Each column represents the same type of information and is called
a variable. Each separate piece of information is a data value. In a SAS data set, an
observation contains all the data values for an entity; a variable contains the same type of
data value for all entities.
Exploring the Variety of Random
Documents with Different Content
“Yes!” was the reply, after the speaker had leaned over the invalid
for a moment. “He dozes again. That burst of emotion exhausted
him terribly, however, and it may be that he’ll never come to again.”

The clergyman made no answer, but clasping his hands, appeared


engaged in silent prayer.

In about ten minutes the dying man stirred again. His eyes were still
closed, but he murmured incoherently. At first his words were low
and disconnected, but gradually he spoke louder; and finally the
listeners distinguished parts of sentences. But whether he was
referring to the tragedy he had just detailed, or to some other, or
whether what he said was purely the effect of delirium, the hearers
could not ascertain.

“The pitiless villain,” were his words. “No mercy, no mercy. Oh! that I
had run him through when he proposed it. I broke her heart. Mary!
Mary! blessed saint,” he exclaimed piteously, “don’t look at me so
reproachfully.”

“He thinks she is already dead,” whispered the clergyman to the


assistant.

“Or perhaps there is still another,” was the low reply.

Tossing from side to side on the bed, working his fingers on the
counterpane, every lineament of his face betraying the terrible
mental agonies he was undergoing, Aylesford lay, a picture of
remorse which had come too late. As his broken ejaculations went
on it became evident that another person, as the surgeon had
hinted, now mingled in his thoughts with Miss Aylesford.

“Forgive me, Mary, forgive me,” he cried, clasping his hands, “I have
indeed deserted our child; but if I had known—if I had—”

Here his words sunk into indistinct babblings, all that could be
distinguished being the single phrase, “they call her his niece, you
know.”

He lay still for nearly a minute. Suddenly he sprang up again, glaring


wildly at the opposite part of the bed.

“Take him away,” he shrieked, in a voice that made the hair of his
hearers stand on end with horror, and was heard far away out across
the silence of the night; “his fingers almost touch me.”

He clung to the clergyman, as a child, when woke from a dream in


which it has seen horrible shapes, clings to its mother; his eyeballs
starting from their sockets, his features convulsed with agony, and
the perspiration exuding, like huge rain drops, over his clammy
forehead.

It was a scene, which those who were present, could never shake
off. The terrified countenance of the dying man, the despairing
clutch with which he held on to the chaplain, and the fixed, stony
gaze of horror which he fastened, as if on some object right across
the bed, and almost within reach; the whole rendered, for an
instant, visible with more than ordinary distinctness, as a burning
deck of one of the ships that was consuming, fell in, shooting a
quick, intense glare into the room.

“Oh! my God,” he cried, “they come; there is a hell.”

The piercing tone, almost amounting to a shriek; the awful look; the
gesture of horrible fear with which he shrank closer yet to the
clergyman; these no pen can adequately paint.

But in a moment, a convulsion passed over him; a deep breath was


heard, which was nearly stertorous; and he fell back into the
chaplain’s arms, stone dead.
CHAPTER XXXVI.
THE ESCAPE
This night methinks is but the daylight sick,
It looks a little paler; ‘tis a day,
Such as the day is when the sun is hid. —Shakespeare.

The whole air whitens with a boundless tide,


Of silver radiance, trembling round the world. —Thomson.

We must now return to Kate, whom we left a prisoner with the


outlaws, and momentarily in dread that she would be compelled to
sacrifice life in order to avert dishonor.

The debauch of the refugees at last came to an end. Not being a


witness of the scene, Kate could judge as to the manner of its
termination, only from the laugh of derision with which it was said
successively that another “was under the table.” Gradually the voices
of the speakers became so thick as to be undistinguishable; the
revelers apparently grew fewer and fewer, and finally a heavy fall
was heard, as of the last boon companion, followed by silence.

For a long while Kate listened, dreading lest she should hear some
one stir, for she dared not hope that sleep had overpowered the
whole gang. But five minutes passed without any one moving, then
ten, and then finally a half an hour. When this latter period had
elapsed she began to breathe freely again. The thought of escape
flashed upon her. She reasoned that if she could pass the sleepers
undetected, and gain the forest, she might find some place of
refuge, perhaps, before the outlaws would awake. Ignorant as she
was of the exact locality of the hut, she yet had a general idea of the
direction in which the Forks lay, and she determined to make the
attempt to reach that post.

But she resolved not to essay escape as yet. The night without was
pitch dark, so that it would have been impossible to find her way
through the woods; and as she knew the moon would rise in about
an hour, she determined to wait for that event; and accordingly
threw herself on the bed to watch for the propitious time.

Fatigued by physical exhaustion as well as by mental excitement,


however, she unwittingly fell asleep, and when at last she opened
her eyes, the moon was shining full in at the window, having
attained a considerable elevation above the horizon. For a moment
she did not recollect where she was. She started up, at first, with a
look of bewilderment, which changed to one of affright, however,
and then of despair, as the past came up again to her memory.

“What precious hours I have lost,” she mentally exclaimed. “Perhaps


now it is too late. Oh! how could I sleep!” And she wrung her hands.

But directly she recovered the energy natural to her. In truth, her
slumbers had vastly recruited her strength and spirits; and of this
she began soon to be sensible. She sprang to her feel, saying to
herself with decision,

“But why do I waste precious moments? There may yet be hope—


they seem to sleep as soundly as ever—at the most I can but fail.”

As she pronounced these words, she began, though with hands


trembling with eagerness, to move the bedstead from the door
sufficiently to allow egress. With what intense anxiety she listened,
during this proceeding, lest the fabric should, by creaking, awaken
the refugees! Even if one should be aroused it would be fatal to her;
and the slightest noise might produce this result. She was almost
breathless with suspense, until the bedstead had been removed
enough to allow her to pass. But when this was effected, her heart
was fluttering so wildly, that she had to pause an instant, pressing
her hand on it to still its throbbings, for while it palpitated to such a
degree she was too weak to proceed.

She now ventured to lift the latch, which at first resisted her efforts,
and which, when at last it yielded, gave forth a sudden, sharp click,
that, for a moment, made her fear it had awakened one or more of
the outlaws. She waited, therefore, to assure herself that no one
was stirring, before she ventured to draw the door towards her. In
the unnaturally excited state of her nerves, the almost imperceptible
sound of the hinges smote on her ear with alarming distinctness, so
that she felt confident that now at least some one of the outlaws
must awake. In fact a burly ruffian, in whom, to her horror, she
recognized Arrison, and who lay directly across the doorway, not a
foot from her, actually stirred, muttering incoherently, as if about to
arouse from sleep; and at this sight Kate, brave as she was, felt all
her courage and strength desert her, and was compelled to lean
against the wall, in order to support herself from falling.

The ruffian, however, proved to have been only dreaming. After


mumbling a few broken sentences, and tossing his arm over his
head, as if to relieve it by a change of posture, he sunk into slumber
again. Never was sound sweeter to Kate’s ears than the loud, almost
stertorous breathing of the inebriated sleeper. Reassured of this, the
violent beating of her heart ceased, and she recovered strength to
renew her attempt at escape.

The door of the outer apartment was fortunately open, and the
moonlight, streaming in, lit up a scene, such as the Flemish masters
loved to paint. Down the centre of the apartment ran a table,
covered with overturned drinking glasses, and empty bottles, amid
which a huge black jug, with a cornstalk cork, stood, like a grim,
giant warrior, of old, in the centre of a troop of modern pigmies. A
few square bits of wood, in each of which a hole had been bored to
insert a candle, were scattered about the table; but the candles had
long since guttered down, the melted tallow flowing over and
adhering to the board. On one side of the table had been a row of
split-bottomed chairs, but these were now either pushed back
against the wall, or had been kicked over; while on the other side
was a rude bench, made of the first plank that is cut from a log, the
convex part, to which the bark still adhered, being downward. A
broken clay pipe, black with smoke, lay on one end of this bench,
and by it slept its owner, a brawny, unshaven savage. Two of his
companions were stretched on the floor, on either side; another was
directly under the table; a fourth filled a shadowy corner, looking an
unsightly, mis-shapen mass in the obscurity; while a fifth, still sitting
in his chair, slept with his head leaning on his hands crossed before
him on the table. Across this central figure the moonlight poured in a
flood of intense brilliancy, and shot onwards to where Arrison lay at
the feet of Kate, leaving the rest of the room in comparative
darkness, as in a painting by Rembrandt.

Kate saw that it would require the utmost caution to pass the
sleepers without awakening them, for the room was so narrow, and
they lay in such positions, that it was almost impossible to reach the
door without treading upon more than one of them. Arrison himself
lay close to the door of her room, as if his last thought, before he
succumbed to the effects of his copious libations, had been to place
himself there on purpose to keep guard. She could not advance a
single step, indeed, without passing over his body; and if, in making
the attempt, even her skirt should brush him, all would be over.
Perhaps, she reflected, he would be aroused even by her shadow
crossing him; she herself could easily be woke in that way. These
suggestions of an active brain would have paralyzed many a female
in Kate’s situation; but they only had the effect of quickening her
pulses, and increasing her caution.

Holding her breath, and gathering up her skirts firmly, she stepped
rapidly across Arrison’s body, and not pausing to look behind,
advanced stealthily but swiftly towards the door, keeping as much as
possible in the shadow. She was but a few seconds in crossing the
apartment, but it seemed to her almost an age. Every instant she
expected to hear Arrison spring to his feet, or to see one of the
ruffians in front rise to intercept her. At every footstep she trembled
with nervous apprehension. As she approached the door, she was
compelled to almost brush one of the outlaws extended on the floor:
he stirred at that crisis; and she thought that she was discovered.
Instantaneously she stopped and shrank into the shadow. The man
was only turning in his sleep, however, and the next moment was
snoring as heavily as before. Inexpressibly relieved, Kate drew her
garments close to her figure, and gliding lightly past him, gained the
door in safety.

It was a magnificent night without; and what a contrast to the scene


within! Not a cloud was in the sky, not even a speck of fleecy vapor;
only the blue, starless heavens were seen above, and in their
eastern depths the silver moon. A vague, awe-struck feeling came
over Kate as she looked up, and saw the solemn pine-trees standing,
dark and weird, against the silent sky, and above them the calm,
cold planet, looking down on her as pitilessly as it had gazed on the
suffering Job on the plains of Mesopotamia, ages before. Not a
breath of air stirred even the topmost tassel of the tallest fir; not a
sound broke the deep stillness: it seemed, indeed, as if to breathe
was to break some potent spell and bring down ruin on her head.

The little clearing was everywhere as light as day, except where the
shadows of the rude fences checkered the ground, or where the
gloom, cast by the forest, fell like an ominous pall across the eastern
edge. Before our heroine was the little, tumble-down barn, which we
have once before described. One side of this, including the roof, was
flooded with the moonlight, while the other was black and vague,
the deep shadows effectually concealing its outline. Right opposite
the glorious planet, and therefore dazzlingly lit up by her radiance, a
road opened into the forest, which soon, however closed about it,
sombre and awful, as some unfathomable cave swallows up the ray
of sunlight that streams through a chink in the roof. It reminded
Kate of a pathway into some land of enchantment, at first beautiful
to the eye, and light almost as day, but soon darkening into the
gloom of death, amid bogs, and torrents, and labyrinths without
end. A shudder came over her as she gazed, as if a shadow of
impending evil fell across her; but shaking off the feeling as childish,
she advanced into the open space, and directed her steps to the
road.

But scarcely had she emerged fairly into the moonlight, when a low,
deep growl startled her, proceeding apparently from the barn.
Looking eagerly in that direction, her heart sank, for she saw the
ferocious bloodhound, which she had observed on her arrival, slowly
rising to his feet from out of the shadow. His huge form, as he
stalked into the light, seemed, to the excited nerves of our heroine,
to be of even more colossal stature than it was in reality; and with a
stifled groan, clasping her hands, she stood transfixed in speechless
horror.
CHAPTER XXXVII.
INTERCEPTED
A violet by a mossy stone,
Half hidden from the eye,
Fair as a star, when only one
Is shining in the sky. —Wordsworth.

Suddenly a figure glided forth into the moonlight, which, for one
moment, Kate almost fancied was a spirit. It was clothed in white,
and bore the semblance of a young girl, not more than ten years
old; but so sylph-like were its movements, so noiseless its tread, and
so pure and innocent was the expression of the face, that it could
not, Kate thought, be there, yet be earthly. This transient illusion,
however, was instantly dissipated, by a childish voice calling out to
the dog, in low tones, as if fearful of awaking the sleepers.

The bloodhound apparently recognized the accents as those of one


who had shown him acts of kindness, for he ceased growling
immediately, and going up to the young girl, lifted his head as if to
be caressed. The child patted the ferocious animal, whispering
soothingly to him, on which he crouched down at her feet, like the
lion before Una.

Our heroine fully expected that the alarm given by the dog would
have aroused the sleepers; and she even fancied, for an instant, that
she heard the refugees stirring. She turned, therefore, eagerly to fly,
but at the first step the young girl advanced, laying her hand on
Kate’s arm and shaking her head in the negative.

Kate glanced affrightedly over her shoulder, sure that she would
behold Arrison; but her excited fancy had run ahead of the reality.
She drew a deep sigh of relief, and turning to the young girl, said,
breathlessly.

“You will not stop me—you will save me from these dreadful men, by
letting me go before they awake.”

The child shook her head again.

“I dare not,” she said, but in a low, sweet voice.

“And why not? Oh! surely they would not harm you.”

“He would kill me,” replied the child, glancing in terror towards the
house.

“Who?”

“Uncle.”

“And who is uncle?”

“Don’t you know?”

“What! Arrison?”

“Yes.”

Kate looked at the child earnestly. There seemed to her something


strangely familiar, in the large, eloquent eyes of the young creature
before her. The whole countenance, indeed, reminded her of some
one she had known, but she could not recall whom, though she
endeavored, again and again, to remember. The likeness, after all,
however, was a confused one, with gleams of that which was
familiar mingled with others which were foreign; and these latter it
was which appeared to Kate to give such an air of innocence and
even holiness to the face. After a moment’s scrutiny, she recalled her
perilous condition, and as every instant was precious, endeavored
again to persuade the child to allow her departure.
“You must be mistaken,” she said, “your uncle surely would not hurt
you.”

“You don’t know him,” answered the child, “Oh! I am sure he would
kill me if I let you go,” she continued, clasping her little hands.

“But I must go,” replied Kate, with an endeavor to overawe the child.
“You cannot help it.”

The child laid her hand significantly on the bloodhound, which had
risen from his reclining posture and now stood at her side, watching
alternately her countenance and that of Kate. This gesture he
seemed to interpret as it was intended, for he bristled up and
uttered a low growl.

Kate shudderingly looked over her shoulder in the direction of the


house.

“Don’t—don’t,” she cried, in an eager whisper, imploringly glancing


down into the child’s face, and laying her hand on the girl’s shoulder.

The child looked up, with her sad, earnest eyes, at the same time
patting the bloodhound, who became quiet at once.

“Oh! if I could let you go,” she said, and her little face was eloquent
in every feature with sincerity. “I haven’t slept a wink all night,
thinking of you. That was before I saw you,” she added, naively,
“before I knew you were beautiful, or looked so good.”

“Does nobody live here but you?” Kate said, wondering to find the
child in such a place. “I mean nobody but you and Arrison.”

“He hasn’t lived here always,” she replied. “He did once, and then
went away, and only came back a week ago.”

“But you didn’t live here alone?”


“No, Granny Jones lived with me. But she’s cross too. Oh!” she
suddenly added, with passionate earnestness, “if mother hadn’t
died.”

Kate was silent. The child was then an orphan. She said kindly, after
a moment.

“You remember your mother?”

“Oh! yes. She was so beautiful,” and the tears glistened in the child’s
eyes. “Not beautiful like you, not proud looking and grand, but so
sweet and pretty. She never scolded me in all her life, never, never.”
And the child burst into low, half-stifled sobs, which, in her effort to
suppress them, shook her little frame.

Kate was again silent; tears sympathetically dimmed her eyes. The
child saw it, and hushing her sobs, said,

“But Granny Jones was sent away, when uncle came back.”

“And when he’s away, you’re alone?” The child nodded.

“All alone, except with Lion,” she said, glancing at the bloodhound.
“He’s such a good fellow,” she added, her eyes brightening. “We play
together, when we’ve time! Don’t we, Lion?” and she caressed him.

Kate sighed to think of this lovely child, brought up by an outlaw, yet


retaining so much of heaven’s purity, living here in the forest with no
companion but this ferocious dog. She longed to question the little
outcast respecting her mother, about whom there seemed some
strange mystery. But she refrained out of respect to the girl, who
evidently suffered at allusions to her parent’s name.

“Why won’t you go with me?” said Kate, winningly. “Help me to get
away from this place, and I’ll take you home with me, where you
shall have everything you like, and be my little sister.”
The child looked up at her, with eyes dilated to their utmost size in
wonder, evidently unable to credit what she heard.

“I am rich,” said Kate; “you never need work any more. Look in my
face and you’ll see I speak truth.”

The child gave a long, earnest gaze, and answered. “I believe what
you say. I know you are good.”

“Then come,” said Kate. But the child drew back.

“No,” she said, “it wouldn’t be right. Mother told me to stay with
uncle till I grew to be a woman; that he was a hard man, but my
only friend, and I promised I would do it.”

“But your mother did not know that I would make you my sister. If
she had known that you could go away to a fine house, have plenty
of clothes, have books to read, and have a sister to love you, don’t
you think she would have been willing?”

The child looked puzzled. She fixed her large eyes, in doubt and
inquiry, on Kate, as if she could interrogate our heroine’s very soul.

“Maybe she would,” she answered frankly, at last. “She was always
afraid of uncle, and often cried after he’d been to see us. But I
promised her I’d stay with him. Is it right to break promises?
Wouldn’t that be to tell a lie?”

Kate felt her eyes shrink before the gaze of the innocent child. She
was no adept in casuistry, and if she had been, the inquiry of the
little girl, thus put, would have silenced her. Even the strong instinct
to escape could not induce her to mislead one so young and pure.

“God help me!” was her answer, wringing her hands. “I must then
stay here. Oh! if I were dead.”
The child looked at her earnestly for a moment, and then said,
pulling her by her sleeve,

“Don’t, don’t. They won’t hurt you—will they? Uncle told me he was
going to marry you, and that I must give up my room to you, and go
and sleep in the barn, for tonight, anyhow. If you don’t like uncle,
you needn’t marry him, need you? I thought people only married
when they liked each other.”

“You cannot understand it all, my child,” answered Kate, placing her


hand on the girl’s shoulder. “But listen! I don’t want to marry your
uncle. I never will marry him. They brought me here by force, or I’d
never have come. If you don’t let me go, I’ll not live till night; and
you’ll see me dead here, before your eyes.”

The child started back with a sudden shriek, which she stifled as
hastily, looking in terror towards the house; and then, taking Kate’s
hand, she drew her away within the shadow of the barn. Here,
pausing, she said,

“You don’t mean it. They’ll not kill you?”

“As sure as there is a good God above us,” answered Kate, solemnly,
“if you don’t let me go, I’ll not be alive to-morrow. There is no help
for it. While, if you do let me go,” she continued, eager to take
advantage of the favorable chance, “nobody will know you helped
me. In fact, you won’t help me; you’ll only keep Lion quiet; and if
they were to know you helped me, they couldn’t harm you, innocent
child that you are. If your mother was alive, she’d wish you to let me
go. You know I wouldn’t tell a lie, darling, or I’d have tried still to get
you to go with me, in spite of your promise to your mother. Every
minute is precious. It will soon be daybreak. Only keep Lion quiet,
leave me to myself, and go back to your bed in the barn.”

“You shall go,” suddenly said the child. “I’ll go inside, and take Lion
with me.”
“God bless you!” cried Kate, seizing her in her arms and kissing her
again and again. “If I escape, and you ever want a friend, you’ll
always have one, if you ask for Miss Aylesford, of Sweetwater.”

“Good-bye,” said the child, timidly returning the kisses. “Take the
road in front, and keep straight ahead. Only,” she added, “when you
come to the big cedar, past the log bridge, a mile off, you must turn
to the right.”

“I will, I will,” breathlessly said Kate, but, in her hurry and


excitement, paying less heed to the direction than she ought. “Again
God bless you!”

With tears in her eyes she gave the child a last embrace, and first
glancing towards the house to see that no one was in motion, ran
swiftly across the open space, entered the road, nor slackened her
speed until not only the turn concealed her from sight, but a
considerable distance intervened between her and the clearing.
Then, almost out of breath, she subsided into a quick walk,
occasionally stopping to hear if the steps or shouts of pursuers were
following in the distance.

As for the child, she remained in the shadow, caressing the dog to
keep him quiet, and watching the retreating figure of our heroine,
until Kate had wholly disappeared. Then, suddenly bursting into
tears, she turned, and entered the dilapidated barn, leading the
bloodhound, whom, the instant they were alone together on the hay,
she clasped to her arms, in a mute eloquence that said he was now
again the only friend she had in the world.
CHAPTER XXXVIII.
THE FLIGHT
Whence is that knocking!
How is it with me, when every noise appals me. —Shakespeare.

Like one, that on a lonesome road


Doth walk in fear and dread.
******
Because he knows a frightful fiend
Doth close behind him tread. —Coleridge.

The precious moments which Kate had lost, first by falling asleep,
and afterwards through the watchfulness of the hound, stimulated
her now to the utmost speed of which she was capable. Running
until she was forced to pause for breath, then pausing an instant to
listen, now walking at her utmost pace, then running again as soon
as she had recovered herself, she reached the bridge of which the
child had spoken, in a period of time incredibly short, and only to be
accounted for by the terror with which the fear of death or dishonor
winged her feet.

At this point she was compelled to come to a full stop, and remain
for awhile in perplexed thought, uncertain which way to go. In vain
she tried to remember which road the child had told her to take. As
she stood there, hesitating, her fears received fresh stimulants.
Every noise was magnified into the sound of pursuers. Even the soft
sighing of the wind in the distance seemed to her excited fancy the
remote baying of the hound; while the sudden dropping of a pine-
cone near her made her start, with a half uttered scream, as if her
foes were already upon her. To have seen her then, as she stood
glancing fearfully across her shoulder, her hand pressed to her
palpitating heart, her lips parted in terror, and her cheek lividly pale,
one would have compared her only to some beautiful, milk-white
doe, suddenly startled by the hunter’s cry, and feeling in imagination
the fangs of the enormous stag-hounds already at her throat.

To no purpose either was her scrutiny as to the condition of the two


roads, in order to ascertain which of them presented the appearance
of being most frequently travelled. It had plainly been many days, if
not weeks, since a vehicle had passed over either. At last Kate
selected the road to the right as the one which seemed to be the
principal one. Yet, at this point, it flashed across her that, perhaps,
the most travelled path was really the one she should avoid; for it
probably led into the great highway, connecting Philadelphia with the
sea-shore. She was but little acquainted with the country on this side
of Sweetwater, forests extending almost unbrokenly across from one
river to the other; but what little she knew satisfied her that this
great highway might be traversed for hours without reaching succor.
Within twenty years of the present time, the writer has passed over
a space of twelve miles at a time, without seeing more than one
house; and at the period of our story, the village at the end of that
desolate stage was not even projected. Kate, indeed, might have
walked all day along that highway, without meeting enough persons
to protect her from the refugees. It was, therefore, almost certain
recapture for her to take the path communicating with that road.

She paused, therefore, again. But the more she thought the more
perplexed she became. Time, meanwhile, was passing; precious
moments, big with destiny. She could not rely on the outlaws
remaining ignorant of her flight a moment after daybreak; and
already the night was waning fast. Drawing forth her watch, of
which she had not been despoiled, most strangely as she thought,
she discovered that the dawn was only an hour distant. What was an
hour’s start, however, to one like her, wearied by the excessive
fatigue of the preceding day, unused to travelling far on foot, and
deprived of sleep for the last twenty-four hours, except for the slight
interval at the hut. How could she expect to gain the Forks, even if
she struck the right road, in less than two hours?

“If I hesitate longer,” she cried, in despair, “they will overtake me,
long before I can reach any place of safety I am acquainted with. I
must decide in some way. This right hand road, I fear, leads into the
King’s highway: I will take the one on the left: God help me if I am
wrong!”

Accordingly she turned in that direction, and having rested herself


partially by the pause, ran forward again until she was quite out of
breath. For half an hour, she continued alternately running, walking,
and running again, occasionally pausing to listen: and in that time,
as she calculated, had traversed between two and three miles. The
forest still continued as wild as ever; but this did not alarm her; for
she was aware that the wilderness extended to the very doors, as it
were, of the settlement at the Forks. She therefore pushed forward,
her excitement enabling her to disregard fatigue, and to forget that
she had eaten little for a day. For another half an hour, consequently,
she hurried on, and as the distance between her and the outlaws
was increased, her hopes gradually rose.

Day was now beginning to break. The moon continued to shine as


lustrously as ever; indeed, being now nearly at the zenith, her light
seemed even more effulgent than when Kate left the hut; but there
was a cold, gray hue over the eastern sky which heralded the
morning. Gradually the white light of day stole over the orient
heavens, when that of the moon assumed a partially sickly cast. The
birds too now began to twitter in the underbrush and smaller growth
around.

At this point Kate reached an opening in the woods, where the trees
had been cut off a year or two ago. On the eastern side of this was
a tract of pine land, where a fire had passed, leaving the tall firs
standing stripped of their foliage, like a forest of black, charred
masts against the heavens. Through this, in the distance, was seen
a reddened sky, a proof that the sun, though still below the horizon,
was close upon it. The route of Kate lying in the direction of this
burnt district, it was not long before she saw the upper edge of his
disc emerge, shooting long lines of light towards her, that came
glancing between the black trunks of the pines, or bathed the
greener space more directly in front with showers of golden
radiance. The whole forest around was now alive with twittering
birds. Meantime the moon, as if suddenly struck pale by an
enchanter’s hand, seemed all at once to have lost its late glorious
effulgence, and was now seen, a faint, waning orb, apparently
powerless in the zenith. To the right and left, however, in the
recesses of the woods, where the sunshine had not yet penetrated,
the moonlight still lay, cold and beautiful, though even there less
lustrous than it had been.

In a few minutes it grew dim also even in these secluded aisles,


fading perceptibly to the eye as in a dissolving view. The sun had
now risen completely above the horizon. The exhalations of the
night still partially obscured him, however, so that he loomed large
and inflamed on the vision. But directly he surmounted the region of
these vapors; and at once the whole landscape was flooded with
dazzling light. The black, charred pines; the verdant tract of low
brush oak; and the arcades that ran before the eye into the forest
on every side, glowed with the excess of effulgence: the leaves, that
rustled slightly in the wind, flashed in the bright rays: and the moon
became a pale, uncertain circle, the affrighted shadow of herself.

For another hour Kate pursued her way, without stopping longer
than a few moments at a time, and then only to listen if she was
pursued. At the end of that period she began to think that she ought
to be in the neighborhood of the Forks. She pressed on, however, till
the sun was nearly two hours high, yet without reaching her
destination. She now became alarmed. At the pace at which she had
been advancing, she ought, she knew, to have arrived at the Forks
before this; besides, the road was becoming a mere wood-path;
while the forest around was changing its character and assuming
that of an impenetrable swamp. She now bethought her to compare
the position of the sun with what it would be if she was advancing in
the right direction. To her dismay she found that luminary over her
left shoulder and behind, instead of in front, and on the right, as it
should have been. At this discovery she came to a halt, overcome
with the sudden faintness of despair.

During her progress, she had frequently passed other roads, opening
into the one she was traversing, but as they were either evidently
paths used only by the wood-cutters, or led off at right angles, she
had carefully avoided them. Studiously had she kept to what
appeared to be the most direct and beaten way, nor until this
moment had she thought of testing it by the heavens. Thus she had
unconsciously turned her face in the wrong direction, by following its
tortuous course.

A moment’s reflection, however, suggested to her that the deviation


of the road might be only temporary, though the fact that she had
not reached the Forks, as she ought, told against this supposition.
Drowning people, it is said, catch at straws, however, and nerving
herself with this hope, she started afresh. But after walking for a
considerable period longer, and carefully noting the position of the
sun all the while, she became convinced that she was receding from
the point of her destination, instead of advancing towards it.

When this discovery forced itself on her, nature at last gave way.
Overtasked though she had been, hope and energy had kept her up;
but now both succumbed together; and her strength departed with
them. Sinking tremblingly and powerless on the huge root of a
mossy tree, she covered her face with her hands, and burst into
sobs like a child.

But, when she had wept for a while, a reaction took place. She
started suddenly to her feet.
“Why do I give way thus?” she cried. “Is not anything better than
falling again into the hands of those ruffians? Better to drop down
and die from sheer exhaustion, than to sit here trembling, like a
hunted hare, till I am seized.”

As she spoke, she resumed her flight, running till she panted, and
then walking rapidly on with desperate, but alas! purposeless
energy. For the further she advanced, the more remote became the
Forks, as she saw by the position of the sun; yet she dared not turn
back, as that would be to run into the jaws of her hunters. The first
cross-path that she met, and which led in the right direction, she
entered, however. But after following this for awhile, it also went
astray, and now she was in greater perplexity and dismay than ever.

In fact she was evidently advancing into one of those almost


pathless swamps, which abounded in that region, and which had
engulphed many a lost traveller as effectually as the sea swallows up
a foundered crew. The soil beneath her was no longer solid, though
sandy; but was a soft, black vegetable mould, in which she often
sank to the ankles. The path, for it was now scarcely a road, was
almost overgrown with bushes; and occasionally it was really difficult
to tell where it was, the wheel-tracks, if they had ever existed,
having long ago been obliterated.

Yet she struggled on. Despair gave her now the energy which hope
had formerly supplied; and though almost exhausted with physical
weakness, her brave soul still upheld her flagging frame, and still
urged her forward. Thus she staggered on, all that morning,
dragging her heavy limbs along, and continually rallying herself to a
swifter pace, when she mistook the wind among the trees for the
hurrying tread of pursuers, or the distant bay of a hound.

The sun was now high in the heavens. Kate had been on her feet
since two hours before the dawn. She could no longer advance at a
faster pace than a walk, and that a slow and painful one. She saw
also that she was moving almost in a circle, the sun being now
before her, now on her right, now behind her, and now to the left.
But, though hopelessly lost in the swamp, though sometimes almost
miring in the oozy soil, she did not, for one moment, entertain the
thought of turning back.

“Oh! no, no,” she said wildly, “certain death, death in any shape, is
better than falling again into those merciless hands.”

Even the idea of lingering for days, in a state of starvation, was less
terrible to her than being retaken. She had heard of persons, lost in
swamps, who had perished miserably for the want of food, and
whose bleached skeletons, found long years after, had been the only
clue their friends ever had to their fate; and she had formerly
shuddered at such tales. But she did not shudder now. She felt that,
if she could purchase immunity from the outlaws in no other way,
she would gladly accept even this horrible alternative.

“God,” she said, “tempers the wind to the shorn lamb. He will give
me strength to face such a death.”

Noon was now at hand. The path had long since dwindled into a
mere blind track, formed rather by the natural space between the
trees than by the footsteps of man or beast. Frequently tall bushes,
interlaced into an impenetrable net-work, guarded the sides like a
hedge; and again the path swelled into natural openings, half an
acre or so in extent. Lofty trees, whose sombre verdure threw an
almost funereal gloom around, towered high into the sky, with here
and there a blasted pine, shooting, arrowy-like, high over all, and
adding to the desolate aspect of the landscape.
CHAPTER XXXIX.
THE BLOODHOUND
But I, in none of these,
Find place or refuge. —Milton.

What miracle
Can work me into hope! —Lee.

Then, as the headmost foes appeared,


With one brave bound the copse he cleared. —Scott.

Suddenly the distant cry of a hound seemed borne upon the air.
Often before, during the morning, as we have said, Kate had fancied
she heard such a noise; and as often had she been happily
disappointed. But this time there was no mistaking it. No sighing of
the wind among the pines, no murmur of distant water, could
produce that peculiar cry, which was plainly the hoarse, deep bay of
a bloodhound heated with the chase.

Kate gazed in terror around, vainly seeking a hiding-place. If the


earth had opened, at that moment, and swallowed her up, she
would have welcomed it as a relief. The worst that she had feared,
that recapture which was more horrible than death, was now about
to befall her. Help there was none. The nearest human creature,
possessed of the sympathies of our common nature, was probably
miles away; and as for pleading for mercy at the hands of the
outlaws, she knew she might as well petition to the winds.

Meantime the bay of the hound sounded louder and louder, fiercer
and fiercer, nearer and nearer. Occasionally he would appear to lose
the scent for a moment or two, for the deep cry would die away
through the wilderness; and Kate, at such times, would listen
breathlessly, fluctuating between hope and despair. But the hoarse
bay broke forth invariably again, at intervals greater or less; and
always with a startling ferocity that sent the blood back in torrents to
her heart. After thus recovering the scent, the cry of the hound
would be heard almost incessantly, till the forest resounded with a
hundred echoes, and the very heavens seemed to give back the
sound. Though the pursuers now drew near, and then receded a
space, as if following a somewhat circuitous path, the terrible bay of
the hound plainly approached closer, with the lapse of every quarter
of an hour.

There was but one hope now left for our heroine, which was that
death would put an end to her miseries, before she could be
dragged back to the outlaw’s hut. Her efforts to escape had so
completely exhausted her, that her heroic spirit would have been
unable to force the weary limbs onward much further, even though
the refugees had failed to track her. She felt satisfied that she could
not retrace her steps to the cabin, and that she would perish on the
way if the attempt was made to compel her.

But, hopeless as was her condition, Kate still remained true to


herself. The fate which she could not avert, she resolved should be
met with dignity at least. She abandoned, therefore, all further
thought of flight, determining to face her inevitable destiny where
she then stood. Like a Roman virgin, stout-hearted to the last, as
became the daughter of illustrious heroes, she drew her garments
decorously and proudly about her, and stood up to face the foe.

It was not only on herself that she relied, however, in this most
terrible of all extremities. The reader is already familiar with the fact
that Kate was sincere and earnest in her piety; and now, when she
considered death as imminent, she looked up to the Almighty for
support in that dreadful hour. She had been educated in the liturgy
of the Established Church, as her fathers had been since the days of
the saintly Latimer, and though she worshiped with other sects as
fervently as with her own, when the ministry of her church was
impossible, her thoughts naturally turned, in this extremity, to the
solemn words of that litany which she had learned first at her
mother’s knee.

As she stood, therefore, facing the foe, and bravely supporting her
weak frame by leaning against a tree, her eyes were raised to
heaven, and her lips moved in earnest supplications. We have seen
somewhere a picture of a Christian virgin, bound to an oak by Pagan
enemies, and about to suffer martyrdom by being transfixed with
arrows as a target. So Kate looked now. Her hands were clasped
downwards before her; and her uplifted countenance glowed with a
fervent enthusiasm that proved the mortal part above the fear of
death. Thus she stood, while the bay of the ferocious hound drew
nearer, and shouts, mingling with the hoarse cry, showed that her
pitiless hunters were now close at hand; yet not an eyelid quivered,
not a muscle about her mouth twitched, not a shade of color rose
into her composed, though pallid face.

“Remember not, Lord, our offences,” she prayed, “nor the offences
of our forefathers; neither take thou vengeance of our sins; spare
us, good Lord, spare thy people, whom thou hast redeemed with thy
most precious blood.”

Again the hoarse cries of the bloodhound, nearer at hand than ever,
woke the echoes of the wilderness, mingled with the exulting shouts
of the outlaws; for the pursuers knew, from the rapidity and power
of the dog’s cries, that they were now almost up with their prey.

“By the mystery of thy holy Incarnation, by thy holy Nativity and
Circumcision; by thy Baptism, Fasting and Temptation.”

Again the ferocious bay of the bloodhound rose to the sky, and
reverberated through the forests.

“By thine Agony and Bloody Sweat; by thy Cross and Passion; by thy
precious Death and Burial; by thy glorious Resurrection and
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like