Base SAS Interview Questions – Crack Your Next Interview
Stay updated with the latest technology trends while you're on the move - Join DataFlair's Telegram Channel
1. Base SAS Interview Questions
Before we start our base SAS interview questions, let’s discuss a comprehensive understanding of what is SAS programming language. Now we will cover some of the important base SAS interview questions. We will first start from the basics and then move to an advanced level. These Base SAS interview questions are for both beginners and for experienced professionals.
2. Top SAS Interview Questions with Answers
Here, we discuss 30 Trichy Base SAS Interview Questions for 2018
Q1. What is SAS?
SAS is the abbreviation of the software called Statistical Analytics System. It includes the best software suite for multivariate analyses, advanced analytics, data management, predictive analysis, and business intelligence to name a few. It also offers a graphical point and click solution for the smooth interface. This way it is equally user friendly for the users who are nontechnical and thus make sure better-advanced options are found through SAS language.
Q2. What are the features of SAS?
SAS is the best platform that you can opt for. Since it is loaded with many benefits, you can enjoy features such as:
Data Access & Management: A user can also use it as DBMS software.
Reporting & Graphics: It can help you in visualizing the analysis in the type of lists, summary and even the graphic reports
Business solution: It offers the business analysis which you can later use as a the business product for different companies to use
Visualization: with this type of tool, it becomes possible to visualize the graphs that range from simple plots till the bar charts and even the complex classification panels.
Analytics: It is also considered to be the leading market leader in analytics for different business products and services.
Q3. What are the advantages of using SAS?
There are many alternatives for SAS but what makes it unique as compared to others is:
Ease to understand: The concepts included in SAS are extremely easy to learn. Besides, it offers the most convenient option for those who already are aware about the SQL. On the other hand, R comes with a steep learning cover which is considered to be a low level programming language.
Data Handling Capacities: it is at par the most leading tool which also includes the R& Python. When it comes to handle the huge data, it is the best platform to choose.
Graphical Capacities: it comes with functional graphical capacities and has a limited learning scope. It is possible to customize the plots.
Better tool management: It helps in a release the updates with regards to the controlled environment. This is the main reason why it is well tested. Whereas if you considered R &Python, it has open contribution and risk of errors in the current development are also high.
Q4. What are the uses of SAS?
SAS software provides tools for a wide variety of applications in business, government, and academia. Major uses of SAS are economic analysis, forecasting, economic and financial modeling, time series analysis, financial reporting, and manipulation of time series data.
Q5. What is the basic structure of a SAS program?
SAS programs consists of :
- DATA step, which recovers & manipulates data.
- PROC step, which interpret the data.
Q6. What is the basic syntax of a SAS program?
The points important for running SAS program are :
- DATA statement, which names your data set.
- The names of the variables in your data set are described by INPUT statement.
- Statement should be ended through semi-colon(;).
- Space between word and statement should be there.
Q7. What is a PDV and what are its functions?
Program Data Vector is the area of memory where data sets are created through SAS system i.e. one at a time. When program is executed an input buffer is created which will read the data values and make them assign to their respective variables.
- SAS creates a dataset one observation at a time.
- Input buffer is created at the time of compilation, for holding a record from external file.
- PDV is created followed by the creation of input buffer.
- SAS builds dataset in the PDV area of memory
Q8. What are the features of base SAS system?
It provides Ipv6 support, new true type fonts, extended time notations, restart mode, universal printing, checkpoint mode and ISO 8601 support.
Q9. What are the data types in SAS?
There are two SAS data types. Character and Numeric. Other than this, dates are also the part of the characters even if there are some functions to work as per the dates.
Q10. Explain the difference between PROC MEANS and PROC SUMMARY.
Under the PROC MEANS there is only a subgroup which is created only when there is a BY statement that is being used and the input data is previously well sorted out with the help of BY variables.
Under the PROC SUMMARY, there is a statistics which gets produced automatically for all the sub groups. It gives all sort of information that runs altogether. It would get the best sorting of the data set which is then produced with the help of the variables that significantly defines every sub group and runs the PROC MEANS.
Under the PROC SUMMARY section, the information in the output does not get created. At such time, you will have to use the OUTPUT statement for creating a new DATA SET and then use PROC PRINT to make sure the computed statics is visible
Base SAS Interview Questions for beginners- Q. 1,2,3,4,5,6,8,9
Base SAS Interview Questions for Experience- Q. 7,10
Q11. What is a PUT statement?
A PUT statement is a flexible tool in data step programming.
Examples of a PUT statement are:
PUT _all_ – writes the values of all variables
PUT 132*’_’ – writes 132 underscores
PUT one two three – writes three variable values separated by a space.
Q12. What is the difference between INPUT and INFILE statement?
The INFILE statement is used to identify an external file while the INPUT statement is used to describe your variables.
Q13. What is the difference between INFORMAT and FORMAT statement?
Format: A format is to write data i.e. WORDIATE18 and WEEKDATEW.
Informat: An informat is to read data i.e. comma, dollar and date (MMDDYYw, DATEw, TIMEw, PERCENTw.
Q14. What is the difference between SAS Functions and procedures?
Functions expect values to be supplied across an observation. Procedures expect one variable value per observation.
Q15. What are the different types of SAS Functions?
- Compress – sas function which is used to remove spaces in string value and concatenate two values Without spaces.
- Input is another function of sas, it is one of conversion function in sas. It converts numeric into char.
- Put is another conversion function in sas. It converts char to numeric.
- SAS functions can be used to convert data and manipulate character variable values.
Different types of functions:
TRIM : Removing the trailing blanks from character expressions.
SUBSTR: substr extracts the substring from an argument
Abs: Returns the absolute of the argument
The most common functions that would be used are-
Conversion functions – Input / Put / int / ceil / floor
Character functions – Scan / substr / index / Left / trim / compress / cat / catx / upcase,lowcase
Arithmetic functions – Sum / abs /
Dataset – open / close / exit
File functions – fexit / fopen/ filename / fileref
SQL functions – coalesce / count / sum/ mean
Date functions – date / today / datdif / datepart / datetime / intck / mdy
Array functions – dim
Q16. What is the difference between WHERE and IF statement?
- WHERE statementcan be used in procedures to subset data while IF statement cannot be used in procedures.
- WHERE can be used as a data set option while IF cannot be used as a data set option.
- WHERE statementis more efficient than IF statement. It tells SAS not to read all observations from the data set
- WHERE statement can be used to search for all similar character values that sound alike while IF statementcannot be used.
- WHERE statementcan not be used when reading data using INPUT statement whereas IF statement can be used.
- MultipleIF statements can be used to execute multiple conditional statements
- When it is required to use newly created variables, use IF statement as it doesn’t require variables to exist in the READIN data set.
Q17. What is PROC SORT?
It is used for sorting the SAS data for which variable are set. This way, it becomes possible to set a new data for further usage.
Q18. What is SUBSTR Function?
SUBSTR Function is used for extracting a string or replacing contents of character value.
Q19.How can SAS program be validated?
By writing OPTIONS OBS=0 at the starting of the code and if execution of code is On PC SAS than log will be detected itself by highlighted colors.
Q20. What does PROC PRINT and PROC CONTENTS do?
PROC print outputs a listing of the values of some or all of the variables in a SAS data set. PROC contents tells the structure of the data set rather than the data values.
Base SAS Interview Questions for beginners- Q. 11,12,13,14,15
Base SAS Interview Questions for Experience- Q. 16,17,18,19,20
Q21. What is the difference between the PROC SQL and DATA STEP?
Proc SQL is very convenient for performing table joins compared to a data step merge as it does not require the key columns to be sorted prior to join. A data step is more suitable for sequential observation-by-observation processing. PROC SQL can save a great deal of time if u want to filter the variables while selecting or u can modify them, apply format, creating new variables , macro variables, as well as sub setting the data. PROC SQL offers great flexibility for joining tables.
Q22. Describe the ways in which you can create a macro variable.
There are 5 ways to create macro variables:
- Iterative %DO statement
- Call Symput
- Proc SQl into clause
- Macro Parameters.
Q23. What is the difference between SET and MERGE?
SET concatenates the data sets where as MERGE matches the observations of the data sets.
Q24. How to read an input file in SAS?
Use the statements INFILE to point to the file reference(should be defined using Filename) / to the file path. Use INPUT statement to read the data into the sas dataset.
Q25. How to display duplicate observations in data?
There are two ways to display duplicate observations:
- In data step, using first.var and last.var.
- Using proc sort with option dupout option.
Q26. What is BY-group processing?
This type of term is used to make sure that the data which is process is grouped, indexed or even ordered based depending upon the variables.
Q27. What is the difference between reading data from an external file and reading data from an existing data set?
The main difference is that while reading an existing data set with the SET statement, SAS retains the values of the variables from one observation to the next. Whereas when reading the data from an external file, only the observations are read. The variables will have to re-declared if they need to be used.
Q28. How do dates work in SAS?
The central to every data set is the data itself. In SAS, the data is available in form of tabular manner where there are some of the variables that occupy the column space and also the row space gets occupied with the observation section.
The numbers are treated by SAS as the numeric data while other things come under the character data. This is the main reason why SAS comes with two types. If you take an example, SAS date is the numerical value which is equivalent to the days from the 1st of January, 1960
Q29. What are the functions used for character handling?
UPCASE and LOWCASE are the functions which are used for character handling functions.
Q30. How can you limit the variables written to output dataset in DATA STEP?
Both DROP and KEEP can be used to limit the variables in the dataset.
- The DROP=option tells SAS which variables you want to If you place the DROP= option on the SET statement, SAS drops the specified variables when it reads the input data set and if you place the DROP= option on the DATA statement, SAS drops the specified variables when it writes to the output data set.
- The KEEP=option tells SAS which variables you want to If you place the KEEP= option on the SET statement, SAS keeps the listed variables when it reads the input data set. On the other hand, if you place the KEEP= option on the DATA statement, SAS keeps the specified variables when it writes to the output data set.
Base SAS Interview Questions for beginners- Q. 24,26
Base SAS Interview Questions for Experience- Q. 21,22,23,25,27,28,29
So, these were some of the most important base SAS interview questions asked at a basic or a beginner level in SAS Interview. In the next part, we will see some more tough and interesting SAS Interview questions. Furthermore, if you have any query regarding Base SAS Interview Questions feel free to ask in a comment section.
- Top 30 SAS Interview Questions and Answers
- 31 Tricky SAS Interview Questions for Freshers & Experience