LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 19 Aug 2008 00:50:40 -0400
Reply-To:     Scott Bass <sas_l_739@YAHOO.COM.AU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Scott Bass <sas_l_739@YAHOO.COM.AU>
Subject:      Picture format to print Mon-Yy

Hi,

We've got an existing ETL application storing month strings as character data, i.e. Jan-08, Feb-08, etc.

Of course, if I sort on that column, it doesn't sort correctly.

I'd prefer to store the data as a SAS date value, but need to redisplay it back as Mon-Yy, i.e. Jan-08, Feb-08, etc.

Here is my working code:

proc format; picture foo low-high = '%b-%0y' (datatype=date) ; run;

data _null_; date_chr="Feb-08"; date_num=input(date_chr,monyy6.); put date_num foo.; run;

This prints as FEB-08, but I need Feb-08 (pedantic, I know).

Is there a native format I'm unaware of that will print dates as desired? Or an option to the picture format that will format the date as PROPCASE?

This is SAS 9.1.3 SP4 on Windows.

Thanks, Scott


Back to: Top of message | Previous page | Main SAS-L page