EZ Study

Actuarial Biology Chemistry Economics Calculators Confucius Engineer
Physics
C.S.



SAS Interview Questions and Answers --3

Foreword: "All models are wrong, but some are useful...."

Procedure vs. macro
The question, "What is the difference between a procedure and a macro?" can catch you off guard if it has never occurred to you to think of them as having anything in common. It can mystify you in a completely different way if you have thought of procedures and macros as interchangeable parts. You might mention:

The difference between generating SAS code, as a macro usually does, and taking action directly on SAS data, as a procedure usually does
What it means, in terms of efficiency, for a procedure to be a compiled program
The drastic differences in syntax between a proc step and a macro call
The IMPORT and EXPORT procedures, which with some options generate SAS statements much like a macro
The %SYSFUNC macro function and %SYSCALL macro statement that allow a macro to take action directly on SAS data, much like a procedure Scope of macro variables

If the interviewer asks a question about the scope of macro variables or the significance of the difference between local and global macro variables, the programming concept of scope is being used to see how you handle the new ways of thinking that programming requires.

The possibility that the same name could be used for different things at different times is one of the more basic philosophical conundrums in computer programming. If you can appreciate the difference between a name and the object that the name refers to, then you can probably handle all the other philosophical challenges of programming.

Run groups
Run-group procedures are not a big part of base SAS, so a question about run -group processing and the difference between the RUN and QUIT statements probably has more to do with:

What a procedure is
What a step is
All the work SAS has to go through as it alternately acquires a part of the SAS program from the execution queue, then executes that part of the program
Connecting the program and the log messages SAS date values

Questions about SAS date values have less to do with whether you have memorized the reference point of January 1, 1960, than with whether you understand the implications of time data treated as numeric values, such as:

Using a date format to display the date variable in a meaningful way
Computing a length of time by subtracting SAS date values Efficiency techniques
With today's bigger, faster computers, efficiency is a major concern only for the very largest SAS projects. If you get a series of technical
questions about efficiency, it could mean one of the following:

The employer is undertaking a project with an especially large volume of data
The designated computer is not one of today's bigger, faster computers
The project is weighed down with horrendously inefficient code, and they are hoping you will be able to clean it all up

On the other hand, the interviewer may just be trying to gauge how well you understand the way SAS statements correspond to the actions the computer takes or how seriously you take the testing process for a program you write. Debugger

Most SAS programmers never use the data step debugger, so questions about it are probably intended to determine how you feel about debugging — does the debugging process bug you, or is debugging one of the most essential things you do as a programmer?

_N_ application
Questions about the automatic variable _N_ (this might be pronounced “ underscore N underscore” or just “N”) are meant to get at your understanding of the automatic actions of the data step, especially the automatic data step loop, also known as the observation loop.

A possible follow-up question asks how you can store the value of _N_ in the output SAS dataset. If you can answer this, it may show that you know the properties of automatic variables and know how to create a variable in the data step.

Related links:

Continue SAS Interview Questions --4: Informats vs. formats, Put statement
Back SAS Interview Questions --2: Where vs. IF, Compression, Replace, Macro
Back   SAS Tutorial     SAS Interview