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 22:31:29 +0300
Reply-To:   Vlad <vladislav.moltchanov@KTL.FI>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Vlad <vladislav.moltchanov@KTL.FI>
Organization:   KTL (Kansanterveyslaitos)
Subject:   Re: Help with a Macro resolution problem
Comments:   To: sas-l@uga.edu
In-Reply-To:   <20050817184718.15455.qmail@web54209.mail.yahoo.com>
Content-Type:   text/plain; charset=us-ascii; format=flowed

monal kohli wrote: > Hi All, > 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; > > > > Thanks > Monal

It is not clear, what you are doing. However, there is couple of places which look like just misprints. For example, the following modification of your code does work: %MACRO PRNTRPT; %GLOBAL new; DATA _NULL_; LENGTH VAR1 VAR2 VAR3 $3; %DO J = 1 %TO 3; VAR&J= "1" || TRIM(LEFT(&J));

%let new = VAR1;

%END; RUN; %PUT _USER_;

%PUT "THE VALUE OF new IS " &new; %mend; %PRNTRPT;


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