SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 24296: In SAS Enterprise Miner 5.1, how can I update the data source metadata when a new variable is added to the underlying data set?

DetailsAboutRate It

There are two ways to update the data source metadata:

1. Create a new data source. However, this is cumbersome and time-consuming, especially if you have made a lot of changes to the default metadata.

2. Use the %EmAdviseColumns and %EmAdviseTable macros to refresh the metadata.

Note: It's always a good idea to back up the data sources folder before updating the metadata.

In the SAS Enterprise Miner program editor, submit the following code:

%EmAdviseColumns(dataset=data-set-name,outdata=emds.datasource-id_CM,
     newdataflag=N);

%EmAdviseTable((dataset=data-set-name,outdata=emds.datasource-id_TM,
    newdataflag=N);

The %EmAdviseColumns macro builds the column metadata (column names, variable roles, etc.), while the %EmAdviseTable macro builds the table metadata (number of rows, number of columns, etc.). The arguments of both macros are as follows:

dataset: name of the data set that is associated with the data source
outdata: name of the data set that contains the generated information
newdataflag: indicates whether a new metadata table should be created. When you set this argument to N, it will use the existing information as a base.

In order for the data source to be refreshed, make sure that the outdata is created in the EMDS library. The data source ID can be retrieved by viewing the ID property on the property sheet of that data source. For example, for the Fisher-Anderson Iris data source the ID is FISHERANDERSONIRIS. The outdata for the columns metadata is EMDS.FISHERANDERSONIRIS_CM, and the outdata for the table metadata is EMDS.FISHERANDERSONIRIS_TM. Here is the code to refresh that metadata:

%EmAdviseColumns(dataset=sampsio.dmairis,
        outdata=emds.FISHERANDERSONIRIS_CM, newdataflag=N);

%EmAdviseTable(dataset=sampsio.dmairis,outdata=emds.FISHERANDERSONIRIS_TM,
        newdataflag=N);
    run;

Note: This refreshes the data source metadata but has no effect on existing data source nodes in the diagram. For the updated metadata to be reflected in the diagram, you must replace the existing data source node.

In SAS Enterprise Miner 5.2, it is no longer necessary to write code to refresh the metadata. The option to refresh metadata has been added to the choices of data source actions. Simply right-click the data source that you want to update, and select Refresh Metadata.

However, as in SAS Enterprise Miner 5.1, this refreshes the data source metadata and has no effect on existing data source nodes in the diagram. In order for the updated metadata to be reflected in the diagram, you must replace the existing data source node.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS Enterprise MinerAlln/a
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.