Date: Wed, 13 Jul 2005 21:38:20 -0700
Reply-To: shiling99@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: shiling99@YAHOO.COM
Organization: http://groups.google.com
Subject: Re: Passing a dynamic variable to a macro
In-Reply-To: <1121304937.688593.105240@g47g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
Take it easy and take a easy way. Run the pgm twice and take look the
log and modify slightly.
data file_loc;
length i $2 filepath $50;
file 'c:\temp\file_loc.txt';
do i = '1','10','15';
filepath='c:\temp\'||i;
fdate=put(100*input(i,2.),mmddyy10.);
put filepath fdate;
end;
run;
options noxwait;
data _null_;
length filepath $50 fdate 8 cmd $100;
infile 'c:\temp\file_loc.txt';
input filepath fdate mmddyy10.;
if fileexist(filepath) then do;
put 'file location ' filepath 'exist.' ;
end;
else do;
cmd=cat('md ', trim(filepath),'\',put(fdate,yymmdd8.));
put cmd;
call system(cmd);
end;
run;
|