楼主: 聊复尔耳
3504 4

[统计软件与数据分析] 一个简单sas的EM软件基础问题,创建数据源时报错 [推广有奖]

  • 0关注
  • 0粉丝

高中生

37%

还不是VIP/贵宾

-

威望
0
论坛币
387 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
3682 点
帖子
5
精华
0
在线时间
52 小时
注册时间
2016-5-4
最后登录
2025-2-4

楼主
聊复尔耳 发表于 2017-3-24 18:42:14 来自手机 |AI写论文
120论坛币
在添加了启动代码后(libname 和路径后)依然报错如下:“无法定位该表的sas格式,请确保格式搜索路径中列出了这些格式的位置 您可以将该代码添加zhi项目启动代码中。”
然而!我启动代码里添加了该数据源的libname了,为何依然如此?同样该路径下,另一个文件就ok没问题,但就是这个文件,死活报这个错,增减变量都不行。

关键词:sas的 数据源 libname name lib

沙发
Newkoarla 发表于 2017-3-24 20:41:05
not sure what exact the problem is since you didn't provide the library info, but you can try:
1. reformat the library

libname mydir "catalog directory";
libname mylibrary (mydir);
proc format library=mylibrary cntlin=mydir.myformats;
run;

or

2. export the library then import the library

libname project "catalog directory";
filename outfile "temp location/cport file.cpt";
proc cport library=project file=outfile;
run;

Good luck!

藤椅
聊复尔耳 发表于 2017-3-25 11:22:15 来自手机
Newkoarla 发表于 2017-3-24 20:41
not sure what exact the problem is since you didn't provide the library info, but you can try:
1. r ...
谢谢,大神,我的启动代码是libname datasamp "/Workspace/Sas/data_samp";而且我通过在新建里面建逻辑库也把该路径命名为samp了。
以前用过EM,都是work的。这次,能打开其他的数据源,但就我想用的这个打不开。
同目录下有多个文件,文件1和文件2都能通过“创建数据源”来引入打开,就我这个文件3会报错,但是文件格式都是sas的data文件。我现在感觉是不是和启动代码的路径无关呢?
对文件有要求吗?我文件名sta,文件里就俩变量,appl_type_cd 和lgd,format一个是字符,一个是w8.4的数值型

板凳
sonypam 在职认证  发表于 2017-3-26 10:43:20
It may be related to variable formatting of your raw data, so add one line of code below at the head of your program and try again, good luck!

option nofmterr;

报纸
wfykhgmqtdh 在职认证  发表于 2017-10-31 06:10:55
When creating a data source in SAS® Enterprise Miner™, you might receive the following error:
Advisor Error: SAS Formats for this table could not be located.
Make sure their location is in the format search path.
You can add this code to the project start-up code.
The problem occurs if formats (or informats) are assigned to variables in the data set, and those formats are not available to SAS Enterprise Miner. (Note that specifying the SAS option NOFMTERR in the Project Start Code does not correct the problem.)
To circumvent the problem, either point to the location of the formats (or informats), or disassociate the formats (or informats) from the data.



Point to the location of the formats. In the Project Start Code, add a LIBNAME statement to allocate the format library. Add an OPTIONS statement to specify a FMTSEARCH= search path that points to the library that you just allocated.  To access the Project Start Code, click the project name in the project panel (upper left corner of the user interface).  Then, click Project Start Code in the properties panel (middle left).

Example:

libname mylibrary "c:\my_format_library";
options fmtsearch=(mylibrary work library);

Disassociate the format (or informat). One reason to disassociate is that you no longer have access to the format catalog. You can remove the format (or informat) from the variable in that data set using PROC DATASETS.

Example:


proc datasets lib=mylibrary;
    modify mydata;
   format myvariable;
   informat myvariable;
   quit;
In the above example, the format (and informat) is removed only from the variable MYVARIABLE. All other variables maintain their format (and informat). You can also specify FORMAT _ALL_ within DATA step code to remove formats from all variables in the data set. FORMAT _ALL_ removes not only user-defined formats, but also removes SAS specific formats (such as date formats). Likewise, you can specify INFORMAT _ALL_.

Example:

data mylibrary.mydata;
   set mylibrary.mydata;
   format _all_;
   informat _all_;
   run;

For more information about formats, see Base SAS documentation.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2026-1-7 01:15