What's the difference between LENGTH and FORMAT in a SAS data set? This article shares the answer, with examples.
Tag: formats
If you use formatted variables in a CLASS statement in procedures such as MEANS or UNIVARIATE, SAS will use the formatted values of those variables and not the internal values. For example, consider you have a data set (Health) with variables Subj, Age, Weight, and Height. You want to see
In my previous blog, you saw how to create a Beale cipher. In this blog, you will see a program that can decode a Beale cipher. As a reminder, here is a list of numbers that you can use as a substitute for a letter when creating your cipher. Now,
Many years ago I shared a custom task that allows you to view and manage SAS catalogs within SAS Enterprise Guide. As a reminder, a SAS catalog is a special type of SAS file that acts as a container, like a folder, for a variety of content items called catalog
The Dw.p format displays numeric values, in a field w positions wide, possibly with a great range of values, lining up decimals for values of similar magnitude. The BESTDw.pformat combines the BESTw. format for integers and the Dw.p format for nonintegers. Specifying BESTDw.p (where p = w - 1) is better than specifying BESTw. for columns, since decimals do not shift when the last digit is 0.
In my local paper this morning, I read about how a North Carolina state commission plans to recommend changes to our teaching standards for mathematics. One of the topics that they want to bring back: Roman numerals. Why? According to my exhaustive 30 seconds of Internet research, the only practical
In my industry of data and computer science, precision is typically regarded as a virtue. The more exact that you can be, the better. Many of my colleagues are passionate about the idea, which isn't surprising for a statistical software company. But in social media, precision is a stigma --
I'm currently working on a large project for a SAS customer. The project comprises many activities and phases, so there is a need to track progress on many different levels. During a recent meeting the project manager announced, "I'm putting together a status deck, and I'll include some Harvey Balls
It's been almost 5 years since I posted one of the first custom tasks for SAS Enterprise Guide. It was a task that made it easier to convert SPSS data files into SAS data sets. Like many projects that begin as custom tasks, this one later became a feature in
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
On this blog, I've delivered a few tips about using SAS formats to stratify your data values "in place" without having to actually change your data. The most recent example addressed date and datetime variables. My previous examples included simple SAS programs that you can run in SAS display manager
I've been working with date-time data on a recent project, and I've come across a few SAS programs that have "opportunity for improvement" when it comes time to create reports. (Or maybe I haven't, and I contrived this entire blog post so that I could reference one of my favorite
Update 25Nov2010: I've updated this example to correct the code so that it works correctly for positive UTC offsets. Thanks to Bruno Müller, my colleague at SAS, for finding my mistakes. One of my SAS colleagues was recently working on a project where she had to create reports that include
Recoding values is one of the most common data prep tasks that folks need to do before they can analyze and report on data. In SAS, the most elegant way to handle this is by applying a SAS format. A SAS format allows you to "bucket" a bunch of raw