What has been your most common programming mistake?
What is your favorite programming language and why?
What is your favorite operating system? Why?
Do you observe any coding standards? What is your opinion of them?
What percent of your program code is usually original and what percent copied and modified?
Have you ever had to follow SOPs or programming guidelines?
Which is worse: not testing your programs or not commenting your programs?
Name several ways to achieve efficiency in your program. Explain trade-offs.
What other SAS products have you used and consider yourself proficient in using?
How do you make use of functions?
When looking for contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc?
What is the significance of the ‘OF’ in X=SUM(OF a1-a4, a6, a9);?
What do the PUT and INPUT functions do?
Which date function advances a date, time or date/time value by a given interval?
What do the MOD and INT function do?
How might you use MOD and INT on numerics to mimic SUBSTR on character strings?
In ARRAY processing, what does the DIM function do?
How would you determine the number of missing or nonmissing values in computations?
What is the difference between: x=a+b+c+d; and x=SUM(a,b,c,d);?
There is a field containing a date. It needs to be displayed in the format “ddmonyy” if it’s before 1975, “dd mon ccyy” if it’s after 1985, and as ‘Disco Years’ if it’s between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT.
In the following DATA step, what is needed for ‘fraction’ to print to the log? data _null_; x=1/3; if x=.3333 then put ‘fraction’; run;
What is the difference between calculating the ‘mean’ using the mean function and PROC MEANS?
Have you ever used “Proc Merge”? (be prepared for surprising answers..)
If you were given several SAS data sets you were unfamiliar with, how would you find out the variable names and formats of each dataset?
What SAS PROCs have you used and consider yourself proficient in using?
How would you keep SAS from overlaying the a SAS set with its sorted version?
In PROC PRINT, can you print only variables that begin with the letter “A”?
What are some differences between PROC SUMMARY and PROC MEANS?
Code the tables statement for a single-level (most common) frequency.
Code the tables statement to produce a multi-level frequency.
Name the option to produce a frequency line items rather that a table.
Produce output from a frequency. Restrict the printing of the table.
Code a PROC MEANS that shows both summed and averaged output of the data.
Code the option that will allow MEANS to include missing numeric data to be included in the report.
Code the MEANS to produce output to be used later.
Do you use PROC REPORT or PROC TABULATE? Which do you prefer? Explain.
What happens in a one-on-one merge? When would you use one?
How would you combine 3 or more tables with different structures?
What is a problem with merging two data sets that have variables with the same name but different data?
When would you choose to MERGE two data sets together and when would you SET two data sets?
Which data set is the controlling data set in the MERGE statement?
How do the IN= variables improve the capability of a MERGE?
Explain the message ‘MERGE HAS ONE OR MORE DATASETS WITH REPEATS OF BY VARIABLES”.
How would you generate 1000 observations from a normal distribution with a mean of 50 and standard deviation of 20. How would you use PROC CHART to look at the distribution? Describe the shape of the distribution.
How do you generate random samples?
What is the purpose of the statement DATA _NULL_ ;?
What is the pound sign used for in the DATA _NULL_?
What would you use the trailing @ sign for?
For what purpose(s) would you use the RETURN statement?
How would you determine how far down on a page you have printed in order to print out footnotes?
What is the purpose of using the N=PS option?
What system options would you use to help debug a macro?
Describe how you would create a macro variable.
How do you identify a macro variable?
How do you define the end of a macro?
How do you assign a macro variable to a SAS variable?
For what purposes have you used SAS macros?
What is the difference between %LOCAL and %GLOBAL?
How long can a macro variable be? A token?
If you use a SYMPUT in a DATA step, when and where can you use the macro variable?
What do you code to create a macro? End one?
Describe how you would pass data to a macro.
You have five data sets that need to be processed identically; how would you simplify that processing with a macro?
How would you code a macro statement to produce information on the SAS log? This statement can be coded anywhere.
How do you add a number to a macro variable?
If you need the value of a variable rather than the variable itself, what would you use to load the value to a macro variable?
Can you execute a macro within a macro? Describe.
Can you a macro within another macro? If so, how would SAS know where the current macro ended and the new one began?
Currently published questions are very good, additionally i m expecting interview questions Proc report, proc summary, Proc plot, Proc chart and more complex questions. pls send me through my mail id
thanx
What is the significance of the ‘OF’ in X=SUM(OF a1-a4, a6, a9);?
ANS: it allowes to list the variable like a1-a4 rather than a1, a2 ,a3 a4.
What do the PUT and INPUT functions do?
ANS: Input: indicates the input variables in the data set
what is the differance b/w proc means and proc summary?
Answer:
Difference:
By default, PROC SUMMARY does not display output. The SUMMARY procedure is very similar to the MEANS procedure.
Similar:
Proc MEANS & proc SUMMARY provides data summarization tools that compute descriptive statistics for variables across all observations or within groups of observations.
How would you determine the number of missing or nonmissing values in computations?
Answer:
In proc freq, u can see the number of missing values in the output.
But if u also want to see the percentage of missing values in each variable, use the following code
In the following DATA step, what is needed for ‘fraction’ to print to the log? data _null_; x=1/3; if x=.3333 then put ‘fraction’; run;
Answer:
Use the following code
data _null_;
x=1/3;
if x=.3333 then %put ‘fraction’;
Q.Can you use a macro within another macro? If so, how would SAS know where the current macro ended and the new one began?
Ans: Ofcourse you can use a macro within a macro.
SAS will recognise this when, u give the %mend statement to both the macros.For example, if u give a %mend statement to the macro inside a macro and then the same statement to the whole macro. it will first execute the inside macro.
I hope this will answer your question.
What happens in a one-on-one merge? When would you use one?
If you want to merge two data set that have different
variable and only one variable as a common variable
with that unique variable we can merge the data set
with one-on-one merge.
Q:In PROC PRINT, can you print only variables that begin with the letter “A�
A:Yes we can print variable which begin with the letter “A†by using the WHERE statement in the PROC PRINT statement
WHERE (VARIABLE NAME) LIKE ‘A%’;
29 Comments on Interview questions for SAS expert
Use of Comment function and its codes in SAS
SAS Codes for ODS HTML
Currently published questions are very good, additionally i m expecting interview questions Proc report, proc summary, Proc plot, Proc chart and more complex questions. pls send me through my mail id
thanx
What is the significance of the ‘OF’ in X=SUM(OF a1-a4, a6, a9);?
ANS: it allowes to list the variable like a1-a4 rather than a1, a2 ,a3 a4.
What do the PUT and INPUT functions do?
ANS: Input: indicates the input variables in the data set
Put: gives the result in LOG window
what is the differance b/w proc means and proc summary?
what is the differance b/w proc means and proc summary?
Answer:
Difference:
By default, PROC SUMMARY does not display output. The SUMMARY procedure is very similar to the MEANS procedure.
Similar:
Proc MEANS & proc SUMMARY provides data summarization tools that compute descriptive statistics for variables across all observations or within groups of observations.
What does MOD and INT function do?
Answer:
MOD function returns the remainder and INT function returns the integer value.
Example:
A=mod(9,2); A=9/2=1(remainder)
B=int(2.3); B=2.
How would you determine the number of missing or nonmissing values in computations?
Answer:
In proc freq, u can see the number of missing values in the output.
But if u also want to see the percentage of missing values in each variable, use the following code
PROC FREQ DATA=;
TABLES var1 var2…varn / MISSING ;
RUN ;
In the following DATA step, what is needed for ‘fraction’ to print to the log? data _null_; x=1/3; if x=.3333 then put ‘fraction’; run;
Answer:
Use the following code
data _null_;
x=1/3;
if x=.3333 then %put ‘fraction’;
How would you determine the number of missing or nonmissing values in computations?
Answer:
Use the NMISS and N functions.
NMISS function will give u the # of missing values and N function will give the # of non-missing values.
What is the difference between calculating the ‘mean’ using the mean function and PROC MEANS?
Answer:
MEAN function will give the mean of each row(record),
while PROC MEANS gives the mean of each variable.
Dear Friends,
What are some good SAS programming practices for processing very large data sets?
&
What is the effect of the OPTIONS statement ERRORS=1?
Q) What is the effect of the OPTIONS statement ERRORS=1?
Ans) It limits the maximum number of errrors to 1, by default its value is 20.
If you use a SYMPUT in a DATA step, when and where can you use the macro variable?
What do the PUT and INPUT functions do?
put funtion: it will convert numaric variable to character variable.
input function: it will convert character variable to numaric variable.
What do you code to create a macro? End one?
%macro, %mend
What is the purpose of the statement DATA _NULL_ ;?
when ever we don’t want data set that time we can use _null_
In ARRAY processing, what does the DIM function do?
dim function count the no of variables
Q.How are parameters passed to a macro?
Ans: Use ‘&’.
Q.Can you use a macro within another macro? If so, how would SAS know where the current macro ended and the new one began?
Ans: Ofcourse you can use a macro within a macro.
SAS will recognise this when, u give the %mend statement to both the macros.For example, if u give a %mend statement to the macro inside a macro and then the same statement to the whole macro. it will first execute the inside macro.
I hope this will answer your question.
Q.Can you execute a macro within a macro? Describe.
Ans.Refer the comment on question number 68.
How do you add a number to a macro variable?
we can add a number to a macro variable useing %eval
What happens in a one-on-one merge? When would you use one?
If you want to merge two data set that have different
variable and only one variable as a common variable
with that unique variable we can merge the data set
with one-on-one merge.
What system options would you use to help debug a macro?
Symbolgen Mlogic Mprint
Q:In PROC PRINT, can you print only variables that begin with the letter “A�
A:Yes we can print variable which begin with the letter “A†by using the WHERE statement in the PROC PRINT statement
WHERE (VARIABLE NAME) LIKE ‘A%’;
Or
WHERE (VARIABLE NAME =: ‘A’;
COMPRESS() removes blanks or specified characters from a character variable
If you use a SYMPUT callroutine in a DATA step, when and where can you use the macro variable
How would you determine how far down on a page you have printed in order to print out footnotes?
How might you use MOD and INT on numerics to mimic SUBSTR on character strings?
What do the PUT and INPUT functions do?
put function converts numeric to character
input function convert character to numeric