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 15:49:21 -0500
Reply-To:     Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mike Rhoads <RHOADSM1@WESTAT.COM>
Subject:      Re: Parsing dates with prxparse
Comments: To: plw213 <>
In-Reply-To:  <>
Content-Type: text/plain; charset="us-ascii"


Take another look at the documentation for PRXPOSN. You need to call PRXMATCH, PRXSUBSTR, PRXCHANGE, or PRXNEXT before using PRXPOSN.


Mike Rhoads Westat

-----Original Message----- From: [] On Behalf Of plw213 Sent: Friday, December 08, 2006 3:38 PM To: Subject: Parsing dates with prxparse

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) ;


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