Tag: tips and tricks

Random Sampling: What’s Efficient?

Suppose you wish to select a random sample from a large SAS dataset.  No problem. The PROC SURVEYSELECT step below randomly selects a 2 percent sample: proc surveyselect data=large out=sample method=srs /* simple random sample */ n=1000000; /* sample size */ run; Do you have a SAS/STAT license?   If not, […]

The post Random Sampling: What’s Efficient? appeared first on SAS Learning Post.

What’s wrong with this SAS program?

I think everyone can agree that being able to debug programs is an important skill for SAS programmers. That’s why Susan Slaughter and I devoted a whole chapter to it in The Little SAS® Book. I don’t know about you, but I think figuring out what’s wrong with my program […]

The post What’s wrong with this SAS program? appeared first on SAS Learning Post.

Reading Hierarchical Data – Part 3

This post is the third and final in a series that illustrates three different solutions to “flattening” hierarchical data.  Don’t forget to catch up with Part 1 and Part 2. Solution 2, from my previous post, created one observation per header record, with detail data in a wide format, like […]

The post Reading Hierarchical Data – Part 3 appeared first on The SAS Training Post.

Reading hierarchical data – Part 2

This post is the second in a series that illustrates three different solutions to “flattening” hierarchical data. Solution 1, from my previous post, created one observation per header record, summarizing the detail data with a COUNT variable, like this: Summary Approach: One observation per header record   Obs Family Count […]

The post Reading hierarchical data – Part 2 appeared first on The SAS Training Post.

Reading hierarchical data – Part 1

A family and its members represent a simple hierarchy.  For example, the Jones family has four members: A text file might represent this hierarchy with family records followed by family members’ records, like this:   The PROC FORMAT step below defines the codes in Column 1: proc format; value $type […]

The post Reading hierarchical data – Part 1 appeared first on The SAS Training Post.

Jedi SAS Tricks – Maximum Warp with Hadoop

I’m gearing up to teach the next “DS2 Programming Essentials with Hadoop” class, and thinking about Warp Speed DATA Steps with DS2 where I first demonstrated parallel processing using threads in base SAS. But how about DATA step processing at maximum warp? For that, we’ll need a massively parallel processing […]

The post Jedi SAS Tricks – Maximum Warp with Hadoop appeared first on The SAS Training Post.

SAS Enterprise Guide: Suppress Output Data tab when programming

Have you ever waited a bit for SAS Enterprise Guide to display the Output Data tab when submitting a SAS program that generates multiple output tables?  Or, perhaps your program only generates one big output table but it takes a little while for it to surface on the Output Data […]

The post SAS Enterprise Guide: Suppress Output Data tab when programming appeared first on The SAS Training Post.

DATA STEP text file tricks

When reading a text file (common extensions: TXT, DAT; or, for the adventurous: HTML) with the DATA STEP, you should always view several lines from the text file, and compare to the record layout, before completing the INPUT statement.  There are many ways to view a text file.  I use […]

The post DATA STEP text file tricks appeared first on The SAS Training Post.