BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Fibo1123
Calcite | Level 5

I am trying to automate a model-creation process in SAS Enterprise Miner, meaning I can enter a variable as "ABC", click run and it will query appropriate data, build the models, and the final step of the flow is to register the new model on the Metadata Server by name. Let's call it "Model ABC".

 

This process works well, but the problem is that if I run this flow again, a new "Model ABC" is registered to the Metadata Server, in addition to the previously-created "Model ABC"s. So, if I look at the Metadata Server using the Management Console, I can see both "Model ABC" objects.  SAS doesn't overwrite registered models even if they are identically-named. If I right-click on their properties, both models have identical properties with the exception of:
     ModelKey
     MetadataUpdated
     MetadataCreated
     Id

This model-creation flow will be run frequently going forward for a wide range of input values (in addition to "ABC"), so I would like to avoid a massive builduip of identically-named models by deleting (via SAS Code node?) all models with name="Model ABC" from the Metadata Server prior to registering the model via the Register Model node.

I know that models can programmatically be registered to the server via this macro:
SAS Help Center: %AA_Model_Register Autocall Macro

But the only options I have been able to find for deleting a registered model is via the SAS EM or Management Console GUI:
SAS Help Center: SAS Enterprise Miner Model Package Registration

Does anyone know of a way to programmatically delete models from the Metadata Server? 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

You could use the DATA step functions for reading and writing SAS metadata, but you would have to unpick the metadata data model to find and then delete the appropriate metadata. Please be aware that the possibility of corrupting your metadata repository is high when trialling updates. It is good practice to frequently take metadata backups and restore from these if you have problems.

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

You could use the DATA step functions for reading and writing SAS metadata, but you would have to unpick the metadata data model to find and then delete the appropriate metadata. Please be aware that the possibility of corrupting your metadata repository is high when trialling updates. It is good practice to frequently take metadata backups and restore from these if you have problems.

Fibo1123
Calcite | Level 5
Thank you for the information. That was exactly what I was looking for.

I will read everything carefully before I think about modifying the metadata repository. Thank you for the warning.
SASKiwi
PROC Star

The Metadata Browser (invoke with the metabrowse command) in the SAS Windowing Environment is particularly useful for navigating the data structures:

SASKiwi_0-1752802834164.png

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 438 views
  • 0 likes
  • 2 in conversation