Roland's SAS tips and techniques

[This site is not connected with the SAS Institute]

[last updated - 26 Mar 2008]

Introduction

Your most important source of information on how to use SAS software will always be the official documentation. This is available online and in this form it is easy to search for the topic of interest. You should refer to the online documentation often and learn what is there and how to navigate the site. The tips you can link to on this page do not overlap what you will find in the online documentation. They are mostly of a broader topic nature and aim to cover real-life situations you will encounter in your programming work. You can link to the online SAS documentation below. This page will allow you to navigate to older and newer versions.
SAS On-line Documentation

Sources of SAS tips

You can find a lot of good SAS tips on the Internet. Don't think this site of my web site as a definitive source. It certainly is not. I often look at the sas Technical Support site to see examples of usage and to attempt to resolve problems. Outside the official sas site there is the www.sconsig.com web site that has hundreds of useful tips and code that you can download. You can also search that site for the information you need just like you can the sas Technical Support site. There are plenty of useful examples in the official online sas documentation that you can link to above so there are plenty of tips out there. And if you are really stuck then there is the comp.soft-sys.sas newsgroup. So long as you have posting access, you can post your questions or problems there and somebody should respond quite quickly. There is also a mailing list called SAS-L that sits behind that newsgroup. For information on how to subscribe to the list, then check out the www.sconsig.com web site.

My SAS tips

I started writing sas code in late 1986 and have been doing so ever since. I've encountered all sorts of problems over the course of these years so I have a lot of tips to give, based on my experience in coding with the language. Allow my "pain" to be your "gain" as you read the tips you can link to below. As I think of other tips, I will add new pages at the end of this list of links.

Code documentation
Writing SAS macros
Macro version numbers
Left-aligning footnotes
Put (_all_) (=)
"Communicating" with a sas program
Floating point number accuracy
Deadly errors you can make
data _null_ unleashed
Stacked column reports with data _null_
data _null_ tips and techniques
ODS and the end of data _null_ reporting
SQL vs. data steps
LOCF (Last Observation Carried Forward) processing
Merging with a dose
Time-to-event processing
Fun with formats
Using Boolean expressions in calculations
Deleting datasets more than a month old
Testing for the existence of a global macro variable
Reading a data set using pure macro code
Quoting quoted text with SAS code and macro language
Combining data sets with identically named character variable of different lengths
Using a "programming plan" for clinical reporting
proc sort nodup
In-text tables using SAS
Using ODS to make your tables look pretty
Bulk runs of many sas jobs under MS Windows
How to become a good SAS programmer
When SAS programs become too long
Your "validated" clinical reporting system
Improving the look of text for SAS/GRAPH
Creating a scale using an annotate dataset
Choosing colors for your html output
Deleting any or all global macro variables
"Call symput" absolutely everything
A Background Painter

Flattening "proc report" output   (work in progress)
 
 


 
 

Go back to the home page.

E-mail the macro and web site author.