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 (February 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 14 Feb 2006 01:45:29 -0800
Reply-To:     easwara@GMAIL.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         easwara@GMAIL.COM
Organization: http://groups.google.com
Subject:      Macro LET statement equivalent of Call Symput;
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset="iso-8859-1"

Hi ,

I have a problem in the following code. I need to create dynamic libname statements like the following:

libname admin200201 'd:\vfs\store\200201'; /* These are existing folders */ libname admin200202 'd:\vfs\store\200202'; libname admin200203 'd:\vfs\store\200203'; .... ... .. libname admin200201 'd:\vfs\store\200312';

When I execute the code, the macro variable YM , is not resolved in the first run, as I've used call symput, which effectively creates the YM variable after the datastep execution. How do I convert the CALL SYMPUT STEP into a legal %let statement , so that I create the variable before I create my Libname statment. Am I right in finding this issue or is there any other error in the macro logic? :(

Thanks Moorthy

/* Code */

%global ym; options mprint mlogic symbolgen; %macro t(sy=,ey=,sm=,em=); /*%let month=&mon;*/ %do i=&sy %to &ey; %do j=&sm %to &em; data _null_; call symput('ym',substr(put(intnx('year','01jan01'd,&i),ddmmyy10.),7,4)!! trim(left(trim("0")||left(trim(&j))))); %let lib=libname admin&ym "d:\vfs\store\&ym"; %put &lib; %end; %end; run;

%mend t;

%t(sy=1,ey=2, sm=1, em=12);


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