<?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 Resolved variable showing up as . in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209055#M15646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently trying to assign a filepath to a variable and use variables in it as the file will be named for the months data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.G - /filepath/merhcant_july_2015.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I declare the variable I get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUMBOLGEN: Macro variabel MTN resolves to&amp;nbsp;&amp;nbsp;&amp;nbsp; July.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I attempt to use it in my call symput for the filepath it simply comes up as a .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also declare the year and that variable is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt; rptdt = today();&lt;BR /&gt; today=today();&lt;BR /&gt; eow = intnx('week.2',today,-1,'End');&lt;BR /&gt; call symput('sun', put(eow,yymmdd10.));&lt;BR /&gt; call symput('mnth',put(eow,monname5.));&lt;BR /&gt; call symput('yr',put(eow,year.));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt; call symput('filepath',"'/filepath/merchant_"||trim(left(&amp;amp;mnth||"_"||trim(left(&amp;amp;yr))||".csv'");&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;mnth &amp;amp;sun &amp;amp;yr &amp;amp;filepath;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2015 16:39:32 GMT</pubDate>
    <dc:creator>Sotarkadin</dc:creator>
    <dc:date>2015-07-22T16:39:32Z</dc:date>
    <item>
      <title>Resolved variable showing up as .</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209055#M15646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently trying to assign a filepath to a variable and use variables in it as the file will be named for the months data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.G - /filepath/merhcant_july_2015.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I declare the variable I get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUMBOLGEN: Macro variabel MTN resolves to&amp;nbsp;&amp;nbsp;&amp;nbsp; July.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I attempt to use it in my call symput for the filepath it simply comes up as a .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also declare the year and that variable is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt; rptdt = today();&lt;BR /&gt; today=today();&lt;BR /&gt; eow = intnx('week.2',today,-1,'End');&lt;BR /&gt; call symput('sun', put(eow,yymmdd10.));&lt;BR /&gt; call symput('mnth',put(eow,monname5.));&lt;BR /&gt; call symput('yr',put(eow,year.));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt; call symput('filepath',"'/filepath/merchant_"||trim(left(&amp;amp;mnth||"_"||trim(left(&amp;amp;yr))||".csv'");&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;mnth &amp;amp;sun &amp;amp;yr &amp;amp;filepath;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 16:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209055#M15646</guid>
      <dc:creator>Sotarkadin</dc:creator>
      <dc:date>2015-07-22T16:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved variable showing up as .</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209056#M15647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because the variable JULY is missing in your second data step.&amp;nbsp; If you intended the LEFT() functions arguments to include the literal value July then you need in put it in quotes. Otherwise it looks like a variable reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put call symput('filepath',"'/filepath/merchant_"||trim(left(&amp;amp;mnth||"_"||trim(left(&amp;amp;yr))||".csv'");&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;call symput('filepath',"'/filepath/merchant_"||trim(left(July||"_"||trim(left(2015))||".csv'")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly for the macro variable YR, but in that case the value looks like a numeric literal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not just set the value of FILEPATH directly ?&amp;nbsp; Use CALL SYMPUTX() to prevent the extra spaces in the macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; rptdt = today();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; today=today();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; eow = intnx('week.2',today,-1,'End');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call symputx('sun', put(eow,yymmdd10.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call symputx('mnth',put(eow,monname5.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call symputx('yr',put(eow,year.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let filepath=%sysfunc(dequote("'/filepath/merchant_&amp;amp;mnth._&amp;amp;yr..csv'")) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%put filepath=&amp;amp;filepath;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;filepath='/filepath/merchant_July_2015.csv'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 16:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209056#M15647</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-07-22T16:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved variable showing up as .</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209057#M15648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Tom.&amp;nbsp; This seems to have corrected the issue and simplified the code I was trying to use.&amp;nbsp; I used SYMPUT as I am still new to SAS programming and had seen that used before.&amp;nbsp; I am not sure how what you posted works, but I do know that it works.&amp;nbsp; But I can do some research on SYMPUTX and %sysfunc to get an understanding of those commands. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again for the response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 16:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209057#M15648</guid>
      <dc:creator>Sotarkadin</dc:creator>
      <dc:date>2015-07-22T16:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Resolved variable showing up as .</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209058#M15649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CALL SYMPUTX() is new (less than 10 years old &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; ).&amp;nbsp; It makes the process of generating macro variables from data step easier in that it both trims the leading and trailing spaces and quietly converts numbers to text.&amp;nbsp; Note that macro variables are always text strings since they are just a tool for building text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of DEQUOTE() function allows you to easily generate the variable with single quotes around it as your original code was trying to do.&amp;nbsp; Macro variables do not resolve inside of quoted strings that start with a single quote.&amp;nbsp; If you are ok with making the macro variable use double quotes then you do not need that extra complexity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;%let filepath="/filepath/merchant_&amp;amp;mnth._&amp;amp;yr..csv" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Or your can leave off the quotes and add them back later when you reference the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;%let filepath=/filepath/merchant_&amp;amp;mnth._&amp;amp;yr..csv ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 17:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Resolved-variable-showing-up-as/m-p/209058#M15649</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-07-22T17:07:28Z</dc:date>
    </item>
  </channel>
</rss>

