<?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: removing trailing spaces from a date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950604#M371733</link>
    <description>&lt;P&gt;Thanks. So CALL SYMPUTX() is only 20+ years old.&amp;nbsp; I suspect I got confused with another supplanted feature that still gets used in a lot of new code.&amp;nbsp; The MISSOVER option of the INFILE statement.&amp;nbsp; The TRUNCOVER option has been around since at least some release of version 6.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 16:52:01 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-11-13T16:52:01Z</dc:date>
    <item>
      <title>removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950543#M371715</link>
      <description>&lt;P&gt;I am trying to remove trailing spaces from a date so it can be used in a file name for an excel file.&amp;nbsp; I have tried using strip, left(trim and it is not working&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;today=today();&lt;BR /&gt;format today yymmdd8.;&lt;BR /&gt;filedate1=(trim(compress(put(today,yymmdd10.),'-, '))-2);&lt;BR /&gt;filedate=strip(filedate1);&lt;BR /&gt;format filedate $8.;&lt;BR /&gt;call symput ('today',today);&lt;BR /&gt;call symput ('filedate',filedate);&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;%put &amp;amp;today. &amp;amp;filedate.;&lt;/P&gt;&lt;P&gt;libname rh_list "&amp;amp;path.\Export_All_Records &amp;amp;filedate..xlsx";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;This is the result:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Export_All_Records 20241111&amp;nbsp; .xlsx&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 12:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950543#M371715</guid>
      <dc:creator>tgleghorn</dc:creator>
      <dc:date>2024-11-13T12:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950545#M371717</link>
      <description>Try using call symputX instead of symput.</description>
      <pubDate>Wed, 13 Nov 2024 13:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950545#M371717</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2024-11-13T13:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950546#M371718</link>
      <description>I will give this a try. I did figure out what I was doing wrong. moved the format filedate $8 before my strip statement</description>
      <pubDate>Wed, 13 Nov 2024 13:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950546#M371718</guid>
      <dc:creator>tgleghorn</dc:creator>
      <dc:date>2024-11-13T13:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950548#M371720</link>
      <description>tried the symputx and it worked. using this.. less steps. Thank you so much.</description>
      <pubDate>Wed, 13 Nov 2024 13:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950548#M371720</guid>
      <dc:creator>tgleghorn</dc:creator>
      <dc:date>2024-11-13T13:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950578#M371727</link>
      <description>&lt;P&gt;Better yet, use the right format to begin with. The YYMMDDXw. format allows you to specify the separator with common choices based on a different letter in the place of the X. With N meaning NO separator.&lt;/P&gt;
&lt;P&gt;So&lt;/P&gt;
&lt;PRE&gt;data _null_;
call symputx('filedate',put(today(),yymmddn8.));
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 15:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950578#M371727</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-11-13T15:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950582#M371728</link>
      <description>&lt;P&gt;If you do have a macro variable with leading and/or trailing spaces then the simplest way to remove them is to just run another %LET statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let filedate=&amp;amp;filedate;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you should never use the ancient CALL SYMPUT() method unless you actually need to generate macro variables with leading and/or trailing spaces.&lt;/P&gt;
&lt;P&gt;Its replacement, CALL SYMPUTX(), was released by SAS &lt;STRONG&gt;over 30 years ago&lt;/STRONG&gt; in version 6 of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 15:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950582#M371728</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-11-13T15:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950585#M371729</link>
      <description>Thank you... will use this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 13 Nov 2024 15:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950585#M371729</guid>
      <dc:creator>tgleghorn</dc:creator>
      <dc:date>2024-11-13T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950586#M371730</link>
      <description>sorry!!!</description>
      <pubDate>Wed, 13 Nov 2024 15:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950586#M371730</guid>
      <dc:creator>tgleghorn</dc:creator>
      <dc:date>2024-11-13T15:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950593#M371732</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But you should never use the ancient CALL SYMPUT() method unless you actually need to generate macro variables with leading and/or trailing spaces.&lt;/P&gt;
&lt;P&gt;Its replacement, CALL SYMPUTX(), was released by SAS &lt;STRONG&gt;over 30 years ago&lt;/STRONG&gt; in version 6 of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;: I agree that CALL SYMPUTX has been around for decades, but as I remember it as a "newer" feature it can't be &lt;EM&gt;that&lt;/EM&gt; old. Indeed, it is listed in "&lt;A href="https://support.sas.com/documentation/whatsnew/91x/lrdictwhatsnew900.htm" target="_blank" rel="noopener"&gt;What's New in the Base SAS 9.0, 9.1, and 9.1.3 Language&lt;/A&gt;" and I don't see it in the list "&lt;A href="https://www.sfu.ca/sasdoc/sashtml/lgref/z0245852.htm" target="_blank" rel="noopener"&gt;Functions and CALL Routines&lt;/A&gt;" of the SAS v8 documentation. It might have been available earlier as an experimental feature, though.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 15:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950593#M371732</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-11-13T15:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: removing trailing spaces from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950604#M371733</link>
      <description>&lt;P&gt;Thanks. So CALL SYMPUTX() is only 20+ years old.&amp;nbsp; I suspect I got confused with another supplanted feature that still gets used in a lot of new code.&amp;nbsp; The MISSOVER option of the INFILE statement.&amp;nbsp; The TRUNCOVER option has been around since at least some release of version 6.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 16:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/removing-trailing-spaces-from-a-date/m-p/950604#M371733</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-11-13T16:52:01Z</dc:date>
    </item>
  </channel>
</rss>

