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 <Paul.Leland@gmail.com>
In-Reply-To:  <1165610255.169238.32630@f1g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"

Paul,

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

HTH!

Mike Rhoads Westat RhoadsM1@Westat.com

-----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of plw213 Sent: Friday, December 08, 2006 3:38 PM To: sas-l@uga.edu 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) ;

run;


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