Posts

Working with the Census API Directly from SAS

A post showing how PROC HTTP and LIBNAME JSON can be used to directly work with the Census API from SAS.

Multline Bash Variable Replacement

I’ve recently needed to append several lines of data to a SAS data step that I collected and built via a shell script. For search-and-replace in bash I typically use sed, but this time I ran into a problem - sed does not like multiline shell variables.

Easy SASPy Setup from Jupyter

I love using SASPy, but the setup can take a minute. I used to do the setup via the CLI until I started thinking I might be able to just do it straight from a Jupyter notebook.

Cleaning up a Date String with RegEx in SAS

Sometimes we have to deal with manually entered data, which means there is a good chance that the data needs to be cleaned for consistency due to the inevitable errors that creep in when typing in data, not to speak of any inconsistencies between individuals entering data.

From Proc Import to a Data Step with Regex

I find myself needing to import CSV files with a relatively large number of columns. In many cases, proc import works surprisingly well in giving me what I want. But sometimes, I need to do some work while reading in the file and it would be nice to just use a data step to do so, but I don’t want to type it in by hand.

Making VS Code and Python Play Nice on Windows

One of the editors I use regularly is VS Code. I work a lot with Python, but when installing Anaconda using default settings on a Windows machine already having VSC installed there’s a good chance you’ll run into an issue.

Making INPUT and LABEL Statements with AWK

I am currently working with a database provided by the North Carolina Department of Public Safety that consists of several fixed-width files. Each of these has an associated codebook that gives the internal variable name, a label of the variable, its data type, as well as the start column and the length of the fields for each column.

SASPy Video Tutorial

I have been using both SAS and Python extensively for a while now. With each having great features, it was very useful to combine my skills in both languages by seamlessly moving between SAS and Python in a single notebook.

Census 2020 Population Estimates Updated

The Census Bureau has updated its population estimates for 2020 with county level data. This means any projects that have had to rely on the 2019 estimates can now switch to the 2020 estimates.

Using Git with SAS Studio

Git is a widely used version control system that allows users to track their software development in both public and private repositories. It is also increasingly used to store data in text formats, see for example the New York Times COVID-19 data set.