PROC PRINT In SAS (With 10+ Examples)

You can use the PROC PRINT procedure to print observations in a SAS data set using some or all of the variables. It’s one of the oldest yet relevant SAS procedures which is being used widely. With the new more advanced procedure like PROC REPORT, ODS system, PROC PRINT kind of left behind in the … Read more

PROC REPORT In SAS (With 15+ Examples)

PROC REPORT statement combines features of the PROC PRINT, PROC MEANS, and PROC TABULATE procedures with features of the DATA step in a single report-writing tool that can produce a variety of reports. You can use PROC REPORT procedure to create a report with the SAS dataset and in the formats you would like to … Read more

How To Use END=last Option To Select Last Observation In SAS

The END= option used in the data step is very powerful to identify the last observation from the SAS dataset. The end= option to tell SAS to create a temporary numeric value whose value is used to detect the last observation. The following sample dataset will be used to show how to use end=last option … Read more

How To Select First N Rows In SAS

In this article you’ll learn 8 different ways with examples on how to select the first N rows in SAS. Sometimes you may want to extract the first 5 observations or just a specific row, let’s say 5th observation, or you may want to extract observations within the specified range. Everything can be achieved using … Read more

How to Delete Rows in SAS [3 Simple Ways ]

Here are three different ways you can delete rows from SAS dataset. Each method has different ways to write a code, specify conditions based on that SAS deletes the rows from a dataset. Method 1: Use DATA STEP To Delete Rows In SAS /* delete rows if id>= 10 */ data new_dataset; set original_dataset; if … Read more

What’s Difference Between NODUPKEY and NODUP (NODUPRECS) In SAS PROC SORT

The both nodupkey and nodup (noduprecs) options can be used in the proc sort procedure. The function of these two options seems similar but it isn’t. In general they remove duplicate rows but in a bit different manner. It’s very important know the difference before you try to delete duplicate rows. With nodupkey option SAS … Read more

How to Create Country-Level Maps in SAS?

In this article you’ll learn how to create country-level maps in SAS Studio using BASE SAS code. You’ll learn how to draw country maps highlighting their states, regions or counties. There is a common structure to follow to create any country-level maps without much hustle. The coordinates and all the required information is already available … Read more

SAS: Create Permanent Format (Export Catalogues)

The formats are used in the SAS (statistical analysis system) to determine how variable values to be displayed or written as output. There are plenty of built-in formats available in SAS such as date9., w10., comma10.2, MMDDYYw., etc. It is also allowed to create your own user-defined formats in SAS. You can set your own … Read more