Sort Order, Formats, and Operators: A Tour of The SAS Documentation Page

SAS software sorting a to z or using arithmetic operators

SAS documentation pages have the reputation of being technically correct, but practically hard to use. Unlike with the typically user-generated R documentation, the typical SAS documentation page is short on examples. That being said, there are three SAS documentation pages that I visit often that I will share with you here.

Textbook explaining how to use SAS to program and design a data warehouse

Sort order, formats and operators…

…are covered in Chapter 3.

Buy the Book

SAS Documentation Page: Sort Order

SAS lets you name variables starting with some pretty weird characters, including underscore. The problem is that if you run a PROC CONTENTS, unless you check the native sort order on the SAS documentation page, you might not be able to locate your variables on the output!

SAS Documentation Page: Formats

SAS formats fall in four general categories: Character, Date and Time, ISO 8601, and Numeric. But within those categories, there are many ways to apply formats – both native SAS formats, and custom formats the user can develop. They are all listed on this SAS documentation page.

SAS Documentation Page: Operators in Expressions

One place where SAS really excels is that it offers many different ways to use operators in expressions. For example, the operation “greater than or equal to” can be expressed with symbols as >=, and with letters using ge. All the different alternatives are on this SAS documentation page.

Published November 26, 2020. Photograph of calculators by Marcin Wichary, available here. Shell sorting algorithm diagram by Balu Ertl, available here. Added FTC disclaimer December 20, 2020.

Get to know three of my favorite SAS documentation pages: the one with sort order, the one that lists all the SAS formats, and the one that explains all the SAS operators and expressions!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.