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 (July 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 17 Jul 2002 11:15:27 -0700
Reply-To:     Pete Lund <pete.lund@NWCSR.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Pete Lund <pete.lund@NWCSR.COM>
Subject:      Re: MS Access to SAS Date Interpretation
Comments: To: Cathy Ward <cward@NCACCESSCARE.ORG>
In-Reply-To:  <000f01c22dbb$e43afac0$1001a8c0@accesscare.intranet>
Content-Type: text/plain; charset="us-ascii"

Hi Cathy- If you're using PROC IMPORT the variable will be created as character and you'll need to create a new variable, in a data step, that is numeric. You can use the INPUT function to do that:

NewVar = input(DateOfService,date9.);

You could rename the original variable in your SET statement if you want the numeric variable to be called DateOfService.

---------------------------------------------------------------------------- --- Pete Lund Northwest Crime and Social Research, Inc. A SAS Alliance Partner 215 Legion Way SW Olympia, WA 98501 (360) 528-8970 - voice (360) 280-4892 - cell (360) 570-7533 - fax pete.lund@nwcsr.com www.nwcsr.com ---------------------------------------------------------------------------- ---

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Cathy Ward Sent: Wednesday, July 17, 2002 11:01 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: MS Access to SAS Date Interpretation

In response to Pete, Nancy & James,

This is the error I get with the Date9. or any other date format available:

"ERROR: Variable DateOfService has been defined as both character and numeric."

I am interpreting this to mean the input field is character (which is correct) and the Date9. format SAS is trying to apply is numeric, which is a mismatch in its mind.

I've tried using the PROC IMPORT feature as well as INFILE. Admittedly, my experience with INFILE is limited. The error is still the same.

Welcoming all additional input...

Cathy

-----Original Message----- From: Pete Lund [mailto:pete.lund@nwcsr.com] Sent: Wednesday, July 17, 2002 1:53 PM To: Cathy Ward; SAS-L@LISTSERV.UGA.EDU Subject: RE: MS Access to SAS Date Interpretation

Hi Cathy- Try the DATE9. informat when reading those string date values.

------------------------------------------------------------------------ ---- --- Pete Lund Northwest Crime and Social Research, Inc. A SAS Alliance Partner 215 Legion Way SW Olympia, WA 98501 (360) 528-8970 - voice (360) 280-4892 - cell (360) 570-7533 - fax pete.lund@nwcsr.com www.nwcsr.com ------------------------------------------------------------------------ ---- ---

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Cathy Ward Sent: Wednesday, July 17, 2002 10:40 AM To: SAS-L@LISTSERV.UGA.EDU Subject: MS Access to SAS Date Interpretation

I received a data set from an external source, created by a 6.12 ver of SAS, which in turn was exported into an MS Access table. The dates are listed in a DDMMMYY format, and as MS Access uses different nomenclature, are stored as character rather than date/time variables. I am now trying to import these data sets into my ver 8 SAS and am having trouble getting these fields to be recognized as dates. Any suggestions as to how to convert these character values to a date SAS recognizes would be much appreciated.

Kind regards,

Catherine Ward, RN, MSN/MBA Clinical Data Analyst 3500 Gateway Centre Boulevard, Suite 130 Morrisville, NC 27560-8501 Phone: (919) 380-9962/Fax: (919) 468-8573 CWard@ncaccesscare.org


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