Date: Tue, 19 Aug 2008 14:44:32 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
Subject: Re: how to convert char variables into a date format?
On Mon, 18 Aug 2008 23:23:22 -0700, n <nikhil.abhyankar@GMAIL.COM> wrote:
>On Aug 19, 11:19 am, n <nikhil.abhyan...@gmail.com> wrote:
>> Hi all;
>> I have a char9 variable which actually holds dates like, 09-Apr-07.
>> I get an error, The informat $DATE was not found or could not be
>> loaded. when I try using,
>> data want; set have;
>> informat date DATE7. ;
>> Could anybody please tell me what is going wrong and how could I
>> change the informat of the char type variable to a date informat?
You are trying to assign a numeric informat to a character variable. SAS
tries to help by looking for a character informat with the same name
prefixed by a dollar sign, but there is no such informat.
You can change the informat only to a different *character* informat. Date
informats are numeric.
>I had tried removing the informat by,
> set have;
> informat date;
>However, even this doesn't seem to work. The proc content still shows
>that date is a char 9 variable.
Right. Changing an informat can't change a variable's type.