|
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.
|