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 (May 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 23 May 2003 23:30:42 -0400
Reply-To:     Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject:      Re: Removing Trailing Blanks from a Macro variable and Index

It's important to distinguish between a macrovariable's name and its value.

The first argument to SYMPUT provides the name and the second provides the value.

Try using the TRIM function on the value, which comes from the data step variable _SOURCE_.

call symput (trim('IndepVar'||ii),trim(_SOURCE_));

On Fri, 23 May 2003 17:48:02 -0400, Patricia Simon <patricia.simon@QUANTUM.COM> wrote:

>Hi, >I created a macro variable, IndepVar, that is concatenated with an Index >counter, i. When I refer to the macro variable in a chart title inside >proc gplot, it displays about 20 trailing blanks despite the trim >statement. How do I remove the trailing blanks? >Thank you, >Patty > >data _null_; > set MaxGraphVars end=eof; > i+1; > ii=left(put(i,2.)); > call symput (trim('IndepVar'||ii),_SOURCE_); > if eof then call symput('Total',ii); >run; > >%macro CreateCharts; > >%do i=1 %to &Total; > >proc gplot data=rawdata uniform; >plot &&DepVar&i * &&IndepVar&i; > title2 "Raw Data: Varying &&IndepVar&i"; >run; >quit; >%end; >%mend;

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