SAS Interview Questions and Answers
Freshers / Beginner level questions & answers
Ques 1. What is SAS?
SAS (Statistical Analysis System) is a software suite used for advanced analytics, business intelligence, data management, and predictive analytics.
Example:
SAS is used in various industries for tasks such as data analysis, reporting, and statistical modeling.
Ques 2. Explain the role of the WHERE statement in the DATA step.
The WHERE statement in the DATA step is used to filter observations based on specified conditions, allowing you to subset data within the data step.
Example:
DATA subset_dataset; SET original_dataset; WHERE age > 18; RUN;
Ques 3. What is the purpose of the SORT procedure in SAS?
The SORT procedure in SAS is used to sort a dataset based on one or more variables. It can be used to arrange data in ascending or descending order.
Example:
PROC SORT DATA=unsorted_dataset OUT=sorted_dataset; BY variable; RUN;
Ques 4. How do you concatenate datasets vertically in SAS?
The SET statement is used to concatenate datasets vertically in SAS. All datasets must have the same variables in the same order.
Example:
DATA combined_dataset; SET dataset1 dataset2; RUN;
Ques 5. What is the purpose of the FREQ procedure in SAS?
The FREQ procedure in SAS is used to generate frequency tables for categorical variables, showing the count and percentage of each category.
Example:
PROC FREQ DATA=dataset; TABLES category_variable; RUN;
Ques 6. How do you create a SAS macro variable?
A SAS macro variable can be created using the %LET statement or the %GLOBAL statement within a macro. It allows for the storage and reuse of values in a macro.
Example:
%LET my_variable = 100; /* Create a macro variable */ %PUT Value of my_variable: &my_variable;
Ques 7. Explain the purpose of the CONTENTS procedure in SAS.
The CONTENTS procedure in SAS is used to display information about the structure and attributes of a dataset, including variable names, types, lengths, and formats.
Example:
PROC CONTENTS DATA=dataset; RUN;
Most helpful rated by users:
- How do you concatenate datasets vertically in SAS?
- Explain the purpose of the CONTENTS procedure in SAS.
- Explain the difference between PROC MEANS and PROC SUMMARY.
- What is the difference between WHERE and IF statements in SAS?
- Explain the concept of a macro in SAS.