Think one problem is: it is really very unimportant how the date values
are formatted, the content is always the same!
What I don't understand: what is PERIOD? In your example, the PERIOD seems
to be always a date in january 2010, independant from start and end!?
If you need februray data, independant of the year, why not using the
month-function for that? That returns always 2 for february and that you
can use for subsetting across all years in your data...
On Tue, 9 Mar 2010 09:35:28 -0500, Nathaniel Wooding
While I can suspect where the problem lies, could you post (to the group,
not just to me) the actual code that you used. That would help a lot.
From: sasbond1981 sasbond1981 [mailto:email@example.com]
Sent: Tuesday, March 09, 2010 9:14 AM
To: Nathaniel Wooding (Services - 6)
Cc: SAS-L@listserv.uga.edu; SAS-Lfirstname.lastname@example.org
Subject: Re: new joinee
need suggestion please..
Suppose I have a dataset containing two variables "Start_Date and
End_Date" and here I need to create a variable called "period".
Here the start and end dates were in Datetime format and I took only
datepart by "datepart" function and formated it as date9. And
created "Period" variable by giving some logic as
" MDY(month(today()),1,year(today()))-1 "
which will give value as "FEB2010" (which is Monyy7. format). So now based
on this period variable I need to pull only the FEB month data from years
Actually the data contains two years (historical) data till last month.
START_DATE END_DATE PERIOD
01FEB2010 01FEB2010 JAN2010
01FEB2010 02FEB2010 JAN2010
16JUL2009 16JUL2009 JAN2010
19DEC2009 20DEC2009 JAN2010
21JAN2010 22FEB2010 JAN2010
26FEB2010 26FEB2010 JAN2010
30JAN2010 30JAN2010 JAN2010
31DEC2009 31DEC2009 JAN2010
the above is the sample data... now what I need is based on this period I
need to pull only Feb dates starting from 01FEB2010 and ending of
31FEB2010. So in simple I want FEB data only.
START_DATE is in date9. format
END_DATE is in date9. format
Period is in Monyy7. format
I tried with between and >= and <= and etc etc... but it is not workin for
me... please give me ur idea on this...
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.