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 -
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.
- Import raw data files. Study INPUT, INFILE and FILE statements.
- Import raw data files with PROC IMPORT.
- How to export data.
- Combine and Merge SAS Datasets. Study SET, MERGE and UPDATE statements.
- Difference between IF and WHERE statements.
- How to keep, drop and rename variables
- How to produce summary reports using Proc REPORT, Proc PRINT and Proc FREQ
- Generate HTML using ODS statements
- Do Loop and Arrays
- Proc Content and Proc Dataset
- Character and Date Functions
- 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.
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.
SAS Base Certification Questions and Answers |
Previous Three Parts
- Part I : SAS Certification Questions and Answers
- Part II : SAS Certification Questions and Answers
- Part III : SAS Certification Questions and Answers
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;
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.
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.
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.
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;
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
Learn SAS : Free 100+ SAS Tutorials
Good Job. Thanks..!
ReplyDeleteGood one!
ReplyDeleteKindly provide sample of short questions too in base sas certification
ReplyDeleteThanks 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)
ReplyDeleteTHX for your work!
Good work, keep it up!!
ReplyDeleteThose were really helpful,thanx
ReplyDeleteits not suffecient
ReplyDeletegood it is more helpfull to me
ReplyDeleteThis was helpful, thanks.
ReplyDeleteThanks for the detailed compilation!
ReplyDeleteCould you please recheck the answer to question 38 as I think the answer would be 'Of'. Thanks
ReplyDeleteDelimiter mentioned "," is wrong. It should be " " to get "Of".
DeleteNeither question nor answer is wrong. The question was framed in such a way.
Deletei think so correct ans is B
Deleteits really great site
ReplyDeleteGreat Job on preparing some tricky questions for the SAS Exam...please keep up the good work! Thank you!!!!!
ReplyDeleteI am preparing for SAS base certification 211, can you please suggest me good preparation guide.
ReplyDeleteSAS Certification prep Guide for base programming 9 by SAS Institute
DeleteReally helpful explanations..! thanks a lot
ReplyDeletethanks a lot for your helpful effort.
ReplyDeleteThank you for your kind words. Cheers!
DeleteGreat Job Mr. Bhalla.. Keep up the good work
ReplyDeleteThe night before the exam, helped lots!
ReplyDeleteThanks!
All the best for your exam.
DeleteGreat Work dude,by solving this questions,I got confident on certification exam...
ReplyDeletecan you please explain Q38?
ReplyDeleteafter 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
ReplyDeleteCorrect. That's why it returns missing.
Deletethank you for questions...it helped a lot.
ReplyDeleteits nice, thanks for sharing this
ReplyDeleteGreat!!
ReplyDeleteThanks for posting these tricky questions- it helps utilize critical thinking to understand the logic behind the statements!
ReplyDeleteit is first website which has clear explanation
ReplyDeleteThanks for providing these good, accurate questions with thoughtful explanations for free. Please continue the good work!
ReplyDeleteHello.
ReplyDeleteThank you very much.
Thank you for this questions and excellent explainations.
ReplyDeletegrt work buddy, keep it up.
ReplyDeleteThanks for the explanations. They are very helpful.
ReplyDeleteThanks for the efforts. I believe the answer for Q.38 is 'B'.
ReplyDeleteOverall a good job!
It would have been B if space was there between the quotes " ". Since the separator used is "," the D option is correct.
Deletevery helpful thnx....
ReplyDeleteGreat job!! Thanks a lot!!
ReplyDeleteThank you for posting these. Very helpful.
ReplyDeleteThank you. Very conceptual questions, helped me a lot
ReplyDeletethankyou very good excercise to brushup the topics
ReplyDeleteMy question
ReplyDeleteData a;
Office ='stansys';
Run;
Output : StAnSyS
thanks a lot!!! Its was very helpful
ReplyDelete