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 (January 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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.


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