Date: Wed, 6 Dec 2006 16:37:25 -0500
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: error message in reading dates
On Tue, 5 Dec 2006 20:48:29 -0800, xxu8810152@GMAIL.COM wrote:
>Hello everyone,
>
>I have a question on reading dates from a dataset which may contain
>missing values in dates. My code looks like
>
>input
> city $ 1-4
> return_Type $ 5-6
> return_Date YYMMDD10.
> received_Date YYMMDD10.
>/* received_Date $ 98-107*/
>
>When I use 'received_Date YYMMDD10.' SAS complains about invalid data.
>But when I use 'received_Date $98-107', there is no error. Also as
>shown above, SAS does NOT complain the line 'return_Data YYMMDD10',
>which does not contain missing value. So I don't know why SAS created
>error about the second line on reading date in the format of YYMMDD10.
>Is it because that column has missing value?
>
>Does anyone have similar experience?
>
>Thank you!
>
>Xiao
It's hard to be sure just what is not valid since you do not show the data.
"return_Date YYMMDD10." is reading columns 7 through 16 whereas
"received_Date $ 98-107" is reading 98 through 107. Moreover, a character
field will accept just about anything as valid, whereas the date informat is
necessarily fussy.
Also, messages about invalid data are not really errors.
|