《SAS编程和数据挖掘商业案例》第14部分学习笔记
继续《SAS编程与数据挖掘商业案例》学习笔记系列,本次重点:经常使用全程语句
所谓全程语句。是指能够用在不论什么地方的sas语句,既能够用在data数据步语句里面,也能够用在proc过程步里面,甚至能够单独使用,本次仅仅针对商业应用中经常使用的语句进行总结:
1.comments语句
形式有两种:
*comment
也能够用快捷方式:ctrl ?,取消comments能够用ctrl shit ?
2.filename语句
经常使用的语句:
Filename out "f:data_modelook_data est1.txt";
Filename fileref
Filename fileref
Eg:
发送程序执行结果到email
filename outbox email
ods html body=outbox ;
title 'Here is title';
proc print data=sashelp.class;
run;
ods html close;
发送带附件的email
ods listing close;
ods html
file='test.html';
proc univariate data=sashelp.class;
class sex;
var weight;
histogram;
run;
ods html close;
ods listing;
filename outbox email ("name1@company.com" "name2@company.com");
data _null_;
run;
抓取某个网页的源码:
filename ws url "http://www.sas.com";
data sas;
infile ws length=len lrecl=4000;;
input record $varying4000. len;
run;
3.include语句
%include "f:data_model est1.txt";
Eg:一次调入多个sas程序
filename sasf "f:data_modelook_datachapt8";
%include sasf(inc.sas,inc2.sas);
版权声明:本文博主原创文章,博客,未经同意不得转载。