1、导出txt 或 csv 文件:
proc export data = work.data_&month
outfile = "F:\数据支撑\TEST_&month..txt"
dbms = dlm;
delimiter = '09'x;
run;
sp:delimiter = '09'x 为设置分隔符,此处分隔符为tab
2、导出到excel
proc export data = work.data_&month
outfile = "F:\数据支撑\TEST_&month..xlsx"
dbms = xlsx replace;
sheet = 'sheet1' ;
run;
sp: replace 选项:替换已有文件;
注:一般后缀名就决定了导出文件的格式,也可以通过 dbms =选项 来指定;
eg:
DBMS = 选项
若输出CSV文件,则DBMS=CSV;
若输出txt文件,则DBMS=TAB;
若输出spaced-delimited文件,DBMS=DLM