160 data work.report;
161 set work.sales_info;
162 if qtr(sales_date) ge 3;
NOTE: There were 12 observations read from the data set WORK.SALES_INFO.
NOTE: The data set WORK.REPORT has 6 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
In the statement if qtr(sales_date) ge 3;, QTR() is a SAS function that returns the quarter of the year from a SAS date value. The SAS dataset WORK.SALES_INFO has one observation for each month in the year 2000 and the variable SALES_DATE contains a SAS date value for each of the twelve months. For dates between 01JUL2000 and 30SEP2000 the returned quarter be 3 and for dates between 01OCT2000 and 31DEC2000 the returned quarter will be 4. Since there are 6 months total in quarters 3 and 4, a total of 6 observations (which have sales_date values between 01JUL2000 and 31DEC2000) will be in the output dataset. Option C 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.