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 (August 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 17 Aug 2005 15:34:33 -0400
Reply-To:   "Fehd, Ronald J" <rjf2@CDC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Fehd, Ronald J" <rjf2@CDC.GOV>
Subject:   Re: Help with a Macro resolution problem
Content-Type:   text/plain; charset="US-ASCII"

> From: monal kohli > Can someone point out what's wrong with this,why is > the macro variable new not getting the value of var1. > I cannot use call symput,so I have to stick to %let . > > > %MACRO PRNTRPT; > %GLOBAL new; > DATA _NULL_; > LENGTH VAR1 VAR2 VAR3 $3; > %DO J = 1 %TO 3; > VAR1= "1" || TRIM(LEFT(J)); > %let new = VAR1; > END; > RUN; > %PUT _USER_; > %PUT "THE VALUE OF new IS " &new; > %mend; > %PRNTRPT;

as noted, you're mixing and matching we can't guess what you are thinking other than the note you want to write to the log. so:

%Let New =;*initialize; %MACRO PrntRpt(GlobalMvar = new ,Dim_J = 3); %global &GlobalMvar.; %local J; %do J = 1 %to &Dim_J.; %Let &GlobalMvar. =1&J.;%*macro concatenation; %end; %Mend;

Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov

By using your intelligence you can sometimes make your problems twice as complicated. -- Ashleigh Brilliant


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