<?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: Calling Macro in String with Apostrope and Ampersand in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409139#M279521</link>
    <description>&lt;P&gt;See Maxim 44. What's said there about blanks goes double for any special characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a &lt;A href="http://catb.org/jargon/html/L/LART.html" target="_blank"&gt;LART&lt;/A&gt; on the one who came up with those crazy file- and pathnames.&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2017 14:35:18 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-10-31T14:35:18Z</dc:date>
    <item>
      <title>Calling Macro in String with Apostrope and Ampersand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409114#M279517</link>
      <description>&lt;P&gt;I have a variable with a single quote and ampersand that is being invoked when I don't want it to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this data step, I am trying to create a variable with a single quote and Ampersand, but I'm getting the error that macro variable W is not resolved. What function can I use to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SC_Mkt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Retain&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Supplier Alignment_Geo Alignment_Name Market Region BU;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SC_ZIP (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=IMS_ZIP Market Region BU &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(IMS_ZIP=Alignment_Geo));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Supplier=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"PAUL"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Alignment_Name=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"Paul's H&amp;amp;W"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;In the following Proc Export, I am trying to use the same name in the outfile name, but also need to be able to invoke the macro for yyyymm and yyyymmdd. How can I fix this?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=SC_Mkt&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Alignment\&amp;amp;yyyymm Paul's\Upload to RxI\Paul's&lt;FONT color="#800080" face="Courier New" size="2"&gt; H&amp;amp;W&amp;nbsp;&amp;amp;yyyymmdd..csv"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=csv&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Thank you,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Kelly&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 14:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409114#M279517</guid>
      <dc:creator>brophykl</dc:creator>
      <dc:date>2017-10-31T14:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Macro in String with Apostrope and Ampersand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409118#M279518</link>
      <description>&lt;PRE&gt;outfile="C:\Alignment\&amp;amp;yyyymm Paul%str(%')s\Upload to RxI\Paul%str(%')s %nrstr(H&amp;amp;W) &amp;amp;yyyymmdd..csv"&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2017 14:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409118#M279518</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-31T14:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Macro in String with Apostrope and Ampersand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409120#M279519</link>
      <description>Importantly, don't use special characters or spaces in filenames and path's, all you are doing is causing problems for yourself.  There maybe a coding way round it, however the real problem is putting special characters in filenames/paths.</description>
      <pubDate>Tue, 31 Oct 2017 14:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409120#M279519</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-31T14:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Macro in String with Apostrope and Ampersand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409122#M279520</link>
      <description>&lt;P&gt;It&amp;nbsp; is very bad juju to have special characters in directory paths like ',?! and such.&lt;/P&gt;
&lt;P&gt;However if you want SAS to resolve to a single quote you can place two single quotes in the text when using a single quote to prevent macro resolution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Alignment_Name='&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;Paul''s H&amp;amp;W'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;But for that path I would strongly suggest not&amp;nbsp;to use&amp;nbsp;any ' or &amp;amp; in the path names. Or at least very carefully evaluate the business logic for having such things.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 14:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409122#M279520</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-31T14:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Macro in String with Apostrope and Ampersand</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409139#M279521</link>
      <description>&lt;P&gt;See Maxim 44. What's said there about blanks goes double for any special characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a &lt;A href="http://catb.org/jargon/html/L/LART.html" target="_blank"&gt;LART&lt;/A&gt; on the one who came up with those crazy file- and pathnames.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 14:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-Macro-in-String-with-Apostrope-and-Ampersand/m-p/409139#M279521</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-31T14:35:18Z</dc:date>
    </item>
  </channel>
</rss>

