<?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 How to use the select statement within proc metalib statement in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259627#M18127</link>
    <description>&lt;P&gt;Hi! I want to store a table into a library using proc metalib and the select statement, but my&amp;nbsp;table is not&amp;nbsp;added to the library called myLib. I also need the table to have a macro (&amp;amp;myDate.) as a table&amp;nbsp;name. Can anyone help me with this? This is my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data myLib.&amp;amp;myDate;&lt;/P&gt;
&lt;P&gt;set x;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc metalib;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;omr(library=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"myLib"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; repname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"something"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;select (myLib.&amp;amp;myDate);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;update_rule=(delete);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;And the log output:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables was updated.&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables was deleted.&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables was added.&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables matched the data sources.&lt;/P&gt;
&lt;P&gt;NOTE: 1 tables listed in the SELECT or EXCLUDE statement were not found in either the metadata or the data source.&lt;/P&gt;
&lt;P&gt;NOTE: 0 other tables were not processed due to error or UPDATE_RULE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2016 12:08:53 GMT</pubDate>
    <dc:creator>ak2</dc:creator>
    <dc:date>2016-03-29T12:08:53Z</dc:date>
    <item>
      <title>How to use the select statement within proc metalib statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259627#M18127</link>
      <description>&lt;P&gt;Hi! I want to store a table into a library using proc metalib and the select statement, but my&amp;nbsp;table is not&amp;nbsp;added to the library called myLib. I also need the table to have a macro (&amp;amp;myDate.) as a table&amp;nbsp;name. Can anyone help me with this? This is my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data myLib.&amp;amp;myDate;&lt;/P&gt;
&lt;P&gt;set x;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc metalib;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;omr(library=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"myLib"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; repname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"something"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;select (myLib.&amp;amp;myDate);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;update_rule=(delete);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;And the log output:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables was updated.&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables was deleted.&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables was added.&lt;/P&gt;
&lt;P&gt;NOTE: Metadata for 0 tables matched the data sources.&lt;/P&gt;
&lt;P&gt;NOTE: 1 tables listed in the SELECT or EXCLUDE statement were not found in either the metadata or the data source.&lt;/P&gt;
&lt;P&gt;NOTE: 0 other tables were not processed due to error or UPDATE_RULE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 12:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259627#M18127</guid>
      <dc:creator>ak2</dc:creator>
      <dc:date>2016-03-29T12:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the select statement within proc metalib statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259632#M18128</link>
      <description>&lt;P&gt;Well, I don't know this procedure, however I would give you some&amp;nbsp;points:&lt;/P&gt;
&lt;P&gt;Why specify library - mLib - in both the cmr() and the select(), surely it should only appear in the cmr. &amp;nbsp;And according to the documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrmeta/60739/HTML/default/viewer.htm#a003181502.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrmeta/60739/HTML/default/viewer.htm#a003181502.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It should look like: select("&amp;amp;MyDate.");&lt;/P&gt;
&lt;P&gt;You will see this note states the select wasn't found:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: 1 tables listed in the SELECT or EXCLUDE statement were not found in either the metadata or the data source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, that macro variables can have spaces at the end to make the length up, so you might need %trim() in there as well, but try the above. &amp;nbsp;Now, this assumes that in the library mlib, you have a dataset which is the same text as mydate. &amp;nbsp;However what I would say is that dates - unless you start with a character - are not valid SAS names, so maybe that is your problem, you haven't showed what &amp;amp;Mydate actually resolves to. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As another tip, don't put "data" items in names, its never a good idea. &amp;nbsp;By "data", I mean things like dates, which should be in datasets (as in the name "data"sets) - names are for programming purposes so make them simple and generic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 12:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259632#M18128</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-29T12:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the select statement within proc metalib statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259641#M18129</link>
      <description>I changed select (myLib.&amp;amp;myDate) to select ("&amp;amp;myDate") and it seems to be working as expected. Thank you so much for your help!</description>
      <pubDate>Tue, 29 Mar 2016 12:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-the-select-statement-within-proc-metalib-statement/m-p/259641#M18129</guid>
      <dc:creator>ak2</dc:creator>
      <dc:date>2016-03-29T12:50:47Z</dc:date>
    </item>
  </channel>
</rss>

