<?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 preserving (or adding single 'quotes') around a computed macro rolling date variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100213#M21027</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Due to the way our database is set up, I need to pull a weeks worth of data at a time in the format 'YYYY-MM-DD' and it has to be enclosed in single quotes.&amp;nbsp; I've never been really good at the whole reading or not reading those strange characters with macro variables so I thought I'd ask the experts!&amp;nbsp; I'm fairly certain this is an easy solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have so far.&amp;nbsp; This gives me the two macro date variables &amp;amp;date1 and &amp;amp;date2.&amp;nbsp; However, I need to have single 'quotes' around them so that it resolves to '2013-01-28' and '2013-02-03' respectively.&amp;nbsp; I know I can't just put single quotes '&amp;amp;date1' and '&amp;amp;date2' like such but I'm not sure how to go about this.&amp;nbsp; Your input is always really appreciated!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; datem=today();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;date1=put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'week.2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&amp;amp;datem,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'b'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 14pt;"&gt;yymmddd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;date2=put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'week.2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&amp;amp;datem,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'e'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 14pt;"&gt;yymmddd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'date1'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,date1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'date2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,date2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; &amp;amp;date1 &amp;amp;date2;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2013 19:21:15 GMT</pubDate>
    <dc:creator>SASguyCO</dc:creator>
    <dc:date>2013-02-06T19:21:15Z</dc:date>
    <item>
      <title>preserving (or adding single 'quotes') around a computed macro rolling date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100213#M21027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Due to the way our database is set up, I need to pull a weeks worth of data at a time in the format 'YYYY-MM-DD' and it has to be enclosed in single quotes.&amp;nbsp; I've never been really good at the whole reading or not reading those strange characters with macro variables so I thought I'd ask the experts!&amp;nbsp; I'm fairly certain this is an easy solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have so far.&amp;nbsp; This gives me the two macro date variables &amp;amp;date1 and &amp;amp;date2.&amp;nbsp; However, I need to have single 'quotes' around them so that it resolves to '2013-01-28' and '2013-02-03' respectively.&amp;nbsp; I know I can't just put single quotes '&amp;amp;date1' and '&amp;amp;date2' like such but I'm not sure how to go about this.&amp;nbsp; Your input is always really appreciated!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; datem=today();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;date1=put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'week.2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&amp;amp;datem,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'b'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 14pt;"&gt;yymmddd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;date2=put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'week.2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&amp;amp;datem,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'e'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 14pt;"&gt;yymmddd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'date1'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,date1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'date2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,date2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; &amp;amp;date1 &amp;amp;date2;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 19:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100213#M21027</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2013-02-06T19:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: preserving (or adding single 'quotes') around a computed macro rolling date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100214#M21028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; datem=today();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;date1=put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'week.2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&amp;amp;datem,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'b'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 14pt;"&gt;yymmddd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;date2=put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'week.2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&amp;amp;datem,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'e'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 14pt;"&gt;yymmddd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'date1'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,"'"||date1||"'");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; symputx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'date2'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;,"'"||date2||"'");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; &amp;amp;date1 &amp;amp;date2;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 19:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100214#M21028</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-06T19:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: preserving (or adding single 'quotes') around a computed macro rolling date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100215#M21029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works like a charm!&amp;nbsp; Thanks so much for the quick reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 20:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/preserving-or-adding-single-quotes-around-a-computed-macro/m-p/100215#M21029</guid>
      <dc:creator>SASguyCO</dc:creator>
      <dc:date>2013-02-06T20:02:17Z</dc:date>
    </item>
  </channel>
</rss>

