Date: Tue, 8 Jan 2008 14:05:40 -0600
Reply-To: bruce johnson <chimanbj@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: bruce johnson <chimanbj@GMAIL.COM>
Subject: Re: inserting (not replacing!) characters into strings
In-Reply-To: <200801082002.m08BkNFb009285@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
It may not be the most elegant, but it works...
data temp;
patientid="28300102";
patid=substr(patientid,1,2)||"-"||substr(patientid,3,2)||"-"||substr(patientid,5);
put _all_;
run;
PATIENTID=28300102 PATID=28-30-0102 _ERROR_=0 _N_=1
On Jan 8, 2008 2:02 PM, wcw2 <wcw2@cdc.gov> wrote:
> sorry....that should be "28-30-0102" on the 2nd line
>
|