Hi, I'm trying to set up some basic disk space monitoring for our SAS Studio users (SAS version 9.04.01M6P110718). Below I've copied the code which checks the free space on the server disk and outputs it using proc print. It works fine, but I would like to include it in autoexec for each user to see when they log into SAS Studio. I copied the code into "Edit Autoexec File" window and tried to reset my sas session. The code worked except the proc print. I can see the tables created in the work library, but no printed results appear. - Why is proc print not working in autoexec, is there a solution for that? - How can I include this code in autoexec for all users, not just myself? Thanks %let csvdata = %sysfunc(pathname(work))\wmic_output.csv;
filename wmic_csv "&csvdata" encoding="utf-16";
filename gather pipe "wmic logicaldisk get name,size,freespace /format:csv";
* process the wmic command and strip off blank first row and extraneous CR character at end of line;
data _null_;
infile gather;
input;
if _n_ > 1;
_infile_ = compress(_infile_, '0d'x);
file wmic_csv;
put _infile_;
run;
proc import replace out=diskinfo file=wmic_csv dbms=csv;
run;
data diskinfo2 (keep=space free pct_free);
set diskinfo;
where name='D:';
freespace=freespace/1024/1024/1024;
size=size/1024/1024/1024;
space=put(size,4.)!!' GB';
free=put(freespace,4.)!!' GB';
format pct_free percent10.;
pct_free=freespace/size;
run;
proc print data=diskinfo2;
run;
... View more