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