Date: Thu, 20 Oct 2011 18:24:22 +0000
Reply-To: "Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU>
Subject: Re: Fun With Dates
Content-Type: text/plain; charset="us-ascii"
As to your comment on knowing what you want the function to do, but not knowing its name:
If you know the category of function you want (character string, financial, date and time) you can give yourself a fighting change with the SAS "Functions and Call Routines by Category" page. At least then all the functions in the given category are listed consecutively.
In the SAS 9.2 world, you can start at "Functions and Call Routines" (http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245852.htm ) and then click on the "by Category" link.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mary Rosenbloom
Sent: Thursday, October 20, 2011 2:10 PM
Subject: Fun With Dates
I have some variables formatted as SAS dates (date9 format), such as:
Then I have character string, EVTDT, which has this form:
25 DEC 2011
I have been asked to make all of the "dates" look alike in format. I'm pretty sure that we need to keep the EVTDT variable as a character string, since it can sometimes contain a partial date, such as:
UNK DEC 2011
(1) Is there a date format like DATE9 but with spaces between the day and month, month and year?
(2) Is there a SAS function that can remove the spaces like this:
25 DEC 2011 -> 25DEC2011
I have found that it is sometimes hard to search for a function when you don't know it's name, only what it does.
Thanks so much for your help!