SAS BASE CERTIFICATION QUESTIONS AND ANSWERS - PART 4 OF 4

Deepanshu Bhalla 49 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;
infile
input sales1 sales2;
run;

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:
data work.total;
infile 'file-specification' end = eof;
input name $ salary;
totsal + salary;

run;
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;
run;

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;
run;

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;
datalines;
Bruce 40000
Bruce 35000
Dan 37000
Dan .
;
run;

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

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



Q35. The following SAS program is submitted:
data work.products;
Product_Number = 5461;
Item = '1001';
Item_Reference = Item'/'Product_Number;
run;
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';
run;

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,',');
run;

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;

run;

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

49 Responses to "SAS BASE CERTIFICATION QUESTIONS AND ANSWERS - PART 4 OF 4"
  1. Good Job. Thanks..!

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

    ReplyDelete
  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!

    ReplyDelete
  4. Good work, keep it up!!

    ReplyDelete
  5. Those were really helpful,thanx

    ReplyDelete
  6. its not suffecient

    ReplyDelete
  7. good it is more helpfull to me

    ReplyDelete
  8. Thanks for the detailed compilation!

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

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

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

      Delete
    3. i think so correct ans is B

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

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



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

      Delete
  12. Really helpful explanations..! thanks a lot

    ReplyDelete
  13. thanks a lot for your helpful effort.

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

    ReplyDelete
  15. The night before the exam, helped lots!

    Thanks!

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

    ReplyDelete
  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

    ReplyDelete
  18. thank you for questions...it helped a lot.

    ReplyDelete
  19. its nice, thanks for sharing this

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

    ReplyDelete
  21. it is first website which has clear explanation

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

    ReplyDelete
  23. Hello.
    Thank you very much.

    ReplyDelete
  24. Thank you for this questions and excellent explainations.

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

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

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

      Delete
  27. very helpful thnx....

    ReplyDelete
  28. This comment has been removed by the author.

    ReplyDelete
  29. mari daftarkan segera di s128agenorg untuk mendapatkan duit berjuta-juta

    ReplyDelete
  30. Thank you for posting these. Very helpful.

    ReplyDelete
  31. Thank you. Very conceptual questions, helped me a lot

    ReplyDelete
  32. thankyou very good excercise to brushup the topics

    ReplyDelete
  33. My question
    Data a;
    Office ='stansys';
    Run;

    Output : StAnSyS

    ReplyDelete
  34. thanks a lot!!! Its was very helpful

    ReplyDelete
Next → ← Prev