I am trying to delete an XLSX file on the unix server and getting error messages. Below is my code. How can I delete this file in SAS EG? I need code to do this. Below are the error messages that I am getting.
filename myfile "/server/department/users/id/test/POP_ID.xlsx";
data _null_;
rc=fdelete("myfile");
run;
filename myfileclear;
ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.
答案 0 :(得分:2)
我认为该错误与您的最后一个文件名语句有关,其中ref的长度超过8个字符,并且清除会碰到文件名。我怀疑您是否添加空格就可以了。
filename myfileclear;
应该是:
filename myfile clear;
答案 1 :(得分:0)
这对我有用。我删除了文件名myfileclear;。
%let outdir=/server/department/users/id/test;
filename myfile "&outdir/POP_ID.xlsx";
data _null_;
rc=fdelete("myfile");
run;
proc export DATA=OUT1.POP_ID_5C
OUTFILE= "&outdir/POP_ID.xlsx"
DBMS=xlsx REPLACE ;
SHEET = "POP_ID";
proc export DATA=OUT1.REQ_1_4_04T1
OUTFILE= "&outdir/POP_ID.xlsx"
DBMS=xlsx REPLACE ;
SHEET = "REQ_1_4";