Top 20 SAS Interview Questions & Answers

SAS is one of the most popular Data Analytics tool available in the market. This blog is the idol guide for you to learn all the concepts required to crack a SAS interview. We have separated the questions based on the difficulty levels and this will help people with different expertise levels to reap the maximum benefit from our blog. SAS Interview Questions blog will be a one-stop resource from where you can boost your interview preparation.

  1. What is SAS?

SAS stands for Statistical Analytics System is a software suite for advanced analytics, business intelligence, multivariate analyses, data management and predictive analytics.

  1. What are the features of SAS?

The following are the features of SAS:

  • Business Solutions: SAS offers business analysis that can be used as business products for several organizations to use.
  • Data Access & Management: It can also be used as DBMS software.
  • Analytics: SAS is the market leader in the analytics of numerous business products and services.
  • Visualization: We can visualize the reports in the form of graphs ranging from simple scatter plots and bar charts to complex multi-page classification panels.
  • Reporting & Graphics: SAS helps to visualize the analysis in the form of summary, lists and graphic reports.
  1. Name few SAS functions?


  • Scan()
  • Trim()
  • Substr()
  • Catx()
  • find()
  • Index()
  • tranwrd()
  • Sum()
  1. Compare SAS with other data analytics tools.

We will compare SAS with the popular alternatives in the market based on the following aspects:

  • Ease of Learning: SAS is easy to understand and provides easy option for individuals who already know SQL while on the other hand R has a very steep learning curve as it is a low level programming language.
  • Data Handling Abilities: SAS is on par with all leading tools including R & Python when it comes to handling massive amount of data and options for parallel calculations.
  • Graphical Capabilities: SAS provides functional graphical proficiencies and with a little bit of learning, it is possible to modify on these plots.
  • Advancements in Tool: SAS releases updates in controlled environment, hence they are well tested. R & Python on the other hand, have open contribution and there are chances of issues in latest developments.
  • Job Scenario: Worldwide, SAS is the pioneer in available corporate jobs. In India, SAS controls about 70% of the data analytics market share compared to 15% for R.


  1. Mention few capabilities of SAS Framework.

The following are the few capabilities in SAS Framework:

  • Access: SAS enables us to access data from various sources like an Excel file, raw database, Oracle database and SAS Datasets.
  • Manage: We can then handle this data to subset data, create variables, authenticate and clean data.
  • Analyze: Further, analysis happens on this data. We can perform simple analyses like frequency and averages and complex analyses including regression and forecasting. SAS is the gold standard for statistical analyses.
  • Present: In the last we can present our analysis in the form of list, summary and graphic reports. We can print these reports, write them to data file or publish them.
  1. What is the function of output statement in a SAS Program?

OUTPUT statement is used to save summary statistics in a SAS data set. This information can then be used to create modified reports or to save historical information about a process. You can use options in the OUTPUT statement to

  • Identify the statistics to save in the output data set
  • Specify the name of the output data set
  • Figure out and save percentiles not automatically computed by the CAPABILITY procedure.
  1. What is the function of Stop statement in a SAS Program?

Stop statement is used to stop processing the current data step instantly and resume processing statement after the end of current data step.

  1. How many data types are there in SAS?

There are two data types in SAS:

  • Character
  • Numeric

Apart from this, these are also considered as characters although there are implied functions to work upon dates.

  1. What is the difference between SAS functions and procedures?

SAS functions:  expect argument values to be supplied across an observation in a SAS data set whereas a

Procedure: It expects one variable value per observation.

  1. What are the differences between sum function and using “+” operator?

SUM function: It returns the sum of non-missing arguments

“+” operator: It returns a missing value if any of the arguments is missing.

  1. What are the differences between PROC MEANS and PROC SUMMARY?

PROC MEANS: It produces subgroup statistics only when a BY statement is used and the input data has been previously fixed by the BY variables.

PROC SUMMARY: It automatically produces statistics for all subgroups, giving you all the information in one run that you would get by constantly sorting a data set by the variables that define each subgroup and running PROC MEANS. PROC SUMMARY does not produce any information in your output. So you will need to use the OUTPUT statement to create a new DATA SET and use PROC PRINT to see the computed statistics.

  1. Give an example where SAS fails to convert character value to numeric value automatically?

Suppose value of a variable PayRate starts with a dollar sign ($). When SAS tries to automatically convert the values of PayRate to numeric values, the dollar sign blocks the procedure. The values cannot be converted to numeric values. Therefore, it is always best to include INPUT and PUT functions in your programs when conversions occur.

  1. How do you delete duplicate observations in SAS?

There are three ways to delete duplicate observations in a data set:

By using nodups in the procedure

Proc sort data=SAS-Dataset nodups;

    by var;


By using an SQL query inside a procedure

Proc sql;

Create SAS-Dataset as select * from Old-SAS-Dataset where var=distinct(var);


By cleaning the data

Set temp;

By group;

If and then


  1. How does PROC SQL work?

PROC SQL is a synchronized process for all the observations. The following steps happen when PROC SQL is executed:

  • SAS scans every statement in the SQL process and check syntax errors, such as missing semicolons and invalid statements.
  • SQL optimizer scans the inquiry inside the statement. The SQL Optimizer chooses how the SQL query should be executed in order to reduce run time.
  • Any tables in the FROM statement are loaded into the data engine where they can then be accessed in memory.
  1. Code and Calculations are executed.
  2. Final Table is sent to the output table described in the SQL statement.
  3. Final Table is created in memory.

  1. Briefly explain Input and Put function?

Input function:  Character to numeric conversion- Input(source,informat)

Put function: Numeric to character conversion- put(source,format)

  1. Suppose the variable address stores the following expression:


What would be the result returned by the scan function in the following cases?



a=Road; b=NY

  1. What is the length assigned to the target variable by the scan function?


  1. How to limit decimal places for variable using PROC MEANS?

 By using MAXDEC= option

  1. How do dates work in SAS data?

Data is vital to every data set. In SAS, data is accessible in tabular form where variables occupy the column and observations occupy the row space.

SAS treats numbers as numeric data and everything else comes under character data. Hence SAS has two data types numeric and character.

Moreover, dates in SAS are represented in a special way compared to other languages.

A SAS date is a numeric value equal to the number of days since January 1, 1960.

Apart from Date Values, there are various tools to work on dates such as informats for reading dates, functions for manipulating dates and formats for printing dates.

  1. What is interleaving in SAS?

Interleaving syndicates individual sorted SAS data sets into one sorted SAS data set. For each observation, the following figure shows the value of the variable by which the data sets are sorted. You interleave data sets using a SET statement along with a BY statement.


Add a Comment

Your email address will not be published. Required fields are marked *