2

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

有什么建议么?

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
4

1 回答 1

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;

这是Oracle 11g 保留字列表。检查 SAS 数据集中的变量名称,并将它们重命名为 Oracle 中的合法名称。例如,如果违规者是名为DATE的 SAS 变量,您可以尝试以下操作:

data myora.on_demand;
   set dibsdata.on_demand(rename=(DATE=PROJ_DATE));
run;
于 2013-01-10T14:19:43.353 回答