19.4 C
New York
Wednesday, August 17, 2022

SAS Interview Questions and Answer

- Advertisement -

What is SAS? What does SAS stands for?

SAS (Statistical Analysis System) is a software package used for business analytics, business intelligence, predictive analysis, and data management. It helps the organizations to handle their datasets and take well-informed data-driven decisions with the help of visual reports.

What are some important features of SAS?

The most important features of SAS are:

  • It has data analysis capabilities starting from simple statistics to advanced level analytics.
  • It has the ability to read any file or data format.
  • The syntax is easy and has the support of many libraries.
  • It has a feature called the SAS environment manager that is used for monitoring and managing the analytics environment.
  • It is highly secure and maintains the security of the SAS data through the SAS/SECURE.

Explain the basics structure of SAS program?

The SAS has the following program structure:

  • The Data step – In this step, a data set is created that works as the source of data analysis.
  • The PROC step – Here, data from the above data set is analyzed.
  • The Output step – Here, the result of the data analysis done in the previous step is shown as output.

How many data type present in SAS?

SAS has the following data types namely numeric, character and date.

Explain the difference between If and Where in SAS?

The rules of the Where statement are verified when the DATA step gets compiled. When the DATA step runs, the records are filtered that matches the Where condition. So, only these data records get loaded into the program data vector. If the statement is analyzed at runtime, on variables that are already in the PDV.

What is PDV in SAS?

PDV (Program Data Vector) is the memory space that is created during the processing of a data step. It contains two variables permanent and temporary. SAS reads one observation into the PDV and writes that observation into the target dataset.

What is clinical SAS?

SAS clinical is an application used in the clinical domain for conducting research and experimentation by pharmaceutical companies. Clinicians and doctors use SAS programming to collect and examine clinical data.

What is the base SAS?

Base SAS is the foundation for all SAS software that has a flexible programming language. It has a web-based interface used for data manipulation, data storage, and retrieval and analyzing any data. It can be combined with Hadoop and MapReduce programs to work and manage large datasets.

How to create a permanent library in SAS?

Steps to create a permanent library in SAS are as follows:

  • For a new library, the read/write/execute permissions are required. As rights to the server are needed, it is advisable that the administrator creates the library.
  • A permanent library is created in the SAS management console., where the metadata is stored.
  • In the stored process or program the meta-library has to be referenced by the statement

LIBNAME LocalLib METALIBRARY=’lib_name’; where lib_name is the library created in the SAS management console.

What is SAS Model?

The SAS (Statistical Analysis System) is a software model that is used for business analytics, business intelligence, predictive analysis, and data management. The SAS software suite has a Model that is used for managing analytical models through a web interfaced repository. Candidate models are also developed and validated through SAS Model manager.

How to import xlsx file in SAS?

The excel files having an extension of flux can be converted into SAS using the PROC Import and the SAS Studio point and click method.

How to find missing values in SAS?

The missing values in SAS can be found out by the following steps:

  • Specify such a format for the variables so that the missing variables have a single value and the now missing value have a different value.
  • In the Tables statement, mention the Missing and Misprint
  • In the Tables statement, use the _char_ and _numeric_ keywords for mentioning that the FREQ procedure analyses the statistics for all numeric and character values.

What is the data step in SAS?

A group of SAS language statements that start with a DATA statement is called a data step. It is the basic step of creating a data set with Base SAS software. It contains other statements that are used to manipulate the SAS datasets and develop new data sets from raw data files. A data step can be used for evaluating variable values, obtaining information, managing files, writing files, etc.

What is SAS grid?

The SAS grid is an environment where the tasks are distributed among multiple systems on a network, which is managed by the SAS Grid Manager. The workload is distributed across the system grid that helps in job scheduling, load balancing of the work and acceleration of the processing.

Difference between nodupkey and nodup options in SAS?

In SAS, the Nodup option in Proc sort is used to remove the duplicate records that are contiguous, before sorting the data on variables that are listed in the Proc sort statement. The Nodupkey is used to remove the duplicate observations in the data according to the variables listed in the BY statement in Proc sort.

How to comment in SAS?

Steps to comment code in SAS are as follows:

  • Highlight the several lines of code using the cursor.
  • Press Ctrl + / to comment out the lines of code.
  • To uncomment press Ctrl + Shift+ /.

How to convert character to numeric in SAS?

In SAS, the INPUT and PUT functions are used to convert values present inside a character variable to numeric values. A new variable is created when these functions are used that have converted values. The following code has to be used:

new_converted_variable = input (original_variable, informat.);

Here the informat instructs SAS to interpret the value in the original variable.

How to rename variables in SAS?

The README function is used to rename a variable into another new name. To alter the name of the variable in a SAS dataset, the following code has to be used:

RENAME = (old_name=new_name old_name2=new_name2 .... oldk=newk);

Here old_name is the name of the original variable and new_name is the new variable name that has to be altered. If the RENAME=option is in the SET statement, the alteration of the variable name takes place when the program vector is created.

How to import SAS dataset into SAS?   

A SAS dataset is placed inside a library where the libname statement connects the library name to a directory. The datasets are read through the PROC SQL or Merge statements in the data steps.

Explain Input and Put functions in SAS.

  • The INPUT function is used to convert the value of a variable into another value according to a specified format. They are used to change a character value to a numeric value.
  • The PUT function is also used to change a numeric value to a character value. The function has no effects on the formats specified in the PUT statement.       

SAS Developer Interview Questions and Answer

Please consider the following question very seriously because I have given plenty of Interview for SAS Developer and often interviewer asked me these following question.

1) What are the SAS functions you have used?

2) In which case you go for libname and in which case you go for proc SQL pass-through facilit diff?

3) Suppose I have a dataset with variables empid and doj then how to calculate retirement age?

4) Difference between proc sql merge and join?

5) Difference between where and if statement in SAS?

6) What data step statements you have used in your project?

7) How many tiers in SAS architecture?

8) If I have a million observations, I want to read 1 and last observation, how can we do?

9) What is %sysfunc?

10) How many ways to create a macro?

11) What macro functions you have used?

12) Difference between %str and %nrstr? In how many ways you can schedule a job?

13) How many methods are available in SAS to eliminate duplicates?

14) I have 2 datsets:ds 1 ds2


empid empname

1 x
1 y
2 z 


empid deptname

  • Hyderabad
  • Bangalore
  • Chennai

I want inner join how many records using match-merge and SQL join will be there in resultant data set?

15) How many ways to import text file into SAS using data step?

16) Why call symput?

17) What are the formats we have?

- Advertisement -

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles