SAS Interview Questions and Answers
Ques 21. 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 22. 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 23. 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;
Ques 24. What is the purpose of the SGPLOT procedure in SAS?
The SGPLOT procedure in SAS is used for creating statistical graphics and plots. It provides a versatile way to visualize data using different types of charts.
Example:
PROC SGPLOT DATA=dataset; SCATTER x=variable1 y=variable2; 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.