Regular expressions provide a powerful method to find patterns in a string of text. However, the syntax for regular expressions is somewhat cryptic and difficult to devise. This is why, by my reckoning, approximately 97% of the regular expressions used in code today were copied and pasted from somewhere else. […]
Tag: sas programming
Comparing data set schemas in SAS
The project that I’m currently working on requires several input data tables, and those tables must have a specific schema. That is, each input table must contain columns of a specific name, type, and length in order for the rest of the system to function correctly. The schema requirements aren’t […]
Read a Microsoft date-time value into a SAS date-time value
A colleague was recently working with a web service that supplies some date-time values using the Microsoft Windows internal representation. He called the web service to retrieve those values (along with other data) from SAS, and he needed convert these values to SAS date-time values. The Microsoft definition for a […]
Improving on a SAS programming pattern
Earlier this week I described a common programming pattern in the SAS macro language. The pattern sets up a loop for processing each distinct value of a classification variable. The program uses the PROC SQL SELECT INTO feature to populate SAS macro variables. The effect: you can roll your own […]
Implement BY processing for your entire SAS program
Most SAS procedures support the BY statement, which allows you to create a report or analysis for each distinct value of a variable in your data set. The syntax is simple, and SAS procedures are usually tuned to do a good job of processing the data efficiently. However, the BY […]
Numbers great and small: the problem of Big Datum
About once a month, a customer approaches SAS and asks a question of significance. By “significance”, I don’t necessarily mean “of great importance”, but instead I mean “of how SAS handles large numbers, or floating-point values with many significant digits”. In response, we always first ask why they asked. This […]
Reaching a dubious peak
So many of us struggle with this mountain. In fact, 68.27% of us get within sight of reaching the summit (while 95.47% of us are at least on a perceivable slope). We run, walk, crawl and sometimes slide our way uphill (from one direction or the other) until we finally […]
Choose your own adventure with SAS OnDemand for Professionals
In the past, getting your hands on SAS for learning purposes required one of two fortunate situations: being a student enrolled in a college course (or high school!) where SAS is taught working for an employer who is willing to sponsor your training, either in an official course or on-the-job. […]