<?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 Help with macro function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163401#M31650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am trying to assign the file name to the variable.&amp;nbsp; I am getting error saying that symbolic variable names must be 32 or fewer character long.&amp;nbsp;&amp;nbsp; Which macro function I should be using so that I do not have to worry about the length of the file?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let fname = my_file_name_is_xyz_20150202090056.txt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;src_file_nm&amp;nbsp; = symget("&amp;amp;fname.");&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2015 15:46:57 GMT</pubDate>
    <dc:creator>pp2014</dc:creator>
    <dc:date>2015-02-11T15:46:57Z</dc:date>
    <item>
      <title>Help with macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163401#M31650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am trying to assign the file name to the variable.&amp;nbsp; I am getting error saying that symbolic variable names must be 32 or fewer character long.&amp;nbsp;&amp;nbsp; Which macro function I should be using so that I do not have to worry about the length of the file?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let fname = my_file_name_is_xyz_20150202090056.txt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;src_file_nm&amp;nbsp; = symget("&amp;amp;fname.");&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 15:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163401#M31650</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2015-02-11T15:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163402#M31651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just get rid of SYMGET:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;src_file_nm = "&amp;amp;fname.";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163402#M31651</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-02-11T16:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163403#M31652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are mixing styles. Symget will resolve the value in the data step variable.&lt;/P&gt;&lt;P&gt;&amp;amp;fname will resolve the value in place.&lt;/P&gt;&lt;P&gt;So either remove the &amp;amp; in symget(), or skip symget().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163403#M31652</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-02-11T16:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163404#M31653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let fname = my_file_name_is_xyz_20150202090056.txt;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;src_file_nm = symget(&lt;SPAN style="font-size: 18pt;"&gt;&lt;STRONG&gt;"fname"&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;You don't need &amp;amp; to refer a macro variable in symget(). Doing so will resolve first, then resolving outcome will become a macro variable name for symget to process. In this case the macro variable name is&amp;nbsp;&amp;nbsp; my_file_name_is_xyz_20150202090056.txt, which violates two rules of naming convention for SAS variable/macro variable: 1. The length &amp;lt;=32 char 2. only alphabetic and _ can be part of the name, here you have dot .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-macro-function/m-p/163404#M31653</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-02-11T16:08:05Z</dc:date>
    </item>
  </channel>
</rss>

