<?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: %qcmpres macro leaving one trailing blank in in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446702#M112123</link>
    <description>&lt;P&gt;Build the filename in a data step and use trim() to get rid of any trailing blanks:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
outfile = trim("&amp;amp;syslast.") !! trim("_&amp;amp;dm_mrd_d.") !! '.xls');
call symputx('outfile',outfile);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And use &amp;amp;outfile in the proc export statement.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 09:33:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-19T09:33:02Z</dc:date>
    <item>
      <title>%qcmpres macro leaving one trailing blank in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446701#M112122</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Hi,&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;I'm just being lazy here but I'm trying to find a way to use &amp;amp;syslast in conjunction with a macro date variable (called dm_mrd_d) to name a data set that I am exporting to Excel in Base SAS 9.4. Initially when was doing this, I was finding 16 trailing blanks between the &amp;amp;syslast macro variable and the &amp;amp;dm_mrd_d macro variable.&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;Having done some investigation, I found out about the %qcmpres macro which I hoped would let me achieve what I was trying to. My code now reads: -&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;&lt;FONT size="3"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;= &amp;amp;syslast&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;"\\appsl\users\rob\%qcmpres(&amp;amp;syslast._&amp;amp;dm_mrd_d.).xls"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;dbms&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=excel &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;replace&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;and the macros resolve to: -&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;WORK.WORK_PHONES_ONLY _20180316&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;I'd like to get rid of the last trailing blank so the file that is created has no blanks in the name but am not sure how. When I check the log with SYMBOLGEN on, I see the following: -&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable I resolves to 22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;This is the length of the filename plus one trailing blank so I think this is the point at which I need to remove that but just not sure how.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;Hopefully I've posted enough information but if any more is needed, please let me know.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;Rob&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 09:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446701#M112122</guid>
      <dc:creator>robulon</dc:creator>
      <dc:date>2018-03-19T09:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: %qcmpres macro leaving one trailing blank in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446702#M112123</link>
      <description>&lt;P&gt;Build the filename in a data step and use trim() to get rid of any trailing blanks:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
outfile = trim("&amp;amp;syslast.") !! trim("_&amp;amp;dm_mrd_d.") !! '.xls');
call symputx('outfile',outfile);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And use &amp;amp;outfile in the proc export statement.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 09:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446702#M112123</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-19T09:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: %qcmpres macro leaving one trailing blank in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446703#M112124</link>
      <description>Brilliant, thanks Kurt</description>
      <pubDate>Mon, 19 Mar 2018 10:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446703#M112124</guid>
      <dc:creator>robulon</dc:creator>
      <dc:date>2018-03-19T10:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: %qcmpres macro leaving one trailing blank in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446706#M112126</link>
      <description>&lt;P&gt;I have to admit that it is quite a crude method, but it works. I follow my Maxim 29.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 10:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446706#M112126</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-19T10:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: %qcmpres macro leaving one trailing blank in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446771#M112149</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;outfile= "\\appsl\users\rob\%trim(&amp;amp;syslast.)%left(_&amp;amp;dm_mrd_d.).xls"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Mar 2018 13:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446771#M112149</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-03-19T13:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: %qcmpres macro leaving one trailing blank in</title>
      <link>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446801#M112169</link>
      <description>&lt;P&gt;The blanks on the end of SYSLAST are not macro quoted. So just assigning the value to another macro variable will remove them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dsn=&amp;amp;syslast ;

proc export data= &amp;amp;dsn
  outfile= "\\appsl\users\rob\&amp;amp;dsn._&amp;amp;dm_mrd_d..xls"
  dbms=excel replace
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Mar 2018 14:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/qcmpres-macro-leaving-one-trailing-blank-in/m-p/446801#M112169</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-19T14:38:52Z</dc:date>
    </item>
  </channel>
</rss>

