LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (December 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 22 Dec 2008 11:38:52 -0500
Reply-To:     msz03@albany.edu
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mike Zdeb <msz03@ALBANY.EDU>
Subject:      Re: 2nd occurrence of a character remove
Content-Type: text/plain;charset=iso-8859-1

hi ... works in V8 (you "... should have had a V9 ..."

data x; infile datalines truncover; input title $100.; datalines; (HS 429-2 - Strategic decision making in healthcare) (ONLY ONE - DASH, NO CHANGE) (THERE ARE NO DASHES) (THREE DASHES - GETS CHANGED - - TO TWO DASHES) ; run;

data x; set x; substr(substr(title,index(title,'-')+1),index(substr(title,index(title,'-')+1),'-'),1) =''; run;

-- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475

> Hi friends, > How to remove the second occurrence of a character from a string such as "-" and leaving the first one. > such as HS 429-2 - Strategic decision making in healthcare to be changed to > HS 429-2 Strategic decision making in healthcare > Thank u. > > > Dr. Jamil Ibrahim, Ph.D. > Scientist IV > Professor , SHRP > Research Supervisor > Univ. Of Miss. Med. CTR. > 2500 N state St > Jackson, MS 39216 > Tel. 601-984-1197 > Fax 601-984-1205 > Nternet: jibrahim@acadaff.umsmed.edu > The information contained in the attachment(s) to this email is confidential. If you were not expecting a confidential email from the Department of > Institutional Research at the University of Mississippi Medical Center, please do not view, open, disclose, reproduce, distibute or otherwise use > this attachment. If you received this email in error, please notify me immediately. Thank you. > > > Individuals who have received this information in error or are not authorized to receive it must promptly return or dispose of the information and > notify the sender. Those individuals are hereby notified that they are strictly prohibited from reviewing, forwarding, printing, copying, > distributing or using this information in any way. > >


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