Date: Mon, 12 Nov 2007 17:16:55 -0500
Reply-To: "Audimar P. Bangi" <audi@SAS2THEMAX.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Audimar P. Bangi" <audi@SAS2THEMAX.COM>
Organization: sas2themax.com
Subject: Re: Date from Character Input
In-Reply-To: <200711122121.lACL6DTn003428@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
Hi Chandra,
There is a custom date format in Notebook (http://sas2themax.com/free)
called "DATED" that formats a date value to the form "dd-MMM-yyyy" (or
"dd-MMM-yy" if the format length entered is less than 11). There is also a
date format called "DATEP" that formats a date value to the form
"dd.MMM.yyyy" or "dd.MMM.yy.
Notebook can open your SAS dataset containing the original date values using
the Data Editor. Right-click on the the column containing your date values
and select "Column Attributes". Under the "Date Type" combobox, change it to
"DateTime" and click "Apply" (if the data type is already set as "DateTime",
leave it as it is). Under the "Format Name" combobox, select "DATED" and
change the Format Length to 11. Click "Apply". That should do it.
You can also insert a new column with a custom date format. Right-click on
your date column and select "Insert Column". Change the "Data Type" to
"DateTime". Under "Format", highlight the current text and type "M/dd/yyyy
hh:mm:ss tt". Click OK. Click on the header containing your original dates.
Press "Ctrl-C" to copy the date values. Now click on the first cell of the
column we inserted in the previous step. Press "Ctrl-V" to paste the date
values. Right-click on the column again and select "Column Attributes".
Under "Format Name", select "DATED" and set the Format Length to 11. Click
Apply. That should do it.
A tutorial on how to deal with custom dates can be found here:
http://sas2themax.com/blogs/owner/archive/2007/11/08/How-to-work-with-custom-dates.aspx
HTH, Audi
----- Original Message -----
From: "SUBSCRIBE SAS-L Chandra Gadde" <ddraj2015@GMAIL.COM>
To: <SAS-L@LISTSERV.UGA.EDU>
Sent: Monday, November 12, 2007 4:21 PM
Subject: Re: Date from Character Input
> Actually, I have this column in a SAS Dataset. I need to take this column
> from a sas dataset and create a another column with date9. format
>
> Thanks for the help.