Tazz:
, SAS Windows. Piping wmic SAS , .
WMIC - Windows;
https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx;
%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 _null_;
set diskinfo;
if freespace < 1e9 then put "WARNING: " name "has remaining" freespace=;
run;
wmic XML - , . SAS xmlv2 automap=:
* WMIC - Using Windows Management Instrumentation Command-line;
* https:
%let xmldata = %sysfunc(pathname(work))\wmic_output.xml;
%let xmlautomap = %sysfunc(pathname(work))\wmic_output-automap.xml;
%let xmlmap = %sysfunc(pathname(work))\wmic_output-map.xml;
filename wmic "&xmldata" encoding="utf-16";
filename wmicmap "&xmlmap";
filename gather pipe "wmic logicaldisk get name,size,freespace /format:rawxml > ""&xmldata""";
data _null_;
infile gather;
input;
put _infile_;
rc = sleep(.1,1);
run;
libname wmic xmlv2 automap=replace xmlmap=wmicmap;
proc copy in=wmic out=work;
run;
proc transpose data=work.property out=properties(drop=_name_) suffix=_text;
by instance_ordinal;
id property_name;
var value;
run;
filename gather;
filename wmic;
filename wmicmap;