Deepanshu Bhalla 47 Comments ,
SAS Base Certification is one of the most popular certification in analytics industry. It's popularity has gained significantly in last few years as SAS is one of the most sought-after IT skill. To prepare for SAS BASE Certification, you need to study the following topics -

  1. Import raw data files. Study INPUT, INFILE and FILE statements.
  2. Import raw data files with PROC IMPORT.
  3. How to export data.
  4. Combine and Merge SAS Datasets. Study SET, MERGE and UPDATE statements.
  5. Difference between IF and WHERE statements.
  6. How to keep, drop and rename variables
  7. How to produce summary reports using Proc REPORT, Proc PRINT and Proc FREQ
  8. Generate HTML using ODS statements
  9. Do Loop and Arrays
  10. Proc Content and Proc Dataset
  11. Character and Date Functions
  12. Identify and correct SAS syntax Errors

The exam consists of 65 multiple choice and short answer questions. To pass the exam, you need to score at least 70 percent. You will get 110 minutes to complete exam.

The following is a list of questions that can help you to crack Base SAS certification exam.

SAS Base Certification Questions and Answers

Previous Three Parts

Q31. The following SAS program is submitted:

libname rawdata1 'location of SAS data library';
filename rawdata2 'location of raw data file';
data work.testdata;
input sales1 sales2;

Which one of the following is needed to complete the program correctly?
A. rawdata1
B. rawdata2
C. 'rawdata1'
D. 'rawdata2'

Answer:  B. Since we have already initialized the path with a filename, we do not have to include quotation again.

Q32. The following SAS program is submitted and reads 100 records from a raw data file:
infile 'file-specification' end = eof;
input name $ salary;
totsal + salary;

Which one of the following IF statements writes the last observation to the output data set?
A. if end = 0;
B. if eof = 0;
C. if end = 1;
D. if eof = 1;

Answer : D. End is a sas keyword which will become true when SAS reads last record of a dataset. This value you cannot use directly in your program, so we create a alias name eof (end of file), but you can name it anything. EOF will carry the same value as internal variable END. So as we know 1=true and 0= false. if EOF = 1; will output only the last observation.

Q33. In the following SAS program, the input data files are sorted by the NAMES variable:

libname temp 'SAS-data-library';
data temp.sales;
merge temp.sales work.receipt;
by names;

Which one of the following results occurs when this program is submitted?
A. The program executes successfully and a temporary SAS data set is created.
B. The program executes successfully and a permanent SAS data set is created.
C. The program fails execution because the same SAS data set is referenced for both read and write operations.
D. The program fails execution because the SAS data sets on the MERGE statement are in two different libraries.

Answer : B. temp is declared as a permanent library so permanent dataset will be created.

Q34. The contents of two SAS data sets named EMPLOYEE and SALARY are listed below:

data emplsal;
merge employee (in=ine) salary(in=ins);
by name;
if ine and ins;

How many observation are in EMPLSAL dataset?
A. 4
B. 3
c. 2
D. 1

Answer : A.

Run the following SAS code and see what you got in the EMPSAL dataset:

data salary;
input name $ salary;
Bruce 40000
Bruce 35000
Dan 37000
Dan .

data employee;
input name $ age;
Bruce 30
Dan 35

data emplsal;
merge employee (in=ine) salary(in=ins);
by name;
if ine and ins;

Q35. The following SAS program is submitted:
data work.products;
Product_Number = 5461;
Item = '1001';
Item_Reference = Item'/'Product_Number;
Which one of the following is the value of the variable ITEM_REFERENCE in the output data set?
A. 1001/5461
B. 1001/ 5461
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.

Answer : D. Since there is no concatenate symbol between Item and Product_Number.

Q36. The following SAS program is submitted:

libname sasdata 'SAS-data-library';
data test;
set sasdata.chemists (keep = job_code);
if job_code = 'chem3'
then description = 'Senior Chemist';

The variable JOB_CODE is a character variable with a length of 6 bytes.

Which one of the following is the length of the variable DESCRIPTION in the output data set?
A. 6 bytes
B. 8 bytes
C. 14 bytes
D. 200 bytes

Answer : C. The length of 'Senior Chemist' is 14.

Q37. Which one of the following is true of the RETAIN statement in a SAS DATA step program?

A. It can be used to assign an initial value to _N_ .
B. It is only valid in conjunction with a SUM function.
C. It has no effect on variables read with the SET, MERGE and UPDATE statements.
D. It adds the value of an expression to an accumulator variable and ignores missing values.

Answer : C.

The RETAIN statement
- is a compile-time only statement that creates variables if they do not already exist
- initializes the retained variable to missing before the first execution of the DATA step if you do not supply an initial value
- has no effect on variables that are read with SET, MERGE, or UPDATE statements.

Q38. The following SAS program is submitted:

data work.test;
Title = 'A Tale of Two Cities, Charles J. Dickens';
Word = scan(title,3,',');

Which one of the following is the value of the variable WORD in the output data set?
A. T
B. of
C. Dickens
D. ' ' (missing character value)

Answer : D.

Q39. Which one of the following is true when SAS encounters a data error in a DATA step?

A. The DATA step stops executing at the point of the error, and no SAS data set is created.
B. A note is written to the SAS log explaining the error, and the DATA step continues to execute.
C. A note appears in the SAS log that the incorrect data record was saved to a separate SAS file for further examination.
D. The DATA step stops executing at the point of the error, and the resulting DATA set contains observations up to that point.

Answer : B. If it's a syntax error then the A occurs.
If it's an error with invalid data then B will occur .
If it's a problem with merging two or more datasets, then D will occur.

Q40. The SAS data set EMPLOYEE_INFO is listed below:

IDNumber Expenses
2542 100.00
3612 133.15
2198 234.34
2198 111.12

The following SAS program is submitted:
proc sort data = employee_info;


Which one of the following BY statements completes the program and sorts the data sequentially by ascending expense values within each ascending IDNUMBER value?

A. by Expenses IDNumber;
B. by IDNumber Expenses;
C. by ascending (IDNumber Expenses);
D. by ascending IDNumber ascending Expenses;

Answer : B. By default SAS will sort data in ascending order. IDNumber should be specified before Expenses as we want IDNUMBER to be sorted in ascending.

Learn SAS : Free 100+ SAS Tutorials
Related Posts
Spread the Word!
About Author:
Deepanshu Bhalla

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and HR.

  1. Good Job. Thanks..!

  2. Kindly provide sample of short questions too in base sas certification

  3. Thanks for the Q&A's! On my screen, I can't see possible answers to Q24, there is just the Q and the explanation, but there are no possible choices (A:D)
    THX for your work!

  4. Good work, keep it up!!

  5. Those were really helpful,thanx

  6. its not suffecient

  7. good it is more helpfull to me

  8. Thanks for the detailed compilation!

  9. Could you please recheck the answer to question 38 as I think the answer would be 'Of'. Thanks

    1. Delimiter mentioned "," is wrong. It should be " " to get "Of".

    2. Neither question nor answer is wrong. The question was framed in such a way.

    3. i think so correct ans is B

  10. Great Job on preparing some tricky questions for the SAS Exam...please keep up the good work! Thank you!!!!!

  11. I am preparing for SAS base certification 211, can you please suggest me good preparation guide.

    1. SAS Certification prep Guide for base programming 9 by SAS Institute

  12. Really helpful explanations..! thanks a lot

  13. thanks a lot for your helpful effort.

  14. Great Job Mr. Bhalla.. Keep up the good work

  15. The night before the exam, helped lots!


  16. Great Work dude,by solving this questions,I got confident on certification exam...

  17. after comma that is one word so there we have 2 words on given example but we write scan of 3 here we don't have 3 word

  18. thank you for helped a lot.

  19. its nice, thanks for sharing this

  20. Thanks for posting these tricky questions- it helps utilize critical thinking to understand the logic behind the statements!

  21. it is first website which has clear explanation

  22. Thanks for providing these good, accurate questions with thoughtful explanations for free. Please continue the good work!

  23. Hello.
    Thank you very much.

  24. Thank you for this questions and excellent explainations.

  25. Thanks for the explanations. They are very helpful.

  26. Thanks for the efforts. I believe the answer for Q.38 is 'B'.
    Overall a good job!

    1. It would have been B if space was there between the quotes " ". Since the separator used is "," the D option is correct.

  27. very helpful thnx....

  28. Thank you for posting these. Very helpful.

  29. Thank you. Very conceptual questions, helped me a lot

  30. thankyou very good excercise to brushup the topics

  31. My question
    Data a;
    Office ='stansys';

    Output : StAnSyS

  32. thanks a lot!!! Its was very helpful

Next → ← Prev