<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding Metadata Object in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21168#M986</link>
    <description>Hi:&lt;BR /&gt;
  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.) &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Wed, 28 May 2008 15:27:22 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2008-05-28T15:27:22Z</dc:date>
    <item>
      <title>Adding Metadata Object</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21165#M983</link>
      <description>Hi guys&lt;BR /&gt;
&lt;BR /&gt;
I have to delete an object from metadata with id "Id" (from logins dataset) and create a new one with the name "TestObject".&lt;BR /&gt;
I did like this:&lt;BR /&gt;
&lt;BR /&gt;
data null;&lt;BR /&gt;
               length uri $256;&lt;BR /&gt;
           rc=1;&lt;BR /&gt;
               set logins;&lt;BR /&gt;
               add_uri = "omsobj:Login?@Name='TestObject'";&lt;BR /&gt;
               del_uri = "omsobj:Login?@Id='" || trim(Id) || "'";&lt;BR /&gt;
               rc = metadata_delobj(del_uri);&lt;BR /&gt;
&lt;BR /&gt;
               if(rc&amp;lt;0) then do;&lt;BR /&gt;
                       putlog "WARNING: Cannot delete uri: " del_uri;&lt;BR /&gt;
               end;&lt;BR /&gt;
               else do;&lt;BR /&gt;
                       putlog "INFO: Deleted uri: " del_uri;&lt;BR /&gt;
                       * Add a new object if deletion was succsessfull &lt;BR /&gt;
		       rc=metadata_newobj("Login", add_uri, Name="TestObject");&lt;BR /&gt;
                       if(rc&amp;lt;0) then do;&lt;BR /&gt;
                               putlog "WARNING: Cannot add uri: " del_uri;&lt;BR /&gt;
                       end;&lt;BR /&gt;
                       else do;&lt;BR /&gt;
                               putlog "INFO: Added uri: " add_uri;&lt;BR /&gt;
                       end;&lt;BR /&gt;
               end;&lt;BR /&gt;
       run;&lt;BR /&gt;
&lt;BR /&gt;
but it works not like I want.&lt;BR /&gt;
It deletes the object and creates a new one, but with name " 0" instead of "TestObject" O_o&lt;BR /&gt;
Can please somebody explain me why?&lt;BR /&gt;
Probably I don't understand completely which value should have URI...</description>
      <pubDate>Mon, 26 May 2008 13:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21165#M983</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-26T13:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Metadata Object</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21166#M984</link>
      <description>Hi:&lt;BR /&gt;
  Perhaps the documentation will help:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_ref_10177.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/omd_ref_10177.pdf&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
If the documentation doesn't help, you might consider contacting Tech Support. &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 27 May 2008 16:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21166#M984</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-05-27T16:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Metadata Object</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21167#M985</link>
      <description>Thank you, but I have already read this, and also the second part.&lt;BR /&gt;
I have now some thoughts... I will try and post if it will be ok.&lt;BR /&gt;
But anyway, it could be great to hear your thoughts.</description>
      <pubDate>Tue, 27 May 2008 22:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21167#M985</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-05-27T22:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Metadata Object</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21168#M986</link>
      <description>Hi:&lt;BR /&gt;
  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.) &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 28 May 2008 15:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/21168#M986</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-05-28T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Metadata Object</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/504185#M2209</link>
      <description>&lt;P&gt;The third argument to &lt;STRONG&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;metadata_newobj&lt;/FONT&gt;&lt;/STRONG&gt; is the &lt;STRONG&gt;name&lt;/STRONG&gt;, or more exactly the value of the name attribute of the new object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now look at your code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rc=metadata_newobj("Login", add_uri, Name="TestObject");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The third argument is &lt;FONT color="#0000ff"&gt;&lt;STRONG&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Name="TestObject"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;, which is a logical evaluation whose result if false, which is numeric 0, which is auto-cast to the string "0", which becomes the new object's name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The correct code would be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rc=metadata_newobj("Login", add_uri, "TestObject");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 03:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Adding-Metadata-Object/m-p/504185#M2209</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2018-10-15T03:38:27Z</dc:date>
    </item>
  </channel>
</rss>

