Tag: sas programming

Tricks for importing text files in SAS Enterprise Guide

I’m a big fan of the Import Data task in SAS Enterprise Guide, especially for its support of text-based files (CSV, tab delimited, fixed width, and more). There’s no faster method for generating SAS code that reads your data exactly the way you need it. I use the tool so […]

The post Tricks for importing text files in SAS Enterprise Guide appeared first on The SAS Dummy.

Jedi SAS Tricks: Pattern Search in DS2

Finding a pattern like a phone number or national ID number embedded in text can be difficult and time consuming. The traditional DATA step has a family of functions (collectively referred to as PRX functions) that allow using Perl regular expressions …

How to scrape data from a web page using SAS

The internet is rich with data, and much of that data seems to exist only on web pages, which — for some crazy reason — are designed for humans to read. When students/researchers want to apply data science techniques to analyze collect and analyze that data, they often turn to […]

The post How to scrape data from a web page using SAS appeared first on The SAS Dummy.

Learn more about SAS Viya with resources from SAS Education

SAS Viya is an exciting addition to the SAS Platform, allowing you to conduct analysis faster than ever before and providing you the flexibility to utilize open source technologies and generate insights from data in any computing environment. The blog …

Computing a date from the past (or future) with SAS

Social media has brought anniversary dates to the forefront. Every day, my view of Google Photos or Facebook shows me a collection of photos from exactly some number of years ago to remind me of how good things were back then. These apps are performing the simplest of date-based math […]

The post Computing a date from the past (or future) with SAS appeared first on The SAS Dummy.

Simple Proc Print trick for grouped data

Here’s a Proc Print trick for grouped data. Suppose your data is divided into groups, such as males and females. You could sort by the grouping variable before printing, like this: Suppose you want to better emphasize the groups. You could add a BY sta…

3 freaky ways PROC FREQ can work in your favor

A ghoulish Halloween Boo to all my readers! Hope my costume freaks you out, but even if it doesn’t, I’m positive PROC FREQ will in a few amazing ways! Today’s Programming 2: Data Manipulation Techniques class asked about the power of PROC FREQ. Since I stopped to explain some of it’s benefits to […]

The post 3 freaky ways PROC FREQ can work in your favor appeared first on SAS Learning Post.

Finding your Dream Car with a little macro magic

Suppose you want a list of car manufacturers from the CARS dataset. Easy!  Call the %CHARLIST macro from a %PUT statement, like this: The CHARLIST macro generates a list of unique values of a selected variable from a selected dataset. So does PROC FREQ. But, if you don’t need statistics, the CHARLIST […]

The post Finding your Dream Car with a little macro magic appeared first on SAS Learning Post.