<?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: macro to find file location in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468731#M119776</link>
    <description>&lt;P&gt;Use CALL SYMPUTX instead of CALL SYMPUT&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 15:22:50 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-06-08T15:22:50Z</dc:date>
    <item>
      <title>macro to find file location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468729#M119775</link>
      <description>&lt;P&gt;I'm trying to write some code that will generate today's date then add that to a string to search for a file matching that date.&amp;nbsp; Problem I'm having is the concatenation of the string is producing spaces before the macro&amp;nbsp;despite trying different trim options.&amp;nbsp; Been a few years since working with SAS so I'm rusty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;x&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = date() ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; x &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmdd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; xx = compress(put(x, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmdd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;), &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'-'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'datepull'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, xx ) ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'testfile'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"\\vanfile\EnterpriseBusinessIntelligence\Tools Stuff\External Source Files\Casino\PlayPlanner\PlayerExtract_Precommitment_"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;||&amp;amp;datepull||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'000000.xls'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/* call symput('testfile', "Casino\PlayPlanner\PlayerExtract_Precommitment_"||&amp;amp;datepull||'000000.xls');*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;datepull ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;testfile ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;41 %put &amp;amp;datepull ;&lt;/P&gt;
&lt;P&gt;20180608&lt;/P&gt;
&lt;P&gt;42 %put &amp;amp;testfile ;&lt;/P&gt;
&lt;P&gt;\\vanfile\EnterpriseBusinessIntelligence\Tools Stuff\External Source Files\Casino\PlayPlanner\PlayerExtract_Precommitment_&lt;/P&gt;
&lt;P&gt;20180608000000.xls&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468729#M119775</guid>
      <dc:creator>paulsparrow</dc:creator>
      <dc:date>2018-06-08T15:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: macro to find file location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468731#M119776</link>
      <description>&lt;P&gt;Use CALL SYMPUTX instead of CALL SYMPUT&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468731#M119776</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-08T15:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: macro to find file location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468733#M119777</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468733#M119777</guid>
      <dc:creator>paulsparrow</dc:creator>
      <dc:date>2018-06-08T15:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: macro to find file location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468734#M119778</link>
      <description>&lt;P&gt;You have a couple of issues, beginning with the fact that &amp;amp;DATEPULL doesn't exist when it is needed to create &amp;amp;TESTFILE.&amp;nbsp; I would recommend a two-step fix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, remove all reference to &amp;amp;DATEPULL from the DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create &amp;amp;TESTFILE after the DATA step is over, using two statements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let datepull = &amp;amp;datepull;&lt;/P&gt;
&lt;P&gt;%let testfile =&amp;nbsp;&lt;FONT face="Courier New" size="3" color="#800080"&gt;\\vanfile\EnterpriseBusinessIntelligence\Tools Stuff\External Source&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;Files\Casino\PlayPlanner\PlayerExtract_Precommitment_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;datepull.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;000000.xls;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;The first %LET will remove any leading or trailing blanks from &amp;amp;DATEPULL.&amp;nbsp; The second %LET creates the string you need, but double-check the spacing to make sure I got it right (particularly this part:&amp;nbsp; External Source Files).&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-find-file-location/m-p/468734#M119778</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-06-08T15:26:20Z</dc:date>
    </item>
  </channel>
</rss>

