<?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: Variable names in tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644889#M192708</link>
    <description>&lt;P&gt;Much more information is needed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What is the value of &amp;amp;industry?&lt;/LI&gt;
&lt;LI&gt;What is the exact word-for-word error message?&lt;/LI&gt;
&lt;LI&gt;Can you send me some bacon?&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 04 May 2020 00:08:13 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-05-04T00:08:13Z</dc:date>
    <item>
      <title>Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644885#M192705</link>
      <description>&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use a variable in the middle of a table name.&amp;nbsp; Is this doable?&amp;nbsp; I am assuming yes.&amp;nbsp; Can someone help me with the correct syntax?&amp;nbsp; I tried it with/without the period and I get an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CREATE TABLE WORK.&amp;amp;Industry._01 AS &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 May 2020 23:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644885#M192705</guid>
      <dc:creator>JeffM1968</dc:creator>
      <dc:date>2020-05-03T23:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644889#M192708</link>
      <description>&lt;P&gt;Much more information is needed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What is the value of &amp;amp;industry?&lt;/LI&gt;
&lt;LI&gt;What is the exact word-for-word error message?&lt;/LI&gt;
&lt;LI&gt;Can you send me some bacon?&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 May 2020 00:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644889#M192708</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-04T00:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644894#M192712</link>
      <description>&lt;P&gt;&amp;amp;Industry = Tech&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JeffM1968_0-1588551341115.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39016i6FBB58EDC482F1F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JeffM1968_0-1588551341115.png" alt="JeffM1968_0-1588551341115.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 00:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644894#M192712</guid>
      <dc:creator>JeffM1968</dc:creator>
      <dc:date>2020-05-04T00:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644898#M192716</link>
      <description>&lt;P&gt;You need to use the dot after &amp;amp;VARIABLE. The is no underscore immediately before &amp;amp;VARIABLE.&lt;/P&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 May 2020 00:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644898#M192716</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-04T00:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644902#M192719</link>
      <description>&lt;P&gt;If you are just creating the table in the temporary WORK library, try removing "WORK." you can do away without specifying it in front of your table name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There needs to be a period after the &amp;amp;variable_name. because there is a suffix after it.&lt;/P&gt;
&lt;P&gt;It may also be worthwhile checking the line where Industry is assigned a value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All of the following variations work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Industry=Tech;
%put &amp;amp;=Industry;

proc sql;&lt;BR /&gt;
/*create table WORK._&amp;amp;Industry._01 as */
/*create table _&amp;amp;Industry._01 as */&lt;BR /&gt;
/*create table WORK.&amp;amp;Industry._01 as */
/*create table &amp;amp;Industry._01 as */&lt;BR /&gt;
select * from sashelp.cars;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 May 2020 03:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644902#M192719</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2020-05-04T03:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644907#M192720</link>
      <description>&lt;P&gt;Check how your macro variable is being created and resolved. You may have some spaces after it causing it to resolve as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; WORK.TECH      _01 AS &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can check by using the appropriate debugging options and seeing this in your log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this is the case, you can fix it by using CALL SYMPUTX() (note the X) or TRIMMED option if you're creating the macro variable via SQL which will remove the trailing spaces.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 04:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644907#M192720</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-04T04:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names in tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644954#M192727</link>
      <description>All of these tidbits did the trick.&lt;BR /&gt;&lt;BR /&gt;Thanks!!</description>
      <pubDate>Mon, 04 May 2020 11:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-in-tables/m-p/644954#M192727</guid>
      <dc:creator>JeffM1968</dc:creator>
      <dc:date>2020-05-04T11:09:13Z</dc:date>
    </item>
  </channel>
</rss>

