<?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: %LET help in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527069#M5206</link>
    <description>&lt;P&gt;Thank you, modified my code to add a character in front of the variable helped fix it.&amp;nbsp; noob move.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi:&lt;BR /&gt;In SAS tables, a column name has to start with a letter or underscore. You cannot have a variable named '201809' if "sometable" is a SAS dataset. Can you show the PROC CONTENTS for WORK.SOMETABLE which shows the EXACT column name that you are trying to build with macro variables?&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jan 2019 19:57:14 GMT</pubDate>
    <dc:creator>jeffbezos</dc:creator>
    <dc:date>2019-01-14T19:57:14Z</dc:date>
    <item>
      <title>%LET help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527057#M5198</link>
      <description>&lt;P&gt;Hi, I've assigned&amp;nbsp;two values using %let and wish to use them to select the column 201809 from my table rather than create the value '201809' in my proc sql statement.&amp;nbsp; Here's the code i have so far:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let billyr = 2018;&lt;BR /&gt;%let billmth = 09;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test as select prod_cd, &amp;amp;billyr.&amp;amp;billmth. from sometable;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Jeff!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527057#M5198</guid>
      <dc:creator>jeffbezos</dc:creator>
      <dc:date>2019-01-14T19:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: %LET help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527060#M5201</link>
      <description>Hi:&lt;BR /&gt;  In SAS tables, a column name has to start with a letter or underscore. You cannot have a variable named '201809' if "sometable" is a SAS dataset. Can you show the PROC CONTENTS for WORK.SOMETABLE which shows the EXACT column name that you are trying to build with macro variables?&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Mon, 14 Jan 2019 19:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527060#M5201</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-01-14T19:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: %LET help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527065#M5203</link>
      <description>&lt;P&gt;If you somehow managed to create a variable name that starts with a number then you need use a name literal to reference it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let billyr = 2018;
%let billmth = 09;

proc sql;
create table test as
 select prod_cd, "&amp;amp;billyr.&amp;amp;billmth."n as usable_varname
 from sometable
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also need to make sure that VALIDVARNAME option is set to ANY.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527065#M5203</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-14T19:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: %LET help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527069#M5206</link>
      <description>&lt;P&gt;Thank you, modified my code to add a character in front of the variable helped fix it.&amp;nbsp; noob move.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi:&lt;BR /&gt;In SAS tables, a column name has to start with a letter or underscore. You cannot have a variable named '201809' if "sometable" is a SAS dataset. Can you show the PROC CONTENTS for WORK.SOMETABLE which shows the EXACT column name that you are trying to build with macro variables?&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LET-help/m-p/527069#M5206</guid>
      <dc:creator>jeffbezos</dc:creator>
      <dc:date>2019-01-14T19:57:14Z</dc:date>
    </item>
  </channel>
</rss>

