Date: Fri, 10 May 2002 18:50:56 -0400
Reply-To: "Michael S. Zdeb" <msz03@HEALTH.STATE.NY.US>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Michael S. Zdeb" <msz03@HEALTH.STATE.NY.US>
Subject: File Size
Content-type: text/plain; charset=us-ascii
Hi. I have not seen any responses posted to the question of how to get the
size of a file. So, it's late Friday and I gave it a try and get correct
answers (SAS on a Windows 98-based PC). Is there a real easy way that I've
missed...
options noxwait mprint;
%macro howbig(file);
data bytes (keep=filename filesize);
retain filename "&file";
if _n_ eq 1 then do;
x 'del c:\info.txt';
x "dir &file > c:\info.txt";
end;
infile 'c:\info.txt';
input;
if index(_infile_,'bytes') ne 0 then do;
filesize=input(scan(_infile_,-2,' '),comma20.);
output;
stop;
end;
run;
proc print data=bytes;
run;
%mend;
%howbig(c:\windows\win.com);
%howbig(c:\config.sys);
%howbig(c:\windows\system\wsock.vxd);
Mike Zdeb
New York State Department of Health
ESP Tower - Room 1811
Albany, NY 12237
P/518-473-2855 F/630-604-1475
|