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
Tag: tips and tricks
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
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
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
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
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
Default PROC FREQ output looks like this: Suppose you don't want the two cumulative statistic columns above. No problem. Those can be suppressed with the NOCUM option on the TABLE statement, like this: proc freq data=sashelp.shoes; table product / nocum; run;
I recently taught a SAS training course where the students were very engaged. They had so many questions, I could have spent the next month writing helpful blog posts that came from that one class. However, I picked this one question that the class begged for me to share. The
SAS software is used around the world in some of the most sophisticated ways, like ATM fraud detection and cancer research. But recently, I used it for a practical, and much needed, task -- replacing our break room coffee machine. Now, this is no ordinary coffee machine. It also makes
Dataset too big for PROC PRINT? One weird trick solves your problem! proc print data=bigdata (obs=10); run; The OBS= dataset option specifies the last observation to process from an input dataset. In the above example, regardless of dataset size, only the first 10 observations are printed; an easy way to