<?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: How to create a dymanic URL variable within a SAS macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350163#M81361</link>
    <description>&lt;P&gt;Yes, that makes sense.&amp;nbsp; However, when I do not use quotations or place VAR9, I reviece "." as the city &amp;amp; state columns of my results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I am trying to use the macro is because I have to do this for multiple locations (which can vary in the future).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS!!!&lt;/P&gt;&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;</description>
    <pubDate>Fri, 14 Apr 2017 19:06:52 GMT</pubDate>
    <dc:creator>tobyfarms</dc:creator>
    <dc:date>2017-04-14T19:06:52Z</dc:date>
    <item>
      <title>How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350105#M81333</link>
      <description>&lt;P&gt;I want to import a table from a url that has dynamic characters, but the code I have below is not working.&amp;nbsp; Is there a doable fix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; var1=2017;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; var2='NC'; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; var9='Cary'; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; myfile &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;url&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&lt;A href="http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=AA&amp;amp;year=" target="_blank" rel="nofollow noopener noreferrer"&gt;&lt;FONT color="#0066cc"&gt;http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=&lt;/FONT&gt;&lt;FONT color="#0066cc"&gt;AA&amp;amp;year=&lt;/FONT&gt;&lt;/A&gt;&lt;STRONG&gt;&amp;amp;var1&lt;/STRONG&gt;&amp;amp;task=0&amp;amp;state=&lt;STRONG&gt;&amp;amp;var2&lt;/STRONG&gt;&amp;amp;place=&lt;STRONG&gt;&amp;amp;var9&lt;/STRONG&gt;"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;here is the original url::&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;filename myfile url "&lt;A href="http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=AA&amp;amp;year=2017&amp;amp;task=0&amp;amp;state=NC&amp;amp;place=Cary" target="_blank" rel="nofollow noopener noreferrer"&gt;http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=AA&amp;amp;year=2017&amp;amp;task=0&amp;amp;state=NC&amp;amp;place=Cary&lt;/A&gt;" lrecl=32767;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 17:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350105#M81333</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-04-14T17:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350106#M81334</link>
      <description>&lt;P&gt;There is no need to quote your macro variables NC and Cary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let var9= Cary;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 17:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350106#M81334</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-04-14T17:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350112#M81337</link>
      <description>Awesome - I believe that resolved my issue (and error). Many Thanks!</description>
      <pubDate>Fri, 14 Apr 2017 17:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350112#M81337</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-04-14T17:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350116#M81338</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/139205"&gt;@tobyfarms&lt;/a&gt;&amp;nbsp;Please mark&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/93752"&gt;@collinelliot&lt;/a&gt;&amp;nbsp;solution as correct.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 18:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350116#M81338</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-14T18:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350122#M81342</link>
      <description>Thanks for letting me know. New to the process!</description>
      <pubDate>Fri, 14 Apr 2017 18:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350122#M81342</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-04-14T18:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350130#M81346</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/93752"&gt;@collinelliot&lt;/a&gt; in my next data step, my place holders for city and step are not populating. where I would list:&lt;BR /&gt;state=&amp;amp;var2;&lt;BR /&gt;City=&amp;amp;var9;&lt;BR /&gt;&lt;BR /&gt;Is there a fix for this also?&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Apr 2017 18:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350130#M81346</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-04-14T18:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350131#M81347</link>
      <description>&lt;P&gt;Yep, now you can quote them with double quotes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;state = "&amp;amp;var2"; etc.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 18:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350131#M81347</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-04-14T18:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350142#M81354</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/139205"&gt;@tobyfarms&lt;/a&gt;&amp;nbsp;Remember that macro variables work as find/replace text but that the code resulting MUST be valid SAS syntax. In your current questions once you replace the macro variables your code is not valid. You can see this by easily replacing the macro variable in place and you see the errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First one:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;var1=2017;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;var2='NC';&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;var9='Cary';&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008000"&gt;/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;myfile&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;url&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"&lt;A href="http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=AA&amp;amp;year=" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer"&gt;&lt;FONT color="#0066cc"&gt;http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=&lt;/FONT&gt;&lt;FONT color="#0066cc"&gt;AA&amp;amp;year=&lt;/FONT&gt;&lt;/A&gt;&lt;STRONG&gt;&amp;amp;var1&lt;/STRONG&gt;&amp;amp;task=0&amp;amp;state=&lt;STRONG&gt;&amp;amp;var2&lt;/STRONG&gt;&amp;amp;place=&lt;STRONG&gt;&amp;amp;var9&lt;/STRONG&gt;"&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Replaced (you can see the extra quotations in comparison to your posted URL):&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;filename&lt;/FONT&gt;&amp;nbsp;myfile&amp;nbsp;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;url&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"&lt;A href="http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=AA&amp;amp;year=" target="_blank" rel="nofollow noopener noreferrer noopener noreferrer"&gt;&lt;FONT color="#0066cc"&gt;http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl?ID=&lt;/FONT&gt;&lt;FONT color="#0066cc"&gt;AA&amp;amp;year=&lt;/FONT&gt;&lt;/A&gt;&lt;STRONG&gt;2017&lt;/STRONG&gt;&amp;amp;task=0&amp;amp;state=&lt;STRONG&gt;'NC'&lt;/STRONG&gt;&amp;amp;place=&lt;STRONG&gt;'Cary'&lt;/STRONG&gt;"&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;lrecl&lt;/FONT&gt;=&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Second one:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;state=&amp;amp;var2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;City=&amp;amp;var9;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;Replaced:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;state=NC; -&amp;gt; this expects NC to be a variable since no quotations now.&amp;nbsp;&lt;BR /&gt;City=Cary;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 18:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350142#M81354</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-14T18:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dymanic URL variable within a SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350163#M81361</link>
      <description>&lt;P&gt;Yes, that makes sense.&amp;nbsp; However, when I do not use quotations or place VAR9, I reviece "." as the city &amp;amp; state columns of my results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I am trying to use the macro is because I have to do this for multiple locations (which can vary in the future).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS!!!&lt;/P&gt;&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Fri, 14 Apr 2017 19:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-dymanic-URL-variable-within-a-SAS-macro/m-p/350163#M81361</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-04-14T19:06:52Z</dc:date>
    </item>
  </channel>
</rss>

