Posts Tagged ‘ SAS tricks ’

Character substitutions in the SAS editor

November 17, 2011
By

Rick Wicklin dropped a gem today!  The SAS enhanced editor includes a text replacement feature-- who knew?  The use of it is laid out in this SAS paper. Briefly, just click on Tools > Add Abbreviation, then type in the shortcut and the tex...
Read more »

Tags:
Posted in SAS | Comments Off

Clear the Results viewer in SAS 9.3

September 1, 2011
By

  The Problem The new default output destination in SAS 9.3 is the "Results Viewer" rather than the "Listing" window.  The results viewer shows an html file that integrates text and graphical output.  It's pretty, and it's very nice (sometim...
Read more »

Tags:
Posted in SAS | Comments Off

Read a sheet from an Excel file

May 4, 2011
By

  Yet another useful not-a-trick. One of the great things about SAS is the accessibility and completeness of the documentation.  However, occasionally lapses in the completeness do come up.  One example is in importing data.  A primary ...
Read more »

Tags:
Posted in SAS | Comments Off

The "do over" syntax for arrays

January 6, 2011
By

This is another useful not-a-trick. No longer to be found in the documentation is the "do over" syntax, which can simplify code and keep datasets narrower.  The syntax works like this: data ...;array arrayname x y z var1 - var3; do over arra...
Read more »

Tags:
Posted in SAS | Comments Off

Example 8.13: Bike ride plot, part 2

November 8, 2010
By
Example 8.13: Bike ride plot, part 2

Before explaining how to make and interpret the plot above, Nick and I want to make a plea for questions--it's hard to come up with useful questions to explore each week!As shown in Example 8.12, data from the Cyclemeter app can be used to make interes...
Read more »

Tags: , , , , , , ,
Posted in SAS | Comments Off

Get where condition into the output

July 22, 2010
By

The where statement is a powerful and useful tool for subsetting on the fly.  But one problem with it is that the output doesn't show the conditioning.  This is a little macro I wrote to correct this problem:%macro where(wherest, titleline);w...
Read more »

Tags:
Posted in SAS | Comments Off

Print global macro variables

July 20, 2010
By

The call symput("macroname", varname) is really useful for getting data from a data set into SAS code that's executed later.  One example is shown here.  This entry is inspired by a simulation project I'm coding right now where there are many...
Read more »

Tags:
Posted in SAS | Comments Off

Convert data to CSV file

May 28, 2010
By

In addition to the export file wizard and proc export (section 1.2.3 of SAS and R), SAS provides a the nifty little %ds2csv macro that can do this quickly and easily.  The advantages to this approach are that there are a few extra options and that...
Read more »

Tags:
Posted in SAS | Comments Off

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: [email protected]

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

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.