在日常实际中常有一些琐碎、庞大、有害时间的工作要做,并且那帮贪官污吏为了显示权威,又不定时抽查、发难。
根据使用SAS经验可知,这样类型事件基本都可以编程实现。
已知SAS通过file过程可将内部文件转换为外部文件。
但是用put输出的外部文件都没有标题。
请问哪位老兄有解决经验,谢谢。
[此贴子已经被作者于2008-7-2 20:57:02编辑过]
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
"HEADER=" option or TITLE option in FILE statement?
I do not understand LZ's question either. Could you please give an example?
例如:根据D盘存在的两个文件
按要求编程(可根据实际情况修改)
data a;infile 'd:\sj\xe.txt';length x4 $ 6. x5 $ 6. x9 $ 6.;x12='已巡视';drop x6;input x3-x10;do x1=5 to 8;/*从5月份开始 8月10号左右结束*/do x2=1 to 31;/*每月日期*/if x1=5 & x2<3 then continue;/*5月份从3号开始*/if x1=6 & x2=31 then continue;/*6月份不存在31号*/if x1=8 & x2>=10 then delete;/*超过当前月份、日期删除*/x11=36.5+5*normal(0);format x11 4.1;output;end;end;proc sort;by x3 descending x7;/*组别增序,生日降序*/run;data c;infile 'd:\sj\xe2.txt';input x3 x4 $ x5 $ x7 x8 x9 $;data b;set c a;/*转换过程完成*/file ' C:\Documents and Settings\Administrator.LENOVO-760B6594\桌面\石家村某种工作调查资料.doc';/*doc|txt*/if x10= 5856012 & x1=6 & x2>=22 & x2<=31 | x10= 5856012 & x1=7 & x2<=4 then x12='现症';put x1 x2 x3 x4 $ x5 $ x7 x8 $ x9 $ x10 x11 $ x12 $;label x1='月份' x2='日期' x3='组别' x4='丈夫姓名' x5='妻子姓名' x6='孩次' x7='出生年月' x8='性别 (1男 2女)' x9='子女姓名' x10='联系电话' x11='参数';proc print data=b label noobs n='钻晕';run;
我要问的是把 title '石家村某种工作调查资料';安置在何处?能成为输出文件“石家村某种工作调查资料.doc”的标题。
在指针为1时多输出一次就好了. 例如数据已经准备好啊 info中.
data _null_;
set info;
file "yourfilepathandname.txt";
if _n_=1 then put '石家村某种工作调查资料';
put yourvarlist;
run;
感谢wolfcrying先生!很好的解决了这个问题。
敬佩! 敬佩! 敬佩!