【发布时间】:2017-11-30 11:50:08
【问题描述】:
以下代码检查系统中所有可用驱动器的空间。我怎样才能让它只打印关于 G: 驱动器的信息,它也是一个网络驱动器?并以千兆字节而不是字节打印?谢谢:)
%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;
title1 "Available space in G: drive, if there is less than 1GB available, please contact the team";
proc print data=work.property noobs;
run;
title; footnote;
title1 "There is less than 1GB available, please contact the BA team";
proc print data=work.property;
var PROPERTY_NAME value;
WHERE instance_ordinal=(4);
/*where property_name='FreeSpace';*/
run;
title; footnote;
【问题讨论】:
-
你能编辑你的帖子吗?在每行的开头放置四个空格,以便正确呈现。您的一些 * 运算符变成了文本格式。
-
刚刚做了,希望现在能用。
-
拥有预览窗口的全部意义在于您可以在发布前检查降价是否有效。那没有。空格需要在行的开始,而不是在数字和代码之间。
-
我明白了,但现在可以了吗?
标签: sas