<?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: Metadata Column description in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34965#M4414</link>
    <description>Yes.&lt;BR /&gt;
&lt;BR /&gt;
Select Tools-&amp;gt;Update Library Metadata (don't worry, we're not going to actually update anything).&lt;BR /&gt;
&lt;BR /&gt;
On the first page of the wizard, select the library that contains the table you care about.&lt;BR /&gt;
&lt;BR /&gt;
On the second page, accept the default option of "Report on the contents of the library, as registered in the metadata repository".&lt;BR /&gt;
&lt;BR /&gt;
Then click Finish.  The resulting report should contain the information you need.&lt;BR /&gt;
&lt;BR /&gt;
If you would rather have a SAS program to do this, try running this (replacing your libref and library name at the top):&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%let libref = NEWCHOC;&lt;BR /&gt;
%let metaLibName = Appalachian Chocolates;&lt;BR /&gt;
&lt;BR /&gt;
/* free the library if it is currently assigned */&lt;BR /&gt;
%macro cleartemplib(libtofree);&lt;BR /&gt;
  %if %sysfunc(libname(&amp;amp;libtofree)) ne 0 %then&lt;BR /&gt;
    %put NOTE: Libref &amp;amp;libtofree could not be unassigned;&lt;BR /&gt;
  %else&lt;BR /&gt;
    %put NOTE: Libref &amp;amp;libtofree has been unassigned;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
/* clear existing definition, if any */&lt;BR /&gt;
%cleartemplib(&amp;amp;libref);&lt;BR /&gt;
&lt;BR /&gt;
/* ensure library is assigned */&lt;BR /&gt;
libname &amp;amp;libref meta library="&amp;amp;metaLibName";&lt;BR /&gt;
&lt;BR /&gt;
/* list contents of the library, according to the metadata */&lt;BR /&gt;
ods noproctitle;&lt;BR /&gt;
title "Contents of library ""&amp;amp;metaLibName""";&lt;BR /&gt;
proc datasets lib=&amp;amp;libref memtype=(data view) nolist;&lt;BR /&gt;
contents data=_all_ varnum ;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
ods proctitle;&lt;BR /&gt;
title;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
    <pubDate>Tue, 22 Mar 2011 13:01:40 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2011-03-22T13:01:40Z</dc:date>
    <item>
      <title>Metadata Column description</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34964#M4413</link>
      <description>Is there a way to display the Column Description as it is registered in the metadataserver, instead of the column labels or the column names?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Ebele</description>
      <pubDate>Tue, 22 Mar 2011 08:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34964#M4413</guid>
      <dc:creator>Ebele</dc:creator>
      <dc:date>2011-03-22T08:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Metadata Column description</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34965#M4414</link>
      <description>Yes.&lt;BR /&gt;
&lt;BR /&gt;
Select Tools-&amp;gt;Update Library Metadata (don't worry, we're not going to actually update anything).&lt;BR /&gt;
&lt;BR /&gt;
On the first page of the wizard, select the library that contains the table you care about.&lt;BR /&gt;
&lt;BR /&gt;
On the second page, accept the default option of "Report on the contents of the library, as registered in the metadata repository".&lt;BR /&gt;
&lt;BR /&gt;
Then click Finish.  The resulting report should contain the information you need.&lt;BR /&gt;
&lt;BR /&gt;
If you would rather have a SAS program to do this, try running this (replacing your libref and library name at the top):&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%let libref = NEWCHOC;&lt;BR /&gt;
%let metaLibName = Appalachian Chocolates;&lt;BR /&gt;
&lt;BR /&gt;
/* free the library if it is currently assigned */&lt;BR /&gt;
%macro cleartemplib(libtofree);&lt;BR /&gt;
  %if %sysfunc(libname(&amp;amp;libtofree)) ne 0 %then&lt;BR /&gt;
    %put NOTE: Libref &amp;amp;libtofree could not be unassigned;&lt;BR /&gt;
  %else&lt;BR /&gt;
    %put NOTE: Libref &amp;amp;libtofree has been unassigned;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
/* clear existing definition, if any */&lt;BR /&gt;
%cleartemplib(&amp;amp;libref);&lt;BR /&gt;
&lt;BR /&gt;
/* ensure library is assigned */&lt;BR /&gt;
libname &amp;amp;libref meta library="&amp;amp;metaLibName";&lt;BR /&gt;
&lt;BR /&gt;
/* list contents of the library, according to the metadata */&lt;BR /&gt;
ods noproctitle;&lt;BR /&gt;
title "Contents of library ""&amp;amp;metaLibName""";&lt;BR /&gt;
proc datasets lib=&amp;amp;libref memtype=(data view) nolist;&lt;BR /&gt;
contents data=_all_ varnum ;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
ods proctitle;&lt;BR /&gt;
title;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Tue, 22 Mar 2011 13:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34965#M4414</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2011-03-22T13:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Metadata Column description</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34966#M4415</link>
      <description>Hi Chris,&lt;BR /&gt;
Thanks. &lt;BR /&gt;
&lt;BR /&gt;
I have a SQL Server table which I register in the metadata. &lt;BR /&gt;
I want to add column labels (a description) to the registered SQL table. &lt;BR /&gt;
&lt;BR /&gt;
The piece of SAS code which does the trick:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
    length uri urik $256&lt;BR /&gt;
                  id_table $256&lt;BR /&gt;
                  desc $256&lt;BR /&gt;
                  naam_tabel $32&lt;BR /&gt;
                  NameColumn $256;&lt;BR /&gt;
    rc=1;arc=0; n=1;&lt;BR /&gt;
&lt;BR /&gt;
    do while(rc&amp;gt;0);&lt;BR /&gt;
        rc=metadata_getnasn("omsobj:DatabaseSchema?@Name = 'CDW'", "Tables", n, uri);&lt;BR /&gt;
        arc=1;&lt;BR /&gt;
        if (rc&amp;gt;0) then do;&lt;BR /&gt;
                  arc=metadata_getattr(uri,"ID",id_table);&lt;BR /&gt;
                  brc=metadata_getattr(uri,"Name",naam_tabel);&lt;BR /&gt;
            end;&lt;BR /&gt;
        if (arc=0) then put id_table=;&lt;BR /&gt;
        rck=1;&lt;BR /&gt;
        k=1;&lt;BR /&gt;
        do while (rck&amp;gt;0); &lt;BR /&gt;
                  rck=metadata_getnasn("omsobj:"!!compress(id_table), "Columns", k, urik);&lt;BR /&gt;
                  rcn = metadata_getattr(urik, 'Name', NameColumn);&lt;BR /&gt;
                  rcm = metadata_getattr(urik, 'Desc', desc);&lt;BR /&gt;
                  rcaap=metadata_setattr(urik,"Desc","Test label description");&lt;BR /&gt;
                  put "Label=" desc  " Name column: " NameColumn;&lt;BR /&gt;
                  k+1;&lt;BR /&gt;
        end; /* while rck&amp;gt;0 */&lt;BR /&gt;
        n=n+1;&lt;BR /&gt;
    end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Now you have the description in the metadata and I was looking for a way to use it in Enterprise guide when viewing tables.&lt;BR /&gt;
At a first glance I thought Enterprise Guide ignored the description field. &lt;BR /&gt;
But after reconnecting to the metadataserver the description field is displayed.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Ebele</description>
      <pubDate>Tue, 22 Mar 2011 13:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Metadata-Column-description/m-p/34966#M4415</guid>
      <dc:creator>Ebele</dc:creator>
      <dc:date>2011-03-22T13:38:37Z</dc:date>
    </item>
  </channel>
</rss>

