From: Eli Y. Kling on
did you mean pool or subset? What is the analysis/hypothesis you are
aiming at?

Eli
From: Francois van der Walt on
Is this what you had in mind?

data master;
input date ddmmyy10. transno;
format date ddmmyy10.;
datalines;
1/1/2009 1
1/2/2008 2
1/1/2007 3
2/1/2006 4
3/2/2005 5
;
data extract;
set master;
if year(date)>2006;
proc print;
run;

Regards
Francois (Brisbane)
On Thu, 4 Mar 2010 13:29:25 +0800, chittiprolu pradeep
<chittiprolupradeep(a)GMAIL.COM> wrote:

>Hi All,
>
>Can any one please tell me... how can I pull say 4 years of data from master
>data (this contains 10 yrs of data).
>
>I am planning to pull the data past 4 years starting from last month
>JAN2010.
>
>
>Cheers,
From: Barry Schwarz on
On Thu, 4 Mar 2010 13:29:25 +0800, chittiprolupradeep(a)GMAIL.COM
(chittiprolu pradeep) wrote:

>Hi All,
>
>Can any one please tell me... how can I pull say 4 years of data from master
>data (this contains 10 yrs of data).
>
>I am planning to pull the data past 4 years starting from last month
>JAN2010.

Last month was February, not January.

If you mean 4 years from today, then since there is exactly one leap
year in any 4 year span
if today()-date < 1461;

If you mean 48 months starting in February 2006 and ending in January
2010, then
if '01Feb2006'd <= date <= '31Jan2010'd;

If you mean everything from 2006 through January 2010, ignoring
February and March, then
if year(date) > 2006 & date <= 31Jan2010'd;

--
Remove del for email
From: Derek Morgan on
On Mar 4, 1:52 pm, Barry Schwarz <schwa...(a)dqel.com> wrote:
> On Thu, 4 Mar 2010 13:29:25 +0800, chittiproluprad...(a)GMAIL.COM
>
> (chittiprolu pradeep) wrote:
> >Hi All,
>
> >Can any one please tell me... how can I pull say 4 years of data from master
> >data (this contains 10 yrs of data).
>
> >I am planning to pull the data past 4 years starting from last month
> >JAN2010.
>
> Last month was February, not January.
>
> If you mean 4 years from today, then since there is exactly one leap
> year in any 4 year span
>     if today()-date < 1461;
>
> If you mean 48 months starting in February 2006 and ending in January
> 2010, then
>     if '01Feb2006'd <= date <= '31Jan2010'd;
>
> If you mean everything from 2006 through January 2010, ignoring
> February and March, then
>     if year(date) > 2006 & date <= 31Jan2010'd;
>
> --
> Remove del for email

If you want the last 4 years from the current date then you should use
the following:

if date_of_record >= INTNX('year',today(),-4,'S'); /* this assumes
that you do not have dates of record in the future */

Derek