SAS Tips for Analysts

This article is a quick primer on SAS Engines using the proc nickname & Proc Contents.

I. What is a SAS Engine?

A SAS engine is a component of SAS software that reads from or writes to a file. Each engine enables SAS to access files that are in a particular format.

SAS provides many specific types of engines. SAS will usually assign one automatically for you based on the contents of the library, although it can be more efficient for you to set the library.

For instance, the SAS engine used to read a data set from a folder in a directory is the V9 engine, which is the Base SAS I/O Engine.

For instance when you assign a library name with the following command::

libname sas_qs “C:/ashish/sas_quickstart/data/sas_datasets”;

SAS returns the name of the engine used in the log file:

NOTE: Libref SAS_QS was successfully assigned as follows:

Engine:        V9

Physical Name: C:/ashish/sas_quickstart/data/sas_datasets

II. Specifying the SAS engine

If you want to specify the engine used in a SAS command, you can. For instance, you could modify the prior example to specify using the V9 engine:

libname sas_qs v9 “C:/ashish/sas_quickstart/data/sas_datasets”;

III. Identifying available SAS engines
SAS has an undocumented feature to see a list of all SAS engines that are available. Simply run the following code and it will report all the SAS engines in the log file:

Proc nickname; run;

Note: A Partial Output is displayed below

, SAS Tips for Analysts

IV. Listing Variables of datasets

Often we face a situation while applying statistical techniques like Linear and Logistic Regression, Sampling etc. where large number of variables are included in the model equation. Playing with these variables to write model equation consumes a lot analyst time. A SAS trick to list variables horizontally And then modify equation either adding or deleting variables will reduce analyst efforts and save time.

Below is the simple trick:

Proc contents data=Work.Credit short;


All variables in dataset are displayed in SAS output window separated by space.

, SAS Tips for AnalystsThis article has been written by Ashish Jain. Ashish is a business analyst with specialization in the financial analytics domain. He has worked on several analytics projects for a major US credit company.


Interested in learning about other Analytics and Big Data tools and techniques? Click on our course links and explore more.
Jigsaw’s Data Science with SAS Course – click here.
Jigsaw’s Data Science with R Course – click here.
Jigsaw’s Big Data Course – click here.

Related Articles

Please wait while your application is being created.
Request Callback