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 (August 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Aug 2006 02:59:37 -0400
Reply-To:     Eric Hoogenboom <erichoogenboom@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Eric Hoogenboom <erichoogenboom@YAHOO.COM>
Subject:      Re: How to extract letter?
Comments: To: SUBSCRIBE SAS-L Yufei Wang <yufeiw@GMAIL.COM>

Yufei,

Try this code. It works fine for your given examples.

data complot; length code $ 20; code = "12:55:01 MD PD C1"; output; code = "12:55:01 MDPD C1"; output; run;

data split (drop=locateplot); set complot; length time 8 plot $ 3 doctor $ 2 patient $ 2 locateplot $ 8; format time time8.;

time = input(substr(code, 1, 8), time8.); patient = substr(code, length(code)-1, 2); doctor = substr(code, length(code)-4, 2);

locateplot = substr(code, 10, length(code)-12); plot = substr(locateplot, 1, length(locateplot)-2);

put code= time= plot= doctor= patient=; run;

Hth, Eric


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