| Date: | Wed, 29 Mar 2006 14:53:44 +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: Need Suggestion - Help |
|
| In-Reply-To: | <1143637795.449385.60910@z34g2000cwc.googlegroups.com> |
| Content-Type: | text/plain; format=flowed |
|---|
BD ,
data one ;
infile cards ;
input Date $ ;
cards ;
20051
200502
200512
20200
400201
;
run ;
data two ;
set one ;
NewDate = input( Date, ?? yymmn6. ) ;
if ( NewDate = . ) then ErrorFlag = 1 ;
else if ( year(NewDate) not in ( 2005 , 2006 ) ) then ErrorFlag = 1 ;
else ErrorFlag = 0 ;
run ;
proc print
data = two ;
format NewDate Date9. ;
run ;
Toby Dunn
From: BD <bd301@YAHOO.COM>
Reply-To: BD <bd301@YAHOO.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Need Suggestion - Help
Date: Wed, 29 Mar 2006 05:09:55 -0800
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.
|