我用的是sas9.2版本,在编辑器中执行下面的脚本导入没有任何问题.
LIBNAME collect ORACLE USER='collect' PASSWORD='collect' PATH='insure';
proc delete data=collect.test8;
run;
data COLLECT.test8;
infile "E:\宜保工作内容\原始数据\银业一部\银业一部\合作方发来文件\20130202policy.txt" firstobs=2 DLM='09'X DSD missover LS=2048;
length planid $20.;
length source 3.;
length local 3.;
length orderid $15.;
length insuredname $20.;
length insuredsex 3.;
length insuredbirth $10.;
length insuredidtype 3.;
length insuredid $18.;
length insuredadress $100.;
length insuredcompany $2.;
length insuredcompanytype $2.;
length insuredcareer $3.
length insuredzipcode $6.;
length insuredtelofday $15.;
length insuredtelofnight $15.;
length insuredmobilphone $15.;
length insuredmarried $2.;
length insuredstature $2.;
length insuredweight $2.;
length insuredemail $2.;
length insuredincome $2.;
length insurername $20.;
length insurersex 3.;
length insurerbirth $10.;
length insuredrelat $2.;
length insureridtype 3.;
length insurerid $18.;
length insureradress $100.;
length insurerzipcode $6.;
length insurertelofday $15.;
length insurercompany $80.;
length insurercareer $2.;
length insurermobilphone $15.;
length insurertelofnight $15.;
length insurermarried $2.;
length insurerstature $2.;
length insurerweight 3.;
length insureremail $2.;
length insurerincome 3.;
length addtype 3.;
length address $2.;
length addmail $2.;
length planname 8.;
length partitionprice 6.;
length paymode 6.;
length pay1 6.;
length pay2 3.;
length questioncode $2.;
length questionmemo $2.;
length bank $10.;
length cardno $20.;
length ordertime $19.;
length ordername $20.;
length orderlogin 5.;
length MEMO $50;
length OtherMemo $2.;
length Zblank 3.;
length PPP $2.;
length ProjectID $7.;
length Delivery0Date $10.;
length Delivery0Time $10.;
;
input planid $ source local orderid $ insuredname $ insuredsex insuredbirth $ insuredidtype insuredid $ insuredadress $ insuredcompany $ insuredcompanytype $ insuredcareer $ insuredzipcode $ insuredtelofday $ insuredtelofnight $ insuredmobilphone $ insuredmarried $ insuredstature $ insuredweight $ insuredemail $ insuredincome $ insurername $ insurersex insurerbirth $ insuredrelat $ insureridtype insurerid $ insureradress $ insurerzipcode $ insurertelofday $ insurercompany $ insurercareer $ insurermobilphone $ insurertelofnight $ insurermarried $ insurerstature $ insurerweight insureremail $ insurerincome addtype address $ addmail $ planname partitionprice paymode pay1 pay2 questioncode $ questionmemo $ bank $ cardno $ ordertime $ ordername $ orderlogin MEMO $ OtherMemo $ Zblank PPP $ ProjectID $ Delivery0Date $ Delivery0Time $;
drop length;
run;
但我用bat调用sas脚本执行同样的脚本时,则报错。错误日志如下:
1 SAS 系统 2008年07月02日 星期三 下午02时06分21秒
NOTE: 版权所有 (c) 2002-2008 SAS Institute Inc., Cary, NC, USA。
NOTE: SAS (r) Proprietary Software 9.2 (TS1M0 DBCS3055)
许可给 UNIVERSITY OF NOTRE DAME - T&R 使用,软件安装点: 0070009309。
NOTE: 该会话正在执行,平台: XP_PRO
NOTE: “SAS 初始化”所用时间:
实际时间 0.78 秒
CPU 时间 0.34 秒
1 LIBNAME collect ORACLE USER='collect' PASSWORD=XXXXXXXXX PATH='insure';
NOTE: 已成功分配逻辑库引用名 COLLECT,如下所示:
引擎: ORACLE
物理名: insure
2 proc delete data=collect.test8;
3 run;
WARNING: 文件“COLLECT.TEST8.DATA”不存在。
NOTE: “PROCEDURE DELETE”所用时间(总处理时间):
实际时间 0.03 秒
CPU 时间 0.00 秒
4 data COLLECT.test8;
5 infile "E:\宜保工作内容\原始数据\银业一部\银业一部\合作方发来文件\20130202policy.txt" firstobs=2 DLM='09'X DSD missover
5 ! LS=2048;
6 length planid $20.;
7 length source 3.;
8 length local 3.;
9 length orderid $15.;
10 length insuredname $20.;
11 length insuredsex 3.;
12 length insuredbirth $10.;
13 length insuredidtype 3.;
14 length insuredid $18.;
15 length insuredadress $100.;
16 length insuredcompany $2.;
17 length insuredcompanytype $2.;
18 length insuredcareer $3.
19 length insuredzipcode $6.;
20 length insuredtelofday $15.;
21 length insuredtelofnight $15.;
22 length insuredmobilphone $15.;
23 length insuredmarried $2.;
24 length insuredstature $2.;
25 length insuredweight $2.;
26 length insuredemail $2.;
27 length insuredincome $2.;
28 length insurername $20.;
29 length insurersex 3.;
30 length insurerbirth $10.;
31 length insuredrelat $2.;
32 length insureridtype 3.;
33 length insurerid $18.;
34 length insureradress $100.;
35 length insurerzipcode $6.;
36 length insurertelofday $15.;
37 length insurercompany $80.;
38 length insurercareer $2.;
39 length insurermobilphone $15.;
40 length insurertelofnight $15.;
41 length insurermarried $2.;
42 length insurerstature $2.;
43 length insurerweight 3.;
44 length insureremail $2.;
45 length insurerincome 3.;
46 length addtype 3.;
47 length address $2.;
48 length addmail $2.;
49 length planname 8.;
50 length partitionprice 6.;
51 length paymode 6.;
52 length pay1 6.;
53 length pay2 3.;
54 length questioncode $2.;
55 length questionmemo $2.;
56 length bank $10.;
57 length cardno $20.;
58 length ordertime $19.;
59 length ordername $20.;
60 length orderlogin 5.;
61 length MEMO $50;
62 length OtherMemo $2.;
63 length Zblank 3.;
64 length PPP $2.;
65 length ProjectID $7.;
66 length Delivery0Date $10.;
67 length Delivery0Time $10.;
68 ;
WARNING: 截断的记录。
69 input planid $ source local orderid $ insuredname $ insuredsex insuredbirth $ insuredidtype insuredid $ insuredadress $
69 ! insuredcompany $ insuredcompanytype $ insuredcareer $ insuredzipcode $ insuredtelofday $ insuredtelofnight $
69 ! insuredmobilphone $ insured
70 drop length;
71 run;
NOTE: 变量 insuredmarried 未初始化。
NOTE: 变量 insuredstature 未初始化。
NOTE: 变量 insuredweight 未初始化。
NOTE: 变量 insuredemail 未初始化。
NOTE: 变量 insuredincome 未初始化。
NOTE: 变量 insurername 未初始化。
NOTE: 变量 insurersex 未初始化。
NOTE: 变量 insurerbirth 未初始化。
NOTE: 变量 insuredrelat 未初始化。
NOTE: 变量 insureridtype 未初始化。
NOTE: 变量 insurerid 未初始化。
NOTE: 变量 insureradress 未初始化。
NOTE: 变量 insurerzipcode 未初始化。
NOTE: 变量 insurertelofday 未初始化。
NOTE: 变量 insurercompany 未初始化。
NOTE: 变量 insurercareer 未初始化。
NOTE: 变量 insurermobilphone 未初始化。
NOTE: 变量 insurertelofnight 未初始化。
NOTE: 变量 insurermarried 未初始化。
NOTE: 变量 insurerstature 未初始化。
NOTE: 变量 insurerweight 未初始化。
NOTE: 变量 insureremail 未初始化。
NOTE: 变量 insurerincome 未初始化。
NOTE: 变量 addtype 未初始化。
NOTE: 变量 address 未初始化。
NOTE: 变量 addmail 未初始化。
NOTE: 变量 planname 未初始化。
NOTE: 变量 partitionprice 未初始化。
NOTE: 变量 paymode 未初始化。
NOTE: 变量 pay1 未初始化。
NOTE: 变量 pay2 未初始化。
NOTE: 变量 questioncode 未初始化。
NOTE: 变量 questionmemo 未初始化。
NOTE: 变量 bank 未初始化。
NOTE: 变量 cardno 未初始化。
NOTE: 变量 ordertime 未初始化。
NOTE: 变量 ordername 未初始化。
NOTE: 变量 orderlogin 未初始化。
NOTE: 变量 MEMO 未初始化。
NOTE: 变量 OtherMemo 未初始化。
NOTE: 变量 Zblank 未初始化。
NOTE: 变量 PPP 未初始化。
NOTE: 变量 ProjectID 未初始化。
NOTE: 变量 Delivery0Date 未初始化。
NOTE: 变量 Delivery0Time 未初始化。
NOTE: SAS 变量标签、格式和长度并未写入 DBMS 表。
NOTE: Infile "E:\宜保工作内容\原始数据\银业一部\银业一部\合作方发来文件\20130202policy.txt" 是:
文件名=E:\宜保工作内容\原始数据\银业一部\银业一部\合作方发来文件\20130202policy.txt,
RECFM=V,LRECL=2048,文件大小(字节)=12762,
末次修改时间=2013年04月18日 17时55分01秒,
创建时间=2013年04月18日 15时13分11秒
ERROR: 试图创建 DBMS 表时出错。 ERROR: ORACLE execute error: ORA-00904: : 标识符无效.。
NOTE: DATA 步已异常终止。
NOTE: 从 Infile "E:\宜保工作内容\原始数据\银业一部\银业一部\合作方发来文件\20130202policy.txt" 中读取了 0 条记录。
NOTE: SAS 系统由于错误而停止了该步的处理。
NOTE: SAS 设置选项 OBS=0,并将继续检查语句。 这可能导致出现“NOTE: 数据集中没有观测”消息。
WARNING: 数据集 COLLECT.TEST8 可能不完整。该步停止时,共有 0 个观测和 65 个变量。
ERROR: 由于数据集 COLLECT.TEST8.DATA 错误,发出了 ROLLBACK。
NOTE: “DATA 语句”所用时间(总处理时间):
实际时间 0.06 秒
CPU 时间 0.01 秒
72
ERROR: 在以下页码上出现打印错误: 1.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: “SAS 系统”所用时间:
实际时间 10.82 秒
CPU 时间 0.45 秒