EZ Study

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

SAS Programing Certification Exam
Practice Questions & Answer set-10

Practice Question 39

The following SAS program is submitted:

libname temp 'SAS-data-library';

data work.new;     set temp.jobs;     format newdate mmddyy10.;
Click to Get Those Highly Recommended SAS Programmers' Books
qdate = qtr(newdate);     ddate = weekday(newdate);
run;

proc print data = work.new;
run;

The variable NEWDATE contains the SAS date value for April 15, 2000.
What output is produced if April 15, 2000 falls on a Saturday?

A. Obs newdate qdate ddate
1 APR152000 2 6

B. Obs newdate qdate ddate
1 04/15/2000 2 6

C. Obs newdate qdate ddate
1 APR152000 2 7

D. Obs newdate qdate ddate
1 04/15/2000 2 7

Answer: D The WEEKDAY function produces an integer that represents the day of the week, where 1=Sunday, 2=Monday, ..., 7=Saturday.

Practice Question 40

The following SAS program is submitted:

data work.report;
set work.sales_info;
if qtr(sales_date) ge 3;
run;

The SAS data set WORK.SALES_INFO has one observation for each month in the year 2000 and the variable SALES_DATE which contains a SAS date value for each of the twelve months.

How many of the original twelve observations in WORK.SALES_INFO are written to the WORK.REPORT data set?

A. 2     B. 3     C. 6     D. 9

Answer C The qtr values of each of the months 7,8,9,10,11,12 is 3,3,3,4.4,4..Therefore 6 obs in the final dataset.

Practice Question 41

The following SAS program is submitted:

data revenue;     set year_1;

var1 = mdy(1,15,1960);     run;

Which one of the following values does the variable named VAR1 contain?

A. 14     B. 15     C. 1151960     D. '1/15/1960'

Answer: A 1Jan1960 is 0 in SAS 15Jan1960 is 14 in SAS

Practice Question 42

The following SAS program is submitted:

data work.new;
mon = 3;
day = 23;
year = 2000;
date = mdy(mon,day,year);
run;

Which one of the following is the value of the DATE variable?
A. a character string with the value '23mar2000'
B. a character string with the value '03/23/2000'
C. a numeric value of 14692, which represents the SAS date value for March 23, 2000
D. a numeric value of 3232000, which represents the SAS date value for March 23, 2000

Answer: C Mdy() function returns a date numeric val

Related links:

Continue to SAS Practice Exam Question Answer Set-11   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-9   SAS Tutorial   Statistics Tutorial