<?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: Using %Let in text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165955#M31997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I think I figured it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to place the below inside my proc sql statement.&amp;nbsp; Before it was was sitting outside and most likely not in the same "scope". &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;filename macro1 "C:\mytext.txt";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%include macro1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless there is a better way of doing it.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Sep 2014 16:38:16 GMT</pubDate>
    <dc:creator>sasboy007</dc:creator>
    <dc:date>2014-09-30T16:38:16Z</dc:date>
    <item>
      <title>Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165952#M31994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a txt file called mytext that has the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%LET name1=Customers;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then in my SAS program I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;filename macro1 "C:\mytext.txt";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%include macro1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table mylib.&amp;amp;name1_new as select * from&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;connection to oracle(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select *&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from old_customers&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything in the my SAS program works However, I'm getting a "WARNING: symbolic reference error for name1 not resolved." Is the problem the macro setup in the text file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 15:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165952#M31994</guid>
      <dc:creator>sasboy007</dc:creator>
      <dc:date>2014-09-30T15:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165953#M31995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;While using a macro name &amp;amp;name1 in a program, I think you need to use the delimiter "." at the end of your macro name which tells SAS, it's the end of the macro name. Like in&amp;nbsp; &lt;SPAN style="font-family: inherit; font-style: inherit;"&gt;&lt;STRONG&gt;&amp;amp;name1._new&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 16:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165953#M31995</guid>
      <dc:creator>nehareddy</dc:creator>
      <dc:date>2014-09-30T16:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165954#M31996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I added that but still getting the name not resolved error.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 16:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165954#M31996</guid>
      <dc:creator>sasboy007</dc:creator>
      <dc:date>2014-09-30T16:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165955#M31997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I think I figured it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to place the below inside my proc sql statement.&amp;nbsp; Before it was was sitting outside and most likely not in the same "scope". &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;filename macro1 "C:\mytext.txt";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%include macro1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless there is a better way of doing it.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 16:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165955#M31997</guid>
      <dc:creator>sasboy007</dc:creator>
      <dc:date>2014-09-30T16:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165956#M31998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Well, I think that if you put options mlogic syblogen mprint; on you may see that the thing resolves as something like:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table mylib.Customers&amp;nbsp;&amp;nbsp;&amp;nbsp; _new as ... &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The macro variable may need %trim'ing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have to say though, why create macro variables in an include file?&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 17:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165956#M31998</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-30T17:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165957#M31999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reason I put macro variables in include file is because I have 5 different SAS files that generate SQL "where" statements.&amp;nbsp; Instead of going into each SAS file and updating "Where" statements I have one universal Include file which handles variable assignment.&amp;nbsp; What do you think?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 18:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165957#M31999</guid>
      <dc:creator>sasboy007</dc:creator>
      <dc:date>2014-09-30T18:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using %Let in text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165958#M32000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Personally I would put them in a SAS dataset and then call them from there.&amp;nbsp; Really depends on how much information though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 09:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Let-in-text-file/m-p/165958#M32000</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-10-01T09:38:18Z</dc:date>
    </item>
  </channel>
</rss>

