Date: Wed, 29 Mar 2006 09:38:14 -0500
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: Need Suggestion - Help
That depends on what you define as valid/invalid! E.g. the year 4002 IS
valid! Why should the year 20000 not be valid? Also 20011 = january 2001 -
why not?
So it's on you to define limits and test all the criteria.
E.g. you could say, all values with length less than 6 are invalid, maybe
even with length ne 6?
So use
valid=0;
if length(compress(start))=6 and
2000<=input(substr(start,1,4),8.)<=2100 and
1<=input(substr(start,5,2),8.)<=12 and
...
than valid=1;
On Wed, 29 Mar 2006 05:09:55 -0800, BD <bd301@YAHOO.COM> wrote:
>Hello!
>
>I have a dataset that contains START field. The values in this field
>is in the form of yyyymm (200501, 200502 etc). However, some of the
>values entered in this field is not VALID, such as 20051, 20200 400201
>etc. I want to flag these rows that have invalid START field. What
>is the best way to do it?
>
>Thanks.
|