EZ Study

Actuarial Biology Chemistry Economics Calculators Confucius Engineer
Physics
C.S.

SAS Programing Certification Exam
Practice Questions & Answer set-29

Practice Question 143

The following SAS program is submitted:
data work.total;
set work.salary(keep = department wagerate);
by department;
if first.department then payroll = 0;

payroll + wagerate;     if last.department;
run;
The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments.
Which one of the following represents how many observations the WORK.TOTAL data set contains?
A. 5     B. 20     C. 100     D. 500


Answer is A

Practice Question 144

The following SAS program is submitted:
data work.total;
set work.salary(keep = department wagerate);     by department;
Click to Get Those Highly Recommended SAS Programmers' Books
if first.department then payroll = 0;     payroll + wagerate;
if last.department;
run;
The SAS data set named WORK.SALARY contains 10 observations for each department, currently ordered by DEPARTMENT.
Which one of the following is true regarding the program above?
A. The BY statement in the DATA step causes a syntax error.
B. FIRST.DEPARTMENT and LAST.DEPARTMENT are variables in the WORK.TOTAL data set.
C. The values of the variable PAYROLL represent the total for each department in the WORK.SALARY data set.
D. The values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.



Answer is C

Practice Question 145

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 is C

Practice Question 146

The following SAS program is submitted:
data work.accounting;
set work.dept1 work.dept2;
run;
A character variable named JOBCODE is contained in both the WORK.DEPT1 and WORK.DEPT2 SAS data sets. The variable
JOBCODE has a length of 5 in the WORK.DEPT1 data set and a length of 7 in the WORK.DEPT2 data set.
Which one of the following is the length of the variable JOBCODE in the output data set?
A. 5
B. 7
C. 8
D. 12


Answer is A.

Related links:

Continue to SAS Practice Exam Question Answer Set-30   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-28   SAS Tutorial   Statistics Tutorial