Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title Page
Copyright Page
Contents
About This Book
About The Author
Acknowledgments
Chapter 1: My Favorite Functions
Introduction
Concatenating Strings
Converting Numbers to Characters
Adding Delimiters
Using the OF Shortcut
Removing Leading and Trailing Spaces
Finding Non-Blank Values
Creating Datetime Values
Creating Macro Variables
Finding Words
Counting Words
Replacing Substrings
Using %SYSFUNC() to Run DATA Step Functions
Chapter 2: Data Tables
Introduction
Copying Variable Attributes
Reading Data with a SET Statement
Concatenating Tables
Interleaving Tables
Using Multiple SET Statements
Determining Which Table a Record Is From
Using PROC SQL
Choosing to Use PROC SQL
Joining
Using a Subquery
Using a Correlated Subquery
Using Lookup Tables
Using a Format
Using a Join
Using a SET Statement With KEY=
Using Hash Tables
Updating Data In Place
Using PROC SQL
Using the MODIFY Statement
Using PROC APPEND
Finding Records
Determining Whether a Table Exists
Getting the Number of Records
Verifying That a Table Has Records
Re-creating Indexes
Chapter 3: The Operating System
Introduction
Checking the Operating System
Running Operating System Commands
Using the X Statement
Using the SYSTEM() Function
Using a FILENAME Pipe
Working with the File System
Creating and Deleting Directories
Working with Files
Reading and Writing External Files
Using the $VARYING. Format and Informat
Using the FILEVAR= Option
Reading Date and Time Values
Creating a CSV File from a Data Table
Reading a CSV File with Embedded Line Feeds
Chapter 4: The Macro Facility
Introduction
Understanding Macro Variables
Using the “Dot” in Macro Variable Names
Determining How Many &s to Use
Understanding Quotation Marks
Using Macro Quoting
Unquoting
Forcing Single Quotation Marks
Writing Macros
Using Autocall Macros
Determining When to Write a Macro
Wrapping Long Lines of Code
Using the IN Operator
Testing for Blanks
Validating Parameters
Creating Macro Functions
Chapter 5: SAS Programming
Introduction
Using the ABORT Statement
Updating Option Values
Getting Information from SASHELP Views
Creating a Unique Key with PROC SQL
Setting a Boolean
Accumulating Values
Replacing a Substring
Using Data Values Tables to Create and Run Code
Using Macro Variable Arrays
Creating and Including Code
Using CALL EXECUTE
Taking Control of DATA Step Processing
Branching
Returning
Deleting
Subsetting
Stopping
Aborting
Continuing
Leaving
Figuring Out Where You Are
Counting Iterations
Finding the End
Finding Group Beginnings and Endings
Chapter 6: Application Development
Introduction
Using Comments
Choosing a Style
Commenting Out Chunks of Code
Dealing with Notes, Warnings, and Errors
Getting Rid of Common Notes, Warnings, and Errors
Creating Custom Error and Warning Messages
Capturing Error and Warning Messages
Protecting Your Password
Encoding a Password
Storing a Password
Hiding a Password
Using the PUT, PUTLOG, and %PUT statements
Debugging with PUTLOG
Using the VAR= Syntax
Using Shortcuts
Getting Rid of Unneeded Spaces
Displaying a Macro Value in the SAS Log
Using Macro Shortcuts
Chapter 7: Advanced Tasks
Introduction
Sending Email
A Single Message
Multiple Messages
Running Code in Parallel
Using MPCONNECT
Striping Data
Simulating Recursion
Reading Metadata
Using the XML LIBNAME Engine
Appendix A: Utility Macros
Introduction
Deleting Tables
Getting the Number of Records
Getting a Library’s Engine Name
Getting a Variable Keep List
Making ATTRIB Statements
Making a Basic Format
Making a Directory Path
Creating Macro Variables from SYSPARM
Setting Log Options
Displaying Macro Notes for Debugging
Refreshing Autocall Macros
Appendix B: Display Manager
Introduction
Using the Enhanced Editor
Indenting Your Code
Commenting Out a Section of Code
Converting a String to Uppercase or Lowercase
Removing Excessive White Space
Opening a New Enhanced Editor Window
Using the Program Editor
Customizing Function Keys
Setting Options
Using Line Commands
Working with the Recall Stack
Handling Unbalanced Quotation Marks
Appendix C: Coding Style
Introduction
Indenting
Aligning
Handling Line Lengths
Using Capital Letters (or Not)
Naming
Coding with Style
References
Index
← Prev
Back
Next →
← Prev
Back
Next →