Date: Tue, 8 Jan 2008 15:00:16 -0500
Reply-To: wcw2 <wcw2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: wcw2 <wcw2@CDC.GOV>
Subject: inserting (not replacing!) characters into strings
I have eight digit (character format) patient IDs ("PT") (ex: 28300102)
that I need to insert hyphens into to give me 28-32-0102. I tried the
substr function (for the first hyphen only) [substr (PT, 3, 1) = "-";], but
this will replace the original value with a "-" rather than inserting the
hyphen (i.e., it gives "28-00102" instead of "28-300102"). Any help would
be greatly appreciated! Hope this was clear.
|