15+ Must-Know SAS [ Clinical ] Interview Questions & Answers
Last updated on 04th Jul 2020, Blog, Interview Questions
- These SAS Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of SAS.
- As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer.
- We are going to cover top 100 SAS Interview questions along with their detailed answers.
- We will be covering SAS scenario based interview questions, SAS interview questions for freshers as well as SAS interview questions and answers for experienced.
Q1.What is SAS? What are the functions does it performs?
- SAS means Statistical Analysis System, which is an integrated set of software products.
- Information retrieval and data management Writing reports and graphics
- Statistical analytics, econometrics and data miningBusiness planning, forecasting, and decision support Operation research and Project management
- Quality Improvement
- Data Warehousing
- Application Development
Q2. What is the basic structure of the SAS base program?
The basic structure of SAS consist of==DATA step, which recovers & manipulates data.==PROC step, which interprets the data.
Q3. What is the basic syntax style in SAS?
To run the program successfully, and you have the following basic elements:
- There should be a semi-colon at the end of every line A data statement that defines your data set Input statement There should be at least one space between each word or statement A run statement .
- For example: In file ‘H: \StatHW\yourfilename.dat’;
Q4. Explain data step in SAS
- The Data step creates a SAS dataset which carries the data along with a “data dictionary.”
- The data dictionary holds information about the variables and their properties.
Q5. What is PDV?
- The logical area in the memory is represented by PDV or Program Data Vector.
- At the time, SAS creates a database of one observation at a time.
- An input buffer is created at the time of compilation which holds a record from an external file.
- The PDV is created following the input buffer creation.
Q6. What are the data types does SAS contain?
The data types in SAS are Numeric and Character.
Q7.Which statement does not perform automatic conversions in comparisons?
In SAS, the “where” statement does not perform automatic conversions in comparisons.
Q8. What is a method to debug and test your SAS program?
You can debug and test your SAS program by using Obs=0 and systems options to trace the program execution in log
Q9. What is the difference between nodupkey and nodup options?
The difference between the NODUP and NODUPKEY is that NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables
Q10. Name validation tools used in SAS
For DataSet : Data set name/ debug Data set: Name/stmtchk
For SAS Macros variables: Options: mprint mlogic symbolgen
Q11. What does PROC print, and PROC contents do?
- To display the contents of the SAS dataset PROC print is used and also to assure that the data were read into SAS correctly.
- While PROC CONTENTS display information about a SAS dataset.
Q12. What is the use of function Proc summary?
- The syntax of proc summary is the same as that of proc means.
- It computes descriptive statistics on numeric variables in the SAS dataset.
Q13. What Proc glm does?
Proc glm performs simple and multiple regression, analysis of variance (ANOVAL), analysis of covariance, multivariate analysis of variance and repeated measure analysis of variance.
Q14. What is SAS informats?
- SAS INFORMATS are used to read, or input data from external files known as Flat Files ASCII files, text files or sequential files).
- The informat will tell SAS on how to read data into SAS variables.
Q15. Name types of category in which SAS Informats are placed
SAS informats are placed in three categories,
- Character Informats : $INFORMATw
- Numeric Informats : INFORMAT w.d
- Date/Time Informats: INFORMAT w.
Q16. What function CATX syntax does?
CATX syntax concatenates character strings remove trailing and leading blanks and inserts separators.
Q17. What is the use of PROC gplot?
PROC gplot has more options and can create more colorful and fancier graphics.
Q18. What is PROC in SAS?
- In SAS, PROC steps analyze and process data in the form of an SAS data set.
- It controls a library of routines that perform tasks on SAS data set options such as sorting, summarizing and listing.
Q19. What is the SAS data set?
A SAS data set is a file consisting of two parts.
- A descriptor portion
- A data portion
Q20. List out some key concept of SAS
Some key concept of SAS include ,SORT procedure Missing values KEEP=, DROP= dataset options Data step logic Reset to missing, or the RETAIN statement Log FORMAT procedure for creating value formats Data typesIN= dataset option.
Q21. What is the difference between INPUT and INFILE ?
INFILE statement is used to identify an external file
INPUT statement is used to describe your variables
Q22. State the difference between INFORMAT and FORMAT ?
- INFORMAT: To indicate SAS that a number should be read in a particular format
- FORMAT: To indicate SAS how to print the variables
Q23. What is factor analysis?
- Factor analysis is a common term used for a family of statistical techniques associated with the reduction of a set of observable variables in terms of a small number of latent factors.
- The main goal of factor analysis is data reduction and summarization.
Q24. How you can read the variables that you need?
You read the variables using input statement with column /line pointers, informats and length specifiers.
Q25. What are the special input delimiters used in SAS?
Special input delimiters used in SAS are DLM and DSD.
Q26. How SAS treats the DSD delimiters?
When you define DSD, SAS treats two consecutive delimiters as a missing value and removes quotation marks from character values.
Q27. What is the good SAS programming practices for processing large data sets?
The good SAS programming practices for processing large data sets is to sort them once using firstobs= and obs=.
Q28. How to include or exclude specific variables in a data set?
To include or exclude specific variables in a data set you can use DROP, KEEP Statements and Data set Options.
Q29. How SUBSTR function works in SAS?
The SUBSTR function is used to abstract substring from a character variable.
Q30.What SAS features do you use to check errors and data validation?
To check errors, use the Log, and for data validation use things like Proc Freq, Proc Means or sometimes Proc print to see how data looks.
Q31. What are the ways to do a “table lookup” in SAS?
There are five ways to do a “table lookup” in SAS which include:
- PROC SQL
- Match Merging
- Direct Access
- Format Tables
Q32. How will you generate test data with no input data?
You will generate test data with no input data using “put” statement and “Data Null”.
Q33. What are the difference between CEIL and FLOOR functions in SAS?
- The “floor” returns the greatest integer less than/equal to the argument.
- Whereas the “ceil” function returns the smallest integer greater than/equal to the argument.
Q34. What are the difference between SAS functions and procedures?
The difference between SAS functions and procedures is that Procedures expect one variable value per observation Functions expect values to be supplied across an observation
Q35. How to remove duplicates using PROC SQL?
To remove duplicates using PROC SQL use following step,Proc SQL noprint;
Create Table inter.merged1 as Select distinct * from inter.readin ; Quit;
Best SAS Clinical Certification Course to Boost UP Your SkillsWeekday / Weekend BatchesSee Batch Details
Q36. What are common programming errors committed in SAS
Common programming errors committed in SAS are,
- Missing semicolon
- Not checking log after submitting program
- Not using debugging techniques
- Not using Fsview option vigorously
Q37. How to limit decimal places for the variable using PROC MEANS?
By using MAXDEC=option, you can limit decimal places for the variable
Q38. What are the difference between the SAS DATA STEP and SAS PROCs?
SAS DATA STEP is used to read in and manipulate data
SAS PROCs are sub-routines perform tasks on SAS data set.
Q39. What is the use of STOP statement?
A STOP statement is used to control the continuous looping in SET statement.
Q40. What is RUN-Group processing?
RUN-Group processing allows submitting a PROC step using RUN statement without ending the procedure.
Q41. How to test the debugging in SAS?
For debugging in SAS use the Debug clause after ‘/’ in the data statement.
Q42. How to create a permanent SAS data set?
- In order to create a permanent SAS data set, there are two steps necessary,
- Assign a library and engine. Create the data. Make sure to assign both a library (other than WORK) and data set name to make the data set permanent.
Q43. What is SLIBREF?
- SLIBREF is a server-libref.
- It specifies the libref that is used by the server to identify the SAS data library when no physical name is determined, and the server libref is different from the client libref.
Q44. What are the default statistics that PROC MEANS produce?
The default statistics that PROC MEANS produce are,
- STD DEV
Q45. What is the command used to find missing values?
The command used to find missing values is
Q46. What is the difference between Match Merge and One to One Merge?
A one-to-one merge is suitable if both data sets in the merge statement are sorted by id, and each observation in one data set has a corresponding observation in the other data set. If the observations do not match, then match merging is suitable.
Q47. What are the scrubbing procedures in SAS?
The scrubbing procedures in SAS are Proc Sort with nodupkey option. It will eliminate duplicate values.
Q48. What is the use of the %include statement?
%INCLUDE statement reads an entire file into the current SAS program you are running and submits that file to the SAS System immediately.
Q49.How can SAS program can 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.
- These are the two ways for validating an SAS program.
Q50.Explain SUBSTR function?
SUBSTR function is used for extracting a string or replacing contents of character value.
Q51.Explain PROC SORT?
PROC SORT sorts SAS data set by variables so that a new data set can be prepared for further use.
Q52.Explain PROC UNIVARIATE?
PROC UNIVARIATE is used for elementary numeric analysis and will examine how data is distributed.
Q53.What do you mean by CALL PRXFREE Routine?
CALL PRXFREE routine is used for Character String Matching and is used for allocation of free memory for perl regular expression.
Q54.Explain APPEND procedure?
APPEND means adding at the end so in terms of SAS we can say adding one sas data set to another sas data set.
Q55.Explain BMDP procedure?
For analyzing data BMPD procedure is used.
Q56.Define RUN-Group processing?
RUN-Group processing is used to submit a PROC step using RUN statement without ending the procedure.
Q57.Explain BY-Group processing?
BY statement is used by BY-Group processing so that it can process data which are indexed, grouped or ordered based on the variables.
Q58.What will CALENDAR procedure do?
CALENDAR procedure will show data in a monthly calendar format from SAS data set.
Q59.What are the functions which are used for Character handling functions?
UPCASE and LOWCASE are the functions which are used for character handling functions.
Get SAS Clinical Training from Industry Experts Trainers
- Instructor-led Sessions
- Real-life Case Studies
Q60.What is the use of DIVIDE function?
DIVIDE function is used to return the division result.
Q61.Explain TRANSLATE function?
TRANSLATE function: Characters which are specified in a string are replaced by the characters specified by us.
Q62.Explain BOR function?
It is a bitwise logical operation and is used to return bitwise logical OR between two statements.
Q63.Explain CALL PRXCHANGE routine?
It is used for performing replacement of pattern matching.
Q64.Explain ANYDIGIT function?
It is used for searching a character string and as soon as string is found it will return it.
Q65.What do you understand by CALL MISSING routine?
The character or numeric variables which are specified will be assigned missing values through CALL MISSING routine.
Q66.What do you mean by ALTER data set option?
It is used for assigning an ALTER password which will stop the users from changing the file.
Q67.Explain COMPRESS data set option?
It is used for compressing the data into new output.
Instruction used by SAS for writing data values is known as Formats.
Q69.How variable formats are handled by PROC COMPARE?
Variable formats are handled by PROC COMPARE as PROC COMPARE is used for comparing unformatted values.
Q70.What are the features of SAS system?
It provides Ipv6 support, new true type fonts, extended time notations, restart mode, universal printing, checkpoint mode and ISO 8601 support.
Q71.What is the use of $BASE64X?
By using base 64 encoding, character data is converted into ASCII text.
Q72.Explain VFORMATX Function?
It is used to return the format which is assigned with the value of the given Statement.
Q73.Define STD function?
Standard deviation will be returned for nonmissing statements.
Q74.What is Debugging?
Debugging is the technique for testing the program logic and this can be done with the help of debugger.
Q75.Explain FILECLOSE data set option?
When data set is closed, its tape positioning is defined by FILECLOSE.
Q76.What does ODS stands for?
ODS stands for output delivery system.
Q77.What does CDISC stands for?
CDISC stands for Clinical Data Interchange Standards Consortium.
Q78.Which method is used to copy blocks of data?
The method which is used to copy blocks of data is defined as block I/O method.
Q79.What is the procedure for copying an entire library?
Copy statement should be followed by an input data library and an output data library.
Q80.Define MAX () function?
Max () function is used to return the largest value.
Q81.What is the use of sysrc function?
It is a function which provides a system error number.
Q82.Explain what is SAS? What are the functions does it performs?
- SAS i.e. Statistical Analysis System is a combined set of software solutions which helps user to analyze data.
- It can change, manipulate, analyze & retrieve data. Numerical analysis can be done. Report writings. Quality can be improved.
Q83.Explain what is the basic structure of SAS programing?
SAS programs consists of: DATA step, which recovers & manipulates data. PROC step, which interpret the data.
Q84.Explain what is Data Step?
The main function of Data step is to create SAS data sets by manipulating data.
Q85.Explain what does PROC print, and PROC contents are used for?
- 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.
Q86.Explain what Procglm does?
The functions of Procglm are covariance analysis, variance analysis, multivariate and repeated analysis of variance.
Q87.How to sort in descending order?
By using DESCENDING keyword in PROC SORT code, we can sort in descending order.
Q88.What do the put and input function do?
- Input Function: Character values are converted into numeric values.
- Put function: Numeric values are converted into character values.
Q89.What’s the difference between VAR B1 – B3 and VAR B1 — B3?
- Single Dash specifies consecutively numbered variables.
- Double Dash specifies variables available within that data set. For example:
Data Set: ID NAME B1 B2 C1 B3Then, B1 – B3 would return B1 B2 B3
And B1 – B3 would return B1 B2 C1 B3.
Q90.What are the special input delimiters?
The input delimiters are DLM and DSD.
Q91.What is the difference between a format and an informat?
- 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).
Q92.Describe any one SAS function?
RIM: removes trailing blanks from a character expression
- Str1 = ‘my’;
- Str2 = ‘dog’;
- Result = TRIM (Str1) (Str2);
- Result = ‘mydog’