Reputation: 2967
I know that the finfo function in SAS returns filesize as one of the info fields in Unix. Is there an equivalent in Windows?
I need to be able to get the total disk space used in a particular folder from within SAS/AF code. Any suggestions would be welcome.
Thanks,
-- A
Upvotes: 4
Views: 4742
Reputation: 2967
I'm going to do something crufty and write a utility function that does the following:
Note that this is ok for me only because my requirements are to be able to get the size of a particular file.
Upvotes: 0
Reputation: 8513
If you have SAS version 9.2 or later then this link will work regardless of OS:
http://support.sas.com/kb/38/267.html
Here is a paraphrased version of the link answering your question exactly:
%let filename = d:\sasdev\autoexec.sas;
data info;
length filesize $60;
drop rc fid close;
rc=filename("myfile","&filename");
fid=fopen("myfile");
filesize=finfo(fid,"File Size (bytes)");
close=fclose(fid);
put filesize=;
run;
Cheers Rob
PS - Have you checked out www.runsubmit.com? It's just like StackOverflow but for SAS related questions only.
Upvotes: 2