How are numeric and character missing values represented internally?
ans:basically charactor values are reprasented by blank
space numaric values are reprasented by dot in sas data set.
3) What do the SAS log messages “numeric values have been converted to character” mean? What are the implications?
Ans) The message means that numeric values are converted into character values automatically whenever numeric data values are used in character context. If put function is used to explicitly convert numeric values to character values then no message is written to the log.
5) How do you control the number of observations and/or variables read or written?
Ans) For controlling observations use OBS= option in the infile statement and for controlling variables use the VAR statement in the data step.
7) How would you remove a format that has been permanently associated with a variable?
Ans) Open the dataset in viewtable window and right click on the columns whose format should be changed/removed and select column attributes from the pop up menu and then do the necessary changes.
Q: What’s the difference between VAR A1 - A4 and VAR A1  A4?
A: VAR A1- A4 is a numbered range. Used as a shortcut to describe variables that have same char names and the numbers are in order. Var A1– A4 is the order of the variables as they occur in the data set, and is again a shortcut to refer them. You can see the order of the variables by using Proc Contents on the data file
Q: What do the SAS log messages “numeric values have been converted to character” mean? What are the implications?
A: Means SAS performed an automatic num to char conversion. Works for some cases, else do an explicit num to char conversion using PUT(VAR, format).
Q: What does the RUN statement do
A: RUN stat menas the end of any Data or Proc steps before it and execute the stats. There can be as many RUN stats as you want to run blocks of steps separately.
Q:What are some good SAS programming practices for processing very large data sets
A: Limit the no. of OBS using Firstobs= and obs=. Use a do loop and point= option to generate samples from the data sets. make sure you terminate the point= loop.
Q: What are _numeric_ and _character_ and what do they do
A: the foist one means you want to work on all the numberis variables in your data set. example Mean( of _numeric_). Same with the char. Format _character_ $12.
Q: How would you create multiple observations from a single observation?
A: USing @ or @@. You can break up the single obs as per your need
Q:What is the order of evaluation of the comparison operators: + - * / ** ( )
A: BODMAS ( Bracket, Div, Multi, add, subtraction)
Q: How can you put a “trace” in your program
A: ODS Trace ON, ODS Trace OFF
Q: Have you ever used the SAS Debugger
A: YES. Start by submitting Data dat/ debug;…..
Debugger window opens. Execute each program line by hitting enter. After the last line type Examine _ALL_ in the command window to execute and check the variable values for one iteration of data step..
How are numeric and character missing values represented internally?
a.character values represented blank numeric values are represented by dot.
What is the order of evaluation of the comparison operators: + - * / ** ( )
A: BODMAS brackets,explonentation,multiplication addition substraction.
What is the meaning of proc append procedure?How to use this procedure?
a.proc append procedure is used for adding one base dataset to existing dataset if incase there is mismatched variables then use force options.
How would you remove a format that has been permanently associated with a variable?
a.data ab;
format ”;
run;
25 Comments on Basic SAS interview questions
What is the effect of the OPTIONS statement ERRORS=1?
If ERRORS=1 then only 1 data error statement is printes on Log
What does the RUN statement do?
it will excutes the programme.
How would you remove a format that has been permanently associated with a variable??
What do the SAS log messages “numeric values have been converted to character” mean? What are the implications?
These SAS log messages shows that the all of the numeric values have been converted to character values.
When using the put function in your program, the numeric values are converted into character values.
How are numeric and character missing values represented internally?
ans:basically charactor values are reprasented by blank
space numaric values are reprasented by dot in sas data set.
What does the RUN statement do?
ans: it is end of the program it executes the program.
What areas of SAS are you most interested in?
ans:formats,macros,proc sql,ods,graphsand proc access.
How would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable?
ANS:BY USING PROC TRANSPOSE.
Que: For what purpose you use a retain statement?
Ans: To retain the value of a variable in subsequent iterations of the data step.
3) What do the SAS log messages “numeric values have been converted to character” mean? What are the implications?
Ans) The message means that numeric values are converted into character values automatically whenever numeric data values are used in character context. If put function is used to explicitly convert numeric values to character values then no message is written to the log.
5) How do you control the number of observations and/or variables read or written?
Ans) For controlling observations use OBS= option in the infile statement and for controlling variables use the VAR statement in the data step.
Correction for Que5) Use the drop and keep options in the data statements.
6) Approximately what date is represented by the SAS date value of 730?
Ans) SAS date value starts from Jan 1st 1960. 730=365+365=2 yrs = Jan 1st 1962
7) How would you remove a format that has been permanently associated with a variable?
Ans) Open the dataset in viewtable window and right click on the columns whose format should be changed/removed and select column attributes from the pop up menu and then do the necessary changes.
Why is a STOP statement needed for the POINT= option on a SET statement?
The STOP statement is used to control the continuous looping in set stement
Q: What’s the difference between VAR A1 - A4 and VAR A1  A4?
A: VAR A1- A4 is a numbered range. Used as a shortcut to describe variables that have same char names and the numbers are in order. Var A1– A4 is the order of the variables as they occur in the data set, and is again a shortcut to refer them. You can see the order of the variables by using Proc Contents on the data file
Q: What do the SAS log messages “numeric values have been converted to character” mean? What are the implications?
A: Means SAS performed an automatic num to char conversion. Works for some cases, else do an explicit num to char conversion using PUT(VAR, format).
Q: What does the RUN statement do
A: RUN stat menas the end of any Data or Proc steps before it and execute the stats. There can be as many RUN stats as you want to run blocks of steps separately.
Q:What are some good SAS programming practices for processing very large data sets
A: Limit the no. of OBS using Firstobs= and obs=. Use a do loop and point= option to generate samples from the data sets. make sure you terminate the point= loop.
Q: What are _numeric_ and _character_ and what do they do
A: the foist one means you want to work on all the numberis variables in your data set. example Mean( of _numeric_). Same with the char. Format _character_ $12.
Q: How would you create multiple observations from a single observation?
A: USing @ or @@. You can break up the single obs as per your need
Q:What is the order of evaluation of the comparison operators: + - * / ** ( )
A: BODMAS ( Bracket, Div, Multi, add, subtraction)
Q: How can you put a “trace” in your program
A: ODS Trace ON, ODS Trace OFF
Q: Have you ever used the SAS Debugger
A: YES. Start by submitting Data dat/ debug;…..
Debugger window opens. Execute each program line by hitting enter. After the last line type Examine _ALL_ in the command window to execute and check the variable values for one iteration of data step..
What is the meaning of proc append procedure?How to use this procedure?
What is the SAS server name and configuration?
What is the effect of the OPTIONS statement ERRORS=1?
What is the purpose of _error_?
6) Approximately what date is represented by the SAS date value of 730?
Ans) SAS date value starts from Jan 1st 1960. 730=365+365=2 yrs =dec 31st 1961
How are numeric and character missing values represented internally?
a.character values represented blank numeric values are represented by dot.
What is the order of evaluation of the comparison operators: + - * / ** ( )
A: BODMAS brackets,explonentation,multiplication addition substraction.
What is the meaning of proc append procedure?How to use this procedure?
a.proc append procedure is used for adding one base dataset to existing dataset if incase there is mismatched variables then use force options.
How would you remove a format that has been permanently associated with a variable?
a.data ab;
format ”;
run;