An error can occur with SAS® Data Integration Studio jobs and tables after you change foreign key definitions for tables registered in the metadata and update the table metadata.
For example, this issue occurs when you complete steps similar to the following:
This issue occurs in SAS® 9.4M7 (TS1M7) and later. This issue might be applicable to all SAS®9 engines.
Note that errors do not occur when you run PROC METALIB or when you update the table metadata. Instead, the error is flagged on the job and the tables in the jobs after you update the table metadata.
When this issue occurs, hovering over an affected table displays an error message similar to the following:
In addition, the Keys tab on the table properties displays a dialog box with the following error message (which is for the original key):
The dialog box asks if you want to delete the key. Select Yes to delete the (original) key, which clears the error.
This issue occurs when you change a foreign key without first deleting it, which causes an orphaned foreign key definition.
This definition will not be cleaned up by the metadata analysis or repair process.
You can circumvent the error on a table-by-table basis by completing the following steps:
See the delete_unassociated_foreign_keys.sas program.
Customize the Options statement in this program to point to your SAS Metadata Server and connect as sasadm@saspw.
In addition, there is a macro variable set to run this program in a report-only mode (%let MODE=REPORT;), or you can perform the actual deletion (%let MODE=DELETE;).
When you run this program, it finds all of the affected foreign keys and reports them to the SAS log. If you specify %let MODE=DELETE;, the affected foreign keys are deleted from metadata.