Here is the collection of the SAS programs. These SAS programming examples will help you learn and understand various concepts in SAS.

How to List all files recursively in SAS?

September 30, 2023

Discover how to ‘List all files recursively’ in SAS with the powerful list_files macro.

Quick Guide: Verify Files Before Data Import

September 23, 2023

Learn how to check if a CSV file has data and import it into SAS. Explore different methods to check multiple CSV files for existence in SAS.

How to convert a Unix datetime to a SAS datetime

April 30, 2023

You can convert a Unix datetime to a SAS datetime by adding the number of seconds in 10 years. The Number of seconds between 01JAN1960 and 01JAN1970 is 315619200.

7 Ways to Find Maximum Value in a Group with SAS

April 5, 2023

When working with large datasets, it is often useful to identify the maximum value within each group of observations. For example, you may want to find the highest sales amount for each salesperson, or the tallest tree in each forest. SAS provides several procedures that can help you find the maximum value in a group, including PROC SQL, PROC MEANS, PROC UNIVARIATE, and PROC RANK.

How to Create a Quoted List Separated by Spaces in SAS

February 16, 2023

In this article, we will walk you through the process of creating a quoted list separated by spaces in SAS.

5 Techniques for Quickly Removing Leading Zeros in SAS

January 4, 2023

Leading zeros can be complicated to work with in SAS. Here are 5 easy techniques to help make your work easier!

How to Loop through Dates in SAS?

August 28, 2022

In this example, you’ll see how to use a SAS…

How to Print Empty SAS dataset information to the output window?

August 25, 2022

If the file is empty, the PROC PRINT can read…

How to determine if the external file is empty in SAS?

August 24, 2022

The macro checks determine if the external file is empty…

Subscribe to Our Newsletter

Subscribe to 9to5sas for timely SAS tips and news delivered each month.
Learn about the latest articles, and code samples to keep your SAS skills fresh!