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

Dear all,

I have a situation where the "physical table metadata" (output of proc contents) are poorer than the "metadata server metadata" (metadata visible through e.g. DI Studio) so we would like to update the "physical metadata" based on the "server metadata" - the opposite of (as I understand) what PROC METALIB does. Any ideas 🤔?

Many grateful TIA

Anne.

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

Unfortenately there is no functionality OOTB to enforce metadata attributes to an existing table.

So this has to be managed more or less manually. I can imagine that there are some utility scripts out there, if you are lucky someone might share it.

The manual way is to use PROC DATASETS (for formats and labels). If your table has a Table Loader step, you can copy paste part of the code from there.

If the table structure has changed in other ways (data types/lengths, dropped/added/renamed columns) the table has to be recreated. In this case I would defintely go for a manually and controlled process - change/release management.

 

Question is how big the problem is.

If user access the libnames assigned by the server, most applications use metadata attributes in UI at least.

Data never sleeps

View solution in original post

3 REPLIES 3
LinusH
Tourmaline | Level 20

Unfortenately there is no functionality OOTB to enforce metadata attributes to an existing table.

So this has to be managed more or less manually. I can imagine that there are some utility scripts out there, if you are lucky someone might share it.

The manual way is to use PROC DATASETS (for formats and labels). If your table has a Table Loader step, you can copy paste part of the code from there.

If the table structure has changed in other ways (data types/lengths, dropped/added/renamed columns) the table has to be recreated. In this case I would defintely go for a manually and controlled process - change/release management.

 

Question is how big the problem is.

If user access the libnames assigned by the server, most applications use metadata attributes in UI at least.

Data never sleeps
Anne_A
Quartz | Level 8
ENORMOUS Thanks @LinusH!
AllanBowe
Barite | Level 11

You could use this macro to create an empty dataset using the metadata definition:  https://core.sasjs.io/mm__createdataset_8sas.html

 

Then find some way to append the data into it.  Perhaps by using this macro to export: https://core.sasjs.io/mp__ds2csv_8sas.html

 

You could then use a tool such as https://datacontroller.io to do the import (drag & drop the CSV back into the new table definition).  Feel free to get in touch if you need assistance, we built the tool.

 

/Allan
MacroCore library for app developers
Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1497 views
  • 2 likes
  • 3 in conversation