135 libname temp 'C:\mysaslib\';
NOTE: Libname TEMP refers to the same physical library as PERM.
NOTE: Libref TEMP was successfully assigned as follows:
Physical Name: C:\mysaslib
136 data work.new;
137 set temp.jobs;
138 format newdate mmddyy10.;
139 qdate = qtr(newdate);
140 ddate = weekday(newdate);
NOTE: There were 1 observations read from the data set TEMP.JOBS.
NOTE: The data set WORK.NEW has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
The statement format newdate mmddyy10.; will change the format of the newdate variable. The specified format is mmddyy10 which will format newdate as "04/15/2000".
The qdate = qtr(newdate); statement will return the quarter from the given date and assign value of 2 to variable qdate (As April 15th falls in the 2nd quarter).
The ddate = weekday(newdate); statement will return the weekday number that corresponds to the day of week from a SAS date value. Since April 15, 2000 was a Saturday, a value of 7 is assigned to variable ddate. Option D is correct.
The one and only FREE resource for general SAS online training as well as study guides for the SAS Base Certification. My goal is to create the SAS Certification prep guide that I never found but always wanted. This should also be a place to come if you are new to the language but are simply looking for online SAS training.