| Date: | Fri, 21 Jul 2006 17:31:46 +0000 |
| Reply-To: | toby dunn <tobydunn@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | toby dunn <tobydunn@HOTMAIL.COM> |
| Subject: | Re: Dates - count |
|
| In-Reply-To: | <1153502873.584383.137350@m79g2000cwm.googlegroups.com> |
| Content-Type: | text/plain; format=flowed |
|---|
sdlentert ,
You didnt put the option multilabel:
value RangeFmt
Should have been
value RangeFmt (multilabel)
Toby Dunn
'They say that Spanish is the Language of Love,
I Loved the way it rolled off of her tongue'
'I dont know what she said but I loved the way she said it'
From: sdlenter <sdlentert@AOL.COM>
Reply-To: sdlenter <sdlentert@AOL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Dates - count
Date: Fri, 21 Jul 2006 10:27:53 -0700
that didn't work
120 proc format;
121 value RangeFmt 1 - high ='1 Year Old'
122 2 - high ='2 Years Old'
123 3 - high ='3 Years Old'
124 5 - high ='5 Years Old'
125 10 - high ='10 Years Old'
126 run;
ERROR: These two ranges overlap: 1-HIGH and 2-HIGH (fuzz=1E-12).
ERROR: These two ranges overlap: .-HIGH and 3-HIGH (fuzz=1E-12).
ERROR: These two ranges overlap: .-HIGH and 5-HIGH (fuzz=1E-12).
ERROR: These two ranges overlap: .-HIGH and 10-HIGH (fuzz=1E-12).
NOTE: The previous statement has been deleted.
NickyNN wrote:
> Would you like a count of the number of years from today's date ?
>
> How about something like this:
>
> proc format ;
> value RangeFmt (multilabel)
> 0="0 Year Old"
> 1-high="1 Year Old"
> 2-high="2 Year Old"
> 3-high="3 Year Old"
> 5-high="5 Year Old"
> 10-high="10 Year Old";
> run;
>
> data TestData;
> input CharDate $ ;
>
> SASDate = input(CharDate,yymmdd8.);
> Today=today() ;
> YearsOld=year(Today)-year(SASDate) ;
>
> format SASDate Today Date7.;
> cards;
> 20051111
> 20041016
> 20030102
> 19990518
> 19990610
> 20001231
> 20010101
> 20010317
> 20011224
> 19800101
> 19800102
> ;
> run;
>
> proc sort data=TestData ;
> by descending SASDate ;
> run ;
>
> proc summary data=Testdata nway ;
> class YearsOld / mlf order=Data;
> Var SASDate ;
> format YearsOld RangeFmt. ;
> output out=DateCounts (drop=_type_ _freq_) n=DateCounts;
> run ;
>
> proc print data=SummaryCounts ;
> run;
>
> Cheers,
> Nicky.
|