Adding Metadata Object

Reply
N/A
Posts: 0

Adding Metadata Object

Hi guys

I have to delete an object from metadata with id "Id" (from logins dataset) and create a new one with the name "TestObject".
I did like this:

data null;
length uri $256;
rc=1;
set logins;
add_uri = "omsobj:Login?@Name='TestObject'";
del_uri = "omsobj:Login?@Id='" || trim(Id) || "'";
rc = metadata_delobj(del_uri);

if(rc<0) then do;
putlog "WARNING: Cannot delete uri: " del_uri;
end;
else do;
putlog "INFO: Deleted uri: " del_uri;
* Add a new object if deletion was succsessfull
rc=metadata_newobj("Login", add_uri, Name="TestObject");
if(rc<0) then do;
putlog "WARNING: Cannot add uri: " del_uri;
end;
else do;
putlog "INFO: Added uri: " add_uri;
end;
end;
run;

but it works not like I want.
It deletes the object and creates a new one, but with name " 0" instead of "TestObject" O_o
Can please somebody explain me why?
Probably I don't understand completely which value should have URI...
SAS Super FREQ
Posts: 8,645

Re: Adding Metadata Object

Hi:
Perhaps the documentation will help:
http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_ref_10177.pdf

If the documentation doesn't help, you might consider contacting Tech Support.

cynthia
N/A
Posts: 0

Re: Adding Metadata Object

Thank you, but I have already read this, and also the second part.
I have now some thoughts... I will try and post if it will be ok.
But anyway, it could be great to hear your thoughts.
SAS Super FREQ
Posts: 8,645

Re: Adding Metadata Object

Hi:
My thoughts are that if I needed to write code to alter the metadata, I would call Tech Support for more help if my first attempt did not have the desired results. I'm very conservative --very conservative-- with the metadata. Of course, one of the reasons that I'm very conservative with the metadata is that I am the person who, with one JCL job, managed to delete the production load library out from under the queue of production jobs waiting to execute. (All because I did not check that there was a beginning comment in some code I was testing.)

Of course, that was when I was just starting out mumblety-mumble years ago in a mainframe shop. And there is a difference between a production load library and the metadata server. But you asked for my thoughts and my thoughts are that if I were at the point you're at, I would contact Tech Support. Certainly if you post your code and questions here, other folks might have some insight.

cynthia
Post a Question
Discussion Stats
  • 3 replies
  • 740 views
  • 0 likes
  • 2 in conversation