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 (July 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Jul 2003 13:57:49 -0400
Reply-To:     "Michael S. Zdeb" <msz03@HEALTH.STATE.NY.US>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Michael S. Zdeb" <msz03@HEALTH.STATE.NY.US>
Subject:      Re: pulling apart character variable
Comments: To: Kristie Beth <kristie_35_89@YAHOO.COM>
Content-type: text/plain; charset=us-ascii

Hi...

data test; input text $60.; datalines; Oregon State University (Osu) Clinical Research Project (Crp) University of California, Santa Barbara (Ucsb) ; run;

data test; set test; x = scan(text,-1,'('); text = trim(tranwrd(text,trim(x),' ')) || upcase(x); run;

proc print data=test; run;

Mike Zdeb U@Albany School of Public Health 1 University Drive Rensselaer, NY 12144-3456 (P)518-402-6749 (F)518-402-0380

|---------+----------------------------> | | Kristie Beth | | | <kristie_35_89@YA| | | HOO.COM> | | | Sent by: "SAS(r) | | | Discussion" | | | <SAS-L@LISTSERV.U| | | GA.EDU> | | | | | | | | | 07/02/2003 01:33 | | | PM | | | Please respond to| | | Kristie Beth | | | | |---------+----------------------------> >---------------------------------------------------------------------------------------------------------------------| | | | To: SAS-L@LISTSERV.UGA.EDU | | cc: | | Subject: pulling apart character variable | >---------------------------------------------------------------------------------------------------------------------|

Hi SAS-L, Maybe this question is too simple but I can't find a solution so am going to you for help, suggestions.

I want to pull apart a character string where there are parentheses and replace the existing text with upcase letters. I want to use a function like substr but do not know what word position the parentheses are at as they vary from case to case.

My strings are like so:

Oregon State University (Osu) Clinical Research Project (Crp) University of California, Santa Barbara (Ucsb)

Any help or suggestion are much appreciated!

thanks! Kristie

--------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo.


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