<?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 Add QTR to FileName in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-QTR-to-FileName/m-p/477694#M123084</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help on how to add previous QTR to the filename.&amp;nbsp; My code is below.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_all_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;close&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;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q= (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(qtr,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(date()),-1)));&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;q;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"c:\myfile_Q&amp;amp;q..xls"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=sasweb;&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;My filename should be "c:\myfile_Q2.xls. I am getting "c:\myfile_Q&amp;amp;q.xls".&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;Thank you.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 21:57:54 GMT</pubDate>
    <dc:creator>BonnaryW</dc:creator>
    <dc:date>2018-07-12T21:57:54Z</dc:date>
    <item>
      <title>Add QTR to FileName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-QTR-to-FileName/m-p/477694#M123084</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help on how to add previous QTR to the filename.&amp;nbsp; My code is below.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_all_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;close&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;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q= (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(qtr,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(date()),-1)));&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;q;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"c:\myfile_Q&amp;amp;q..xls"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=sasweb;&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;My filename should be "c:\myfile_Q2.xls. I am getting "c:\myfile_Q&amp;amp;q.xls".&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;Thank you.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 21:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-QTR-to-FileName/m-p/477694#M123084</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2018-07-12T21:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add QTR to FileName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-QTR-to-FileName/m-p/477696#M123086</link>
      <description>&lt;P&gt;Macro variables are literal text replacement. I see the %PUT statement but it doesn't generate what you expect so that's where your error is.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your PUT statement shows:&lt;/P&gt;
&lt;P&gt;(21275)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're creating a SAS date but don't apply a format. For Q# format try QTR format, which can be applied directly in SYSFUNC. You also have extraneous parenthesis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let q= %sysfunc(intnx(qtr,%sysfunc(date()),-1), qtr.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49478"&gt;@BonnaryW&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help on how to add previous QTR to the filename.&amp;nbsp; My code is below.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;ods&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;_all_&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;close&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" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q= (&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(qtr,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(date()),-1)));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;q;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"c:\myfile_Q&amp;amp;q..xls"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=sasweb;&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;My filename should be "c:\myfile_Q2.xls. I am getting "c:\myfile_Q&amp;amp;q.xls".&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;Thank you.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 22:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-QTR-to-FileName/m-p/477696#M123086</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-12T22:08:31Z</dc:date>
    </item>
  </channel>
</rss>

