SAS Do Loop, Do While and Do Until (Complete Guide With Examples)

What Is SAS Loop? A loop in SAS is a programming construct that is used to repeat a set of instructions for a specific number of times or until a certain condition is met. There are three basic types of loops in SAS: DO Loop: This loop performs a certain number of iterations. For example, … Read more

SAS: Append Values From Multiple Columns Into One Column (Reverse Transpose)

You can append values from the multiple columns into one column in SAS. It’s also called reverse transposing the dataset. You are appending values by merging columns into one column against one unique variable. The following sample dataset will be used to demonstrate how to append values from multiple columns into one column (reverse transposing … Read more

SAS: How To Combine Column Values Into A Single String

You can combine all the values present on one column and form a single string using macro variable. There might be a scenario where you want to create a macro variable and assign values to that variable referring to any specific variable from SAS dataset. There are multiple ways you can create macro variables and … Read more

SAS Arrays: How To Create And Use An Array (With Examples)

What Are SAS Arrays? In SAS, an array is a convenient way of temporarily identifying a group of variables. It’s not a data structure, and the array name is not a variable. An ARRAY statement defines an array. An array reference uses an array element in a program statement. All variables that are associated with … Read more

How To Use LIKE Operator In SAS (With Examples)

LIKE Operator In SAS The LIKE operator selects observations by comparing the values of a character variable to a specified pattern, which is referred to as pattern matching. The LIKE operator is case sensitive. There are two special characters available for specifying a pattern: 1. percent sign (%) It specifies that any number of characters … Read more

How To Use WHERE Statement In SAS (Explained With Examples)

The WHERE statement can be used to filter out or subsetting the data based on specific conditions. It specifies specific conditions to use to select observations from a SAS dataset. Using the WHERE statement might improve the efficiency of your SAS programs because SAS is not required to read all observations from the input data … Read more

PROC APPEND In SAS (With Examples)

The PROC APPEND procedure can be used to append observations from one dataset to the end of another SAS dataset. It kind of stacks the datasets one after another. The APPEND procedure functions the same as the APPEND statement in the PROC DATASETS procedure. The only difference between the APPEND procedure and the APPEND statement … Read more

5 Ways To Combining and Appending SAS Datasets

There are multiple methods that can be used to combine or append two or more datasets in SAS. In this article you’ll learn 5 simple ways to combine and append SAS datasets as follows. Appending Or Concatenating Two Datasets Vertically – Stacking The Datasets Appending Or Concatenating Stacked Sorted Data Values PROC APPEND To Concatenate … Read more

How To Check SAS LOCALE Language Code (Handle Multilingual SAS Data)

There might be scenarios where you’re dealing with data from multiple languages. If you are working with a multinational client but their entire system uses the English language then you don’t need to worry about SAS Env LOCAL language.  But if you have data sources coming from different countries and data prepared in their own … Read more

How To Change Encoding (WLATIN1 to UTF-8) In SAS

SAS reads and writes external files using the current session encoding. SAS assumes that the external file has the same encoding as the session encoding. But sometimes you get some weird characters because of the encoding mismatch of the systems.  UTF-8 is part of the Unicode coded character set. UTF-8 is the preferred and most-used … Read more