Basic SAS interview questions

  1. What is the effect of the OPTIONS statement ERRORS=1?
  2. What’s the difference between VAR A1 - A4 and VAR A1 — A4?
  3. What do the SAS log messages "numeric values have been converted to character" mean? What are the implications?
  4. Why is a STOP statement needed for the POINT= option on a SET statement?
  5. How do you control the number of observations and/or variables read or written?
  6. Approximately what date is represented by the SAS date value of 730?
  7. How would you remove a format that has been permanently associated with a variable??
  8. What does the RUN statement do?
  9. Why is SAS considered self-documenting?
  10. What areas of SAS are you most interested in?
  11. Briefly describe 5 ways to do a "table lookup" in SAS.
  12. What versions of SAS have you used (on which platforms)?
  13. What are some good SAS programming practices for processing very large data sets?
  14. What are some problems you might encounter in processing missing values? In Data steps? Arithmetic? Comparisons? Functions? Classifying data?
  15. How would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable?
  16. What is the different between functions and PROCs that calculate the same simple descriptive statistics?
  17. If you were told to create many records from one record, show how you would do this using arrays and with PROC TRANSPOSE?
  18. What are _numeric_ and _character_ and what do they do?
  19. How would you create multiple observations from a single observation?
  20. For what purpose would you use the RETAIN statement?
  21. What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?
  22. What is the order of application for output data set options, input data set options and SAS statements?
  23. What is the order of evaluation of the comparison operators: + - * / ** ( ) ?
  24. How could you generate test data with no input data?
  25. How do you debug and test your SAS programs?
  26. What can you learn from the SAS log when debugging?
  27. What is the purpose of _error_?
  28. How can you put a "trace" in your program?
  29. Are you sensitive to code walk-throughs, peer review, or QC review?
  30. Have you ever used the SAS Debugger?
  31. What other SAS features do you use for error trapping and data validation?
  32. How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?
  33. How many missing values are available? When might you use them?
  34. How do you test for missing values?
  35. How are numeric and character missing values represented internally?
This entry was posted in General. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

25 Comments on Basic SAS interview questions

  1. madhu
    Posted 4/18/2007 at 3:24 pm | Permalink

    What is the effect of the OPTIONS statement ERRORS=1?

  2. Kiran
    Posted 5/2/2007 at 5:45 am | Permalink

    If ERRORS=1 then only 1 data error statement is printes on Log

  3. I. HARI PRASAD REDDY
    Posted 6/18/2007 at 11:00 am | Permalink

    What does the RUN statement do?

    it will excutes the programme.

  4. anup
    Posted 6/22/2007 at 9:49 pm | Permalink

    How would you remove a format that has been permanently associated with a variable??

  5. Saxena, Sameer
    Posted 7/9/2007 at 12:43 pm | Permalink

    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.

  6. srikanth
    Posted 7/21/2007 at 12:47 pm | Permalink

    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.

  7. srikanth
    Posted 7/21/2007 at 12:49 pm | Permalink

    What does the RUN statement do?
    ans: it is end of the program it executes the program.

  8. srikanth
    Posted 7/21/2007 at 12:54 pm | Permalink

    What areas of SAS are you most interested in?
    ans:formats,macros,proc sql,ods,graphsand proc access.

  9. srikanth
    Posted 7/21/2007 at 1:00 pm | Permalink

    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.

  10. Swetha
    Posted 9/12/2007 at 12:10 am | Permalink

    Que: For what purpose you use a retain statement?
    Ans: To retain the value of a variable in subsequent iterations of the data step.

  11. Swetha
    Posted 9/12/2007 at 3:58 pm | Permalink

    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.

  12. Swetha
    Posted 9/12/2007 at 4:00 pm | Permalink

    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.

  13. Swetha
    Posted 9/12/2007 at 4:02 pm | Permalink

    Correction for Que5) Use the drop and keep options in the data statements.

  14. Swetha
    Posted 9/12/2007 at 4:03 pm | Permalink

    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

  15. Swetha
    Posted 9/12/2007 at 4:04 pm | Permalink

    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.

  16. gomathi
    Posted 10/25/2007 at 3:59 pm | Permalink

    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

  17. Sourav
    Posted 10/26/2007 at 1:11 pm | Permalink

    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

  18. Sourav
    Posted 10/26/2007 at 1:17 pm | Permalink

    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.

  19. Sourav
    Posted 10/26/2007 at 1:24 pm | Permalink

    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

  20. Sourav
    Posted 10/26/2007 at 1:28 pm | Permalink

    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..

  21. nagu
    Posted 11/6/2007 at 4:22 am | Permalink

    What is the meaning of proc append procedure?How to use this procedure?

  22. nagu
    Posted 11/6/2007 at 4:23 am | Permalink

    What is the SAS server name and configuration?

  23. nagu
    Posted 11/6/2007 at 4:25 am | Permalink

    What is the effect of the OPTIONS statement ERRORS=1?
    What is the purpose of _error_?

  24. sudha
    Posted 12/21/2007 at 1:08 am | Permalink

    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

  25. ganesh
    Posted 12/29/2007 at 7:26 am | Permalink

    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;

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*