and so on
my problem is I have to find in which range does today's fall under (in this example range 7). Once I find the range, I need the data for the previous range (in my example range6) Each range has a no. of obsevations associated with it as shown above. I want my output to be
Thank you for your email. I have the dates for the range as separate fields. But they are stored as numbers (like 20090801), both for the start date of the range and the end date of the range. My problem was when I use today() the ourput is a sasdate (number of days), so I don't know how to compare the date stored as numbers and the date which is number of days.
Here is how I have the data
range startdate enddate
range1 20090801 20090901
range2 20090902 20090930
range6 20100107 20100211
range7 20100212 20100310
and so on
when I use the date function I get the output as a number
date() for today 18312
Can you help me compare these dates which are stored in different formats.
Instead of reading the date in as mmddyy8. that your original post showed, use the informat to read it in as yymmdd8. which will interpret and convert the number internally to a SAS date, so the today() will work. Just make sure that when you write the data out, use a format, so it doesn't write it out as a SAS date. If you use yymmddn8. the separators will be removed, and you will have your original number.