LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (December 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 22 Dec 2008 10:00:55 -0500
Reply-To:     Ed Heaton <EdHeaton@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ed Heaton <EdHeaton@WESTAT.COM>
Subject:      Re: Re-formatting date fields
Comments: To: Ryan Utz <rutz@AL.UMCES.EDU>
In-Reply-To:  <EDB6078EC27BC74290635465379F70D207B0CE6EE3@EX-CMS01.westat.com>
Content-Type: text/plain; charset="us-ascii"

Okay, it's Monday!!

LibName mdbLib "\\path\yourDatabase.mdb" ; Proc print data=mdbLib.yourData( dbSasType=( SomeDate=date ) obs=5 ; Var SomeDate ; Format SomeDate date9. ; Run ; LibName mdbLib clear ;

Ed

Ed Heaton TB-286 #4818

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ed Heaton Sent: Monday, December 22, 2008 9:55 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Re-formatting date fields

Ryan;

You can use the dbSasType=() dataset option if you are getting your data using the SAS/ACCESS Interface to PC Files. For example:

LibName mdbLib "\\path\yourDatabase.mdb" ; Proc print data=mdbLib.yourData( dbSasType=( SomeDate= ) obs=5 ; Var SomeDate ; Format SomeDate date9. ; Run ; LibName mdbLib clear ;

Ed

Edward Heaton, Senior Systems Analyst, Westat (An Employee-Owned Research Corporation), 1650 Research Boulevard, TB-286, Rockville, MD 20850-3195 Voice: (301) 610-4818 Fax: (301) 294-2085 mailto:EdHeaton@Westat.com http://www.Westat.com

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ryan Utz Sent: Sunday, December 21, 2008 4:05 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re-formatting date fields

I'm importing a date and time field from Access. It arrives in SAS with the full date/time information:

01JUN2001:00:20:00

Once in, however, I'd like to re-format it so it shows just the date (in the form 6/1/2001) or just the time (00:20:00). I don't care if I lose information, as this is part of a procedure to create a bunch of .csv files. Is it too much to ask to display less information?!?

Thanks, r


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