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 (February 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 10 Feb 2003 19:26:42 -0000
Reply-To:     Roland <roland@RASHLEIGH-BERRY.FSNET.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Roland <roland@RASHLEIGH-BERRY.FSNET.CO.UK>
Subject:      Re: utility macro for returning a compressed string

1 %let macvar=aaa:bbb:ccc; 2 %put &macvar; aaa:bbb:ccc 3 %let macvar=%sysfunc(compress(&macvar,:)); 4 %put &macvar; aaabbbccc

"Kevin Auslander" <kauslander@TERRECRS.COM> wrote in message news:002c01c2d134$5b5e81a0$6a00a8c0@crs.local... > I need a utility macro that will compress a the value of a macro > variable. It would be used like this: > > %let var=%compress(&var,:); > > After this statement executes I would want var to equal it's previous > value with all colons removed. %compress would work just like the data > step compress function. Below is my attempt at writing this utility > macro. It does not work. Does anyone know what's wrong? Am I on the > right track? > > %macro compress(var,chars); > > data _null_; > length var $30000; > var = "&var." > var = compress("&var.","&chars."); > call symput("var",var); > run; > > %sysfunc(putc(&var,$30000.)); > > %mend; > > TIA, > > Kevin


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