## Programming Tips

Strengthen your programming skills with tips and techniques from the experts

Programming Tips
0
SAS logs in Enterprise Guide: Where's the beef?

You might be too young to remember Clara Peller. She was the star of a series of fast-food burger commercials in the 1980s, in which she demanded meatier meals by shouting "Where's the beef?" at the pickup counter or drive-through window. Alas, the competitor restaurant meals were afflicted with "Fluffy

0
Five reasons to use the SAS DATA Step or PROC SQL

When I joined SAS Institute I had no knowledge of SAS. I studied, researched and practiced. The questions I asked would make even the most seasoned programmer blush a beetroot red! Those were an intense nine months—I’ll tell you more in a later post about the learning system at SAS

0
Converting between correlation and covariance matrices

Both covariance matrices and correlation matrices are used frequently in multivariate statistics. You can easily compute covariance and correlation matrices from data by using SAS software. However, sometimes you are given a covariance matrix, but your numerical technique requires a correlation matrix. Other times you are given a correlation matrix,

0
Computing covariance and correlation matrices

Sample covariance matrices and correlation matrices are used frequently in multivariate statistics. This post shows how to compute these matrices in SAS and use them in a SAS/IML program. There are two ways to compute these matrices: Compute the covariance and correlation with PROC CORR and read the results into

0
How SAS engines can read a range of data in Excel

Japan has a superfast train called the Shinkansen. The first I heard of it was when my sister visited Japan on a scholarship. Engine-awestruck, we wanted a ride, but weren’t able to get to Japan. Nor, did we know the language. (With over 5000 kanjis, it took my sister 3

Programming Tips
0
To INDEX or not to INDEX...

Recently, a certification candidate asked me about indexes and how SAS decides whether to use one or not.  I don't work with supper-large data sets and therefore haven't been overly concerned with efficient coding techniques and consequently had no idea what an index was. So off to SAS 9.2 online

Programming Tips
0
Calculating the UTC offset in your SAS session

Update 25Nov2010: I've updated this example to correct the code so that it works correctly for positive UTC offsets. Thanks to Bruno Müller, my colleague at SAS, for finding my mistakes. One of my SAS colleagues was recently working on a project where she had to create reports that include

Programming Tips
0
Jedi SAS Tricks: Custom PDF Bookmarks

I was building a nice little PDF report the other day.  I love the way ODS PDF replicates the SAS Results window navigation structure as PDF bookmarks, but... I'd much rather write the text for the bookmarks myself.  So, I decided to "use the SAS" and make ODS do my

Programming Tips
0
Why Can't SAS Read My CSV file?

Many SAS users receive data in the form of CSV (Comma Separated Value) files, and need to convert them to SAS data sets. A typical record in a CSV file might look like this: Jeter,Derek,1995,,234,”22,600,000” Note the following about the record above: There is no data for the fourth field,

Programming Tips
0
An "Enterprise Guide" in a parallel universe

Dear Readers, You might visit this blog for many reasons, chief among them to learn useful information about SAS. You know that I often post tips about SAS Enterprise Guide, and sometimes people go so far as to call this a "SAS Enterprise Guide" blog*. But for all of the

0

I love to teach SAS programming and in this blog, I hope to share best practices, tips, tricks and answer some frequently asked questions by our SAS users. I’m constantly learning more nuances of SAS and more programming languages like SQL. Why the interest in language? As you probably know,

Programming Tips
0
SAS Enterprise Guide 4.1: it's not dead yet

Are you up to date on your hotfixes for SAS Enterprise Guide 4.1? If you're not certain of the answer, you'll find out next week when you might see this message appear: This version of SAS Enterprise Guide will expire on December 1st, 2010. If you've applied any SAS Enterprise

Programming Tips
0
SAS Enterprise Guide 4.3 Tutorials in your language

We've just pushed out the localized versions of the Getting Started with SAS Enterprise Guide 4.3 tutorial. This is the tutorial that you'll see when you select Help->Getting Started Tutorial from within SAS Enterprise Guide. Here is a list of the supported languages, and links to the tutorial content: English

Programming Tips
0
PROC REPORT versus TABULATE: two SAS heavyweights

The question came up on the SAS Enterprise Guide discussion forum: which do you prefer, List Report Wizard (PROC REPORT) or Summary Tables (PROC TABULATE)? And as with most SAS-related questions, the proper response is: "it depends." If you put these two PROCs in the ring with a Google Fight,

Programming Tips
0
World Statistics, FTW!

Yesterday, I was in the #raganSAS audience as David Pogue told me What's New and What's Next in the world of technology. David is a great presenter, and he really had the audience engaged as he talked about augmented reality, his world according to Twitter, and an iPhone app that

Programming Tips
0
Tuning your Windows 2008 environment for SAS

If you're an administrator of systems that run SAS, you have probably already read up on How to Maintain Happy SAS 9 Users. If not, go read that first. Now, are you looking to squeeze the best performance out of SAS on Microsoft Windows 2008 Server? Be sure to read

Programming Tips
0
Export to Excel 2007/2010 using SAS Enterprise Guide

Since its 4.2 release, SAS Enterprise Guide has been able to import Microsoft Excel 2007 and 2010 spreadsheet files (usually encountered as .XLSX files). But while SAS Enterprise Guide can export XLS files (which are compatible with all versions of Microsoft Excel), it does not have the ability to export

Programming Tips
0
What to do IN BETWEEN dates

I saw a suggestion arrive from a SAS customer who would like to see the IN operator extended to allow ranges of date values. For example, you can currently write a program that checks for values IN a collection or range of numbers: data check; if x in (1:10) then

0
Get Smart!

AnnMaria wrote her latest blog post, "SAS Enterprise Guide makes you smarter", partly in response to my recent post about whether it's making you stupider. From the contents of her program example, I'm guessing that she's preparing for WUSS in November. I don't get to attend this year, but my

Programming Tips
0
A 64-bit success story: JMP

In my post yesterday about the 64-bit hype and how client apps like SAS Enterprise Guide would see only a limited boost from a 64-bit version, I forgot to point out another offering from SAS that has embraced the 64-bit architecture: JMP. JMP offers a 64-bit version, and it makes

Programming Tips
0
Should you care about 64-bit applications?

Question: Is there a 64-bit version of SAS Enterprise Guide? Answer: SAS Enterprise Guide is a 32-bit application, even with its most recent release. As such, it is still completely supported on any 64-bit Windows machine, but it runs in the 32-bit subsystem (also known as WoW64 – short for

Programming Tips
0
Is SAS Enterprise Guide making you stupid?

Have you ever visited a city for the first time and, instead of relying maps to plan your journey, you simply plug your destinations into a GPS device and mindlessly follow the navigation directions? You've just cheated yourself out of a learning opportunity, because planning the journey and using your

Programming Tips
0
Live long and prosper using PROC REG

The secret to long life is good genes, right? This publication titled "Joint influence of small-effect genetic variants on human longevity" showed up on my Google alerts, and from what I can read (all of it) and understand (very little of it), that assertion is true. The researchers used PROC