<?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: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504622#M135082</link>
    <description>&lt;P&gt;Correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i run this code the dataset is created with variable a but the label is also "A".&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2018 07:49:01 GMT</pubDate>
    <dc:creator>Filipvdr</dc:creator>
    <dc:date>2018-10-16T07:49:01Z</dc:date>
    <item>
      <title>SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504294#M134932</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have a new SQL library which we will use to store our data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Enterprise guide, business users can write datasets to this library. They can pass labels in their query builder but the labels are not stored in SQL, and the table is not stored in metadata this way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there any solutions for this issue?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 13:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504294#M134932</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2018-10-15T13:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504524#M135022</link>
      <description>&lt;P&gt;So you are creating tables in SQL server via EG and&amp;nbsp;can't see the table (or variable?) labels?&lt;/P&gt;
&lt;P&gt;What happens when you run:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SQLLIB.TEST(label='aaa');&amp;nbsp;
&amp;nbsp; A=1;
 &amp;nbsp;label A='bbb';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 22:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504524#M135022</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-15T22:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504622#M135082</link>
      <description>&lt;P&gt;Correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i run this code the dataset is created with variable a but the label is also "A".&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 07:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504622#M135082</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2018-10-16T07:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504634#M135085</link>
      <description>&lt;P&gt;To store the table in metadata, you need to execute proc metalib:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc metalib;
   omr (LibUri = "SASLibrary?@libref='YOUR_LIBREF'");

   update_rule=(delete);

   report;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Oct 2018 08:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504634#M135085</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-10-16T08:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504638#M135088</link>
      <description>&lt;P&gt;Yes correct but it will look at the physical table in the SQL server to base his metadata on, and the labels are not hold there?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 08:29:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504638#M135088</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2018-10-16T08:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504640#M135090</link>
      <description>&lt;P&gt;Had the same problem some time ago and thought that just by registering the table the problem could be solved. Found some code that&lt;/P&gt;
&lt;P&gt;fixes the label in metadata. Unfortunately i can't share the code, it is part of project for a client.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code uses metadata-functions to get the table-definition using the uri&lt;/P&gt;
&lt;PRE&gt; searchUri = cats("omsobj:DataTable?DataTable[@Name = 'TABLE_NAME']", 
   "[TablePackage/DatabaseSchema[@Name = 'DATABASE_NAME']");&lt;/PRE&gt;
&lt;P&gt;Next statements load the table-object from metadata and iterate over the columns, the only thing you need is a dataset with column-name and label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;rc = metadata_getnobj(searchUri, 1, tableUri);

numRows = metadata_getnasn(tableUri, "Columns", 1, colUri);

do i = 1 to numRows;
  call missing(colUri, colName);
  rc = metadata_getnasn(tableUri, "Columns", i, colUri);
  rc = metadata_getattr(colUri, "Name", colName);
        
   if h.find(key: colName) = 0 then do;
     rc = metadata_setattr(colUri, "Desc", colLabel);
   end;
end;&lt;/PRE&gt;
&lt;P&gt;Hash-object h has columns colName and colLabel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am sure that an easier solution exists.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 08:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504640#M135090</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-10-16T08:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise guide - storing labels in a table (which is not in metadata) on a SQL library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504687#M135111</link>
      <description>&lt;P&gt;Thanks Andreas for sharing. I was planning to do the same as I don't see any other options then to store every table in metadata and use metadata scripting.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 12:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Enterprise-guide-storing-labels-in-a-table-which-is-not-in/m-p/504687#M135111</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2018-10-16T12:36:55Z</dc:date>
    </item>
  </channel>
</rss>

