DATA Step, Macro, Functions and more

Reading raw files

Reply
Contributor
Posts: 31

Reading raw files

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.

Respected Advisor
Posts: 3,124

Re: Reading raw files

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

Contributor
Posts: 31

Re: Reading raw files

The answer here should be 3?
Respected Advisor
Posts: 3,124

Re: Reading raw files

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

Contributor
Posts: 31

Re: Reading raw files

Whoops! yeah! My bad. Thanks Smiley Happy
Ask a Question
Discussion stats
  • 4 replies
  • 240 views
  • 1 like
  • 2 in conversation