SAS Formats

The SAS formats are a type of SAS language element that applies a pattern to or executes instructions for a data value to be displayed or written as output.  Types of SAS formats: numeric, character, date, time, or timestamp.  The ability to create user-defined formats is also supported. The examples of SAS formats are BINARY, … 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

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

CALL EXECUTE In SAS (With 10+ Examples)

The SAS macro language is an extremely flexible tool which facilitates SAS programmers with the ability to re-run the same code for a set of different parameters. It can be done using DO-LOOP by passing required parameters but alternatively you could also use the CALL EXECUTE routine which is more robust and efficient.  Call Execute … Read more

How To Delete External Files If It Exists Using SAS Code

This is a very common operation performed in data management. When it comes to deletion of files it is always recommended to have file check logic in place before you attempt to delete files. You can delete files using the FDELETE() function. But before that you must verify if a file exists or not using … Read more