BookmarkSubscribeRSS Feed
Bulleride
Obsidian | Level 7

Data a has 12 observations and one variable Date as following.
Date_________________________________________________
01/01/2004
02/01/2004
03/02/2004
04/01/2004
05/01/2004
06/01/2004

07/01/2004
08/01/2004
09/01/2004
10/01/2004
11/01/2004
12/01/2004
How many observations will be there dataset b if the following
datastep is submitted?
Data b;
Set a;
Temp = qtr(input(Date,mmddyy10.));
If Temp LE 3;
RUN;
A) 3
B) 5
C) 9
D) 6
Ans: D

 

Please explain.

4 REPLIES 4
Haikuo
Onyx | Level 15

The answer is wrong. Maybe the intention of the problem is 'LT', instead, it spells 'LE'.

Bulleride
Obsidian | Level 7
The answer here should be 3?
Haikuo
Onyx | Level 15

3rd quarter, hence '9' is the answer.

Bulleride
Obsidian | Level 7
Whoops! yeah! My bad. Thanks 🙂

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1014 views
  • 1 like
  • 2 in conversation