Fundamentals of Programming in SAS. James Blum

Чтение книги онлайн.

Читать онлайн книгу Fundamentals of Programming in SAS - James Blum страница 3

Автор:
Жанр:
Серия:
Издательство:
Fundamentals of Programming in SAS - James Blum

Скачать книгу

      Acknowledgments

      I would like to thank my family—my mother Jo Ann, my father Robert, and my sister Amy—for their unwavering support in all of my academic endeavors over the years. A big thank you to all of the students and colleagues I have interacted with who, through their desire to learn more, also pushed me to learn more and bring more ideas back into the classroom. Thanks to all of the people at SAS who helped make this book a reality, particularly those in SAS publishing, and to all of the instructors I had for SAS Training who helped me transition from a mediocre SAS user to an actual SAS programmer. And a very special thank you to my love, Lilit, whose patience and encouragement gave me the extra strength to finish this project.

      – Jim

      I want to thank the hardworking staff at SAS who helped make this book a reality—it has been a learning experience and I am already looking forward to working with you on the next project! While many friends and colleagues supported me during this process, I especially want to thank Dr. Ellen Breazel for providing invaluable feedback from the perspective of a fellow SAS instructor and to Jordan Lewis for helping ensure the needs of the novice SAS user remained a primary concern during my writing process. Thank you to my wonderful and supportive wife, Katherine, for keeping me from getting too engrossed in writing this book. (Also for helping me write this acknowledgment!) Finally, I am eternally grateful for my parents, Bill and Teresa, who have provided enthusiastic encouragement during this project, just like they have done for all of my endeavors for longer than I can remember. This book would not have been possible without all of you.

      – Jonathan

      Chapter 1: Introduction to SAS

       1.1 Introduction

       1.2 Learning Objectives

       1.3 SAS Environments

       1.3.1 The SAS Windowing Environment

       1.3.2 SAS Studio and SAS University Edition

       1.4 SAS Fundamentals

       1.4.1 SAS Language Basics

       1.4.2 SAS DATA and PROC Steps

       1.4.3 SAS Libraries and Data Sets

       1.4.4 The SAS Log

       1.5 Output Delivery System

       1.6 SAS Language Basics

       1.6.1 SAS Language Structure

       1.6.2 SAS Naming Conventions

       1.7 Chapter Notes

       1.8 Exercises

      This chapter introduces basic concepts about SAS that are necessary to use it effectively. This chapter begins with an introduction to some of the available SAS environments and describes the basic functionality of each. Essentials of coding in SAS are also introduced through some pre-constructed sample programs. These programs rely on several data sets, some provided with SAS, others are provided separately with the textbook, including those that form the basis for the case study used throughout Chapters 2 through 7. Therefore, this chapter also introduces SAS data sets and libraries. In addition, an introduction to debugging code is included, which includes a discussion of the SAS log where notes, warnings, and error messages are provided for any code submitted.

      This chapter provides a basis for working in SAS, which is a necessary first step for successful mastery of the material contained in the remainder of this book. In detail, it is expected upon completion of this chapter that the following concepts are understood within the chosen SAS environment:

       Demonstrate the ability to open, edit, save, and submit a SAS program

       Apply the LIBNAME statement to create a user-defined library—including the BookData library that contains all files for this text, downloadable from the Author Page

       Demonstrate the ability to navigate through libraries and view data sets

       Think critically about all messages SAS places in the log to determine their cause and severity

       Apply ODS statements to manage output and output destinations

       Explain the basic rules and structure of the SAS language

       Demonstrate the ability to apply a template to customize output

      Use the concepts of this chapter to solve the problems in the wrap-up activity. Additional exercises and case-studies are also available to test these concepts.

      Interacting with SAS is possible in a variety of environments, including SAS from the command line, the SAS windowing environment, SAS Enterprise Guide, SAS Studio, and SAS University Edition; with most of these being available on multiple operating systems. This chapter introduces the SAS windowing environment, SAS Studio, and SAS University Edition on the Microsoft Windows operating system and points out key differences between those SAS environments. For further specifics on differences across SAS environments and operating systems, consult the appropriate SAS Documentation. In nearly all examples in this book, code is given outside of any specific environment and output is shown in generic RTF-style tables or standard image formats. Output may vary somewhat from the default styles across SAS environments on various operating systems, and examples later in this chapter demonstrate some of these differences. Later chapters give information about how to duplicate the table styles.

      The SAS windowing environment is shown in Figure 1.3.1 with three windows visible: Log, Explorer, and Editor (commonly referred to as the Enhanced Program Editor). The Results and Output windows are two other windows commonly available by default, but are typically obfuscated by other windows at launch. When code that generates output is executed, these windows (and possibly others) become relevant.

      Figure 1.3.1: SAS Windowing Environment on Microsoft

Скачать книгу