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
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 288 views
  • 2 likes
  • 3 in conversation