EZ Study

Actuarial Biology Chemistry Economics Calculators Confucius Engineer

SAS Interview Questions and Answers -2

Foreword: "The sexiest job in the next 10 years is statistician... "

Key concepts
A SAS technical interview typically starts with a few of the key concepts that are essential in SAS programming. These questions are intended to separate those who have actual substantive experience with SAS from those who have used in only a very limited or superficial way. If you have spent more than a hundred hours reading and writing SAS programs, it is safe to assume that you are familiar with topics such as these:

SORT procedure (see more detailed explanation here)
Data step logic
KEEP=, DROP= dataset options
Missing values
Reset to missing, or the RETAIN statement
Data types
FORMAT procedure for creating value formats
IN= dataset option

Question: name some of the ways to create a macro variable?
Answer: Almost the only reason interviewers ask about macros is to determine whether you appreciate the distinction between preprocessing and processing. Most SAS programmers are somewhat fuzzy about this, so if you have it perfectly clear in your mind, that makes you a cut about the rest — and if not, at least you should know that this is a topic you have to be careful about.

Here are a few ways to generate a macro variable:
when creating a macro example: %macro mymacro(a=,b=);
using INTO in SQL

There are endless technical issues with SAS macros, such as the system options that determine how much shows up in the log; your experience with this is especially important if the job involves maintaining SAS code written with macros.

SAS macro language is somewhat controversial, so be careful what you say of your opinion of it. To some managers, macro use is what distinguishes real SAS programmers from the pretenders, but to others, relying on macros all the time is a sure sign of a lazy, fuzzy-headed programmer. If you are pressed on this, it is probably safe to say that you are happy to work with macros or without them, depending on what the situation calls for.

Tricky Stuff
After the interviewer is satisfied that you have used SAS to do a variety of things, you are likely to get some more substantial questions about SAS processing.

These questions typically focus on some of the trickier aspects of the way SAS works, not because the interviewer is trying to trick you, but to give you a chance to demonstrate your knowledge of the details of SAS processing.

At the same time, you can show how you approach technical questions and issues, and that is ultimately more important than your knowledge of any specific feature in SAS.

STOP statement
The processing of the STOP statement itself is ludicrously simple. However, when you explain the how and why of a STOP statement, you show that you understand:

How a SAS program is divided into steps, and the difference between a data step and a proc step
The automatic loop in the data step
Conditions that cause the automatic loop to terminate, or to fail to terminate

Compressing a SAS dataset is easy to to, so questions about it have more to do with determining when it is a good idea. You can weigh efficient use of storage space against efficient use of processing power, for example. Explain how you use representative data and performance measurements from SAS to test efficiency techniques, and you establish yourself as a SAS programmer who is ready to deal with large volumes of data.

If you can explain why compression is effective in SAS datasets and observations larger than a certain minimum size and why binary compression works better than character compression for some kinds of data, then it shows you take software engineering seriously.

Related links:

Continue to SAS Interview Questions 3: Procedure vs. macro   SAS Interview
Back to SAS Interview Questions 1: Key concepts, Tricky Stuff   SAS Tutorial