Automatic update procedure tables

Reply
Occasional Contributor
Posts: 9

Automatic update procedure tables

Hi,

I would like to develop a procedure that automatically updates the metadata tables.

The problem is the following: I have some tables where they are inserted data that could update, change or add. What procedure should I develop to make sure that when they get new data automatically part of a procedure that updates the metadata me?

Thank's a lot tion

Super User
Super User
Posts: 7,994

Re: Automatic update procedure tables

Sorry, what metadata tables?  Please provide some example test data and expected output.

Occasional Contributor
Posts: 9

Re: Automatic update procedure tables

Unfortunately I do not have a table but I can give an example. For example I have a table with two columns "id" and "value" and three raw. id I in A, B, C I value 1,2,3. Here comes a new table where you add "id" and D "value" 4. How do I update it automatically without writing it by hand.

Super User
Super User
Posts: 7,994

Re: Automatic update procedure tables

There are many ways to append data, the most straightforward one being:

proc append base=have data=new_data;

run;

Note both tables need the same variables else you would get a warning.

Occasional Contributor
Posts: 9

Re: Automatic update procedure tables

ok, but I would also for a modify. For example "ID" A, B, C, and "VALUE" 1,2,3 changes to "ID" F, B, and C "VALUE" 1,2,3

I Think

proc metalib;

  omr (library="[INSERT METADATA LIBRARY NAME HERE]" metarepository="Foundation");

  select("[INSERT TABLE NAME HERE]");

  update_rule=(delete);

  report;

run;

it's right?

Super User
Posts: 5,438

Re: Automatic update procedure tables

Sorry, but I don't follow you. Perhaps some "real life" examples are better then the id-value theoretical example?

And could you try to describe your requirement, and by doing this, try to separate the concepts of metadata stored in the SAS metadata server, application metadata/lookup data and "actual" data.

It sounds "dangerous" to automatically update SAS metadata. But if your users have the permissions to do such changes, perhaps they could also do the necessary update of metadata (in Management Console)?

Data never sleeps
Ask a Question
Discussion stats
  • 5 replies
  • 288 views
  • 0 likes
  • 3 in conversation