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 (December 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 8 Dec 2006 12:37:35 -0800
Reply-To:     plw213 <Paul.Leland@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         plw213 <Paul.Leland@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Parsing dates with prxparse
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

OK -I am at my wits end!!

Can anyone tell me why this doesn't work to parse out mm, dd, and yyyyy out of a character string for dates formatted mm/dd/yyyy or m/d/yyyy (when month or date is less than) 10? All I get is blanks for the prxposn results:

data medimpact_demog ; infile medimp dsd dlm='09'x firstobs=2 ; retain re_date ; if _n_=1 then re_date=prxparse("/(\d{1,2})\/(\d{1,2})\/(\d{4})/") ;

length DOB_string $10 . . . ;

input DOB_string : $ . . ;

dob_string=compress(dob_string) ;

dob=mdy(prxposn(re_date,1,dob_string) , prxposn(re_date,2,dob_string) , prxposn(re_date,3,dob_string)) ;

mm=prxposn(re_date,1,dob_string) ; dd=prxposn(re_date,2,dob_string) ; yy=prxposn(re_date,3,dob_string) ;

run;


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