2013-01-10 71 views
1

我试图从SAS数据集创建Oracle表。在很多情况下,我都很成功,但是我被困在一个特定的数据集中。我正在提供下面的日志文件。我正在Linux上使用SAS 9和Oracle 11.2.0.1.0。来自SAS数据集的Oracle表

有什么建议吗?

1   libname dibsdata "/data2/dibyendu/Jan_9/on_demand/"; 
NOTE: Libref DIBSDATA was successfully assigned as follows: 
     Engine:  V9 
     Physical Name: /data2/dibyendu/Jan_9/on_demand 
2   libname myora oracle user=sasuser password=XXXXXXXXXX path=CIOEDATA ; 
NOTE: Libref MYORA was successfully assigned as follows: 
     Engine:  ORACLE 
     Physical Name: CIOEDATA 
3   data myora.on_demand; 
4    set dibsdata.on_demand; 
5   run; 

NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables. 
ERROR: Error attempting to CREATE a DBMS table. ERROR: ORACLE execute error: ORA-00904: : invalid identifier.. 
NOTE: The DATA step has been abnormally terminated. 
NOTE: The SAS System stopped processing this step because of errors. 
NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set. 
WARNING: The data set MYORA.ON_DEMAND may be incomplete. When this step was stopped there were 0 observations and 48 variables. 
ERROR: ROLLBACK issued due to errors for data set MYORA.ON_DEMAND.DATA. 
NOTE: DATA statement used (Total process time): 
     real time   0.06 seconds 
     cpu time   0.00 seconds 


ERROR: Errors printed on page 1. 
2               The SAS System       17:00 Wednesday, January 9, 2013 


NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 
NOTE: The SAS System used: 
     real time   1.24 seconds 
     cpu time   0.04 seconds 
+0

看起来像你的数据值不符合一个特定Oracle列约束的问题吗?什么是oracle错误ORA-00904? – sasfrog

+0

尝试检查原始数据集中的某些变量的名称是否为Oracle上的保留字。 – Tartaglia

回答

3

Oracle错误ORA-00904意味着你要创建一个表,一个无效的列名。很可能你有一个名称长于30个字符的SAS变量,或者是一个Oracle保留字。例如,在此SAS数据集中的两个变量在Oracle中是非法的:

data a; 
    column_name_too_long_for_oracle = 1; 
    date = today(); /* This is a reserved word */ 
run; 

这里是the Oracle 11g Reserved Words list。检查SAS数据集中的变量名称,并将其重命名为Oracle中的某些合法名称。如果举例来说,如果犯罪嫌疑人被SAS变量命名DATE,你可以试试这个:

data myora.on_demand; 
    set dibsdata.on_demand(rename=(DATE=PROJ_DATE)); 
run; 
+0

非常感谢,dperetin和Bob Duell。我发现有一个叫做“索引”的变量,另外一个变量的名字非常长。我重命名了这两个变量并解决了这个问题。问候, –