<?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: Macro (remove space within a variable) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404198#M98248</link>
    <description>&lt;P&gt;You can remove the space like this (note that you need to remove the dot before _&amp;amp;sysdate9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x =credit data;
 
data %sysfunc(compress(&amp;amp;x))_&amp;amp;sysdate9.;
set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 14 Oct 2017 07:28:39 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2017-10-14T07:28:39Z</dc:date>
    <item>
      <title>Macro (remove space within a variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404196#M98246</link>
      <description>&lt;P&gt;I want to create a data set with following macro variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let x =credit data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data &amp;amp;x._&amp;amp;sysdate9.;&lt;/P&gt;&lt;P&gt;set t;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Getting error, can not we remove the space within&amp;nbsp; a macro variable by using some function?&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2017 06:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404196#M98246</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2017-10-14T06:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (remove space within a variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404198#M98248</link>
      <description>&lt;P&gt;You can remove the space like this (note that you need to remove the dot before _&amp;amp;sysdate9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x =credit data;
 
data %sysfunc(compress(&amp;amp;x))_&amp;amp;sysdate9.;
set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Oct 2017 07:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404198#M98248</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-10-14T07:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (remove space within a variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404199#M98249</link>
      <description>&lt;P&gt;DATA statement defines input dataset name in a format of &amp;lt;libref&amp;gt;.&amp;lt;DatasetName&amp;gt;.&lt;/P&gt;
&lt;P&gt;LIBREF is defined by LIBNAME &amp;lt;libref&amp;gt; "path to data" and is limited to SAS names rules:&lt;/P&gt;
&lt;P&gt;taken from&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214133.htm" target="_self"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214133.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&lt;SPAN class="strong"&gt;&lt;SPAN class="strongEmph"&gt;libref&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;A name="a000854448" target="_blank"&gt;&lt;/A&gt;is a shortcut name or a "nickname" for the aggregate storage location where your SAS files are stored. It is any SAS name when you are assigning a new libref. When you are disassociating a libref from a SAS library or when you are listing attributes, specify a libref that was previously assigned.&lt;/P&gt;
&lt;TABLE cellspacing="2" cellpadding="4"&gt;
&lt;TBODY&gt;
&lt;TR valign="top"&gt;
&lt;TD width="95" align="left" class="label"&gt;Range:&lt;/TD&gt;
&lt;TD align="left" class="bgBlockLight"&gt;1 to 8 characters&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD width="95" align="left" class="label"&gt;Tip:&lt;/TD&gt;
&lt;TD align="left" class="bgBlockLight"&gt;The association between a libref and a SAS library lasts only for the duration of the SAS session or until you change it or discontinue it with another LIBNAME statement.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;therefore, as compressed &amp;amp;x is 'CreditData' - 10 characters long, it will end with error - illegal libref name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2017 08:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404199#M98249</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-10-14T08:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro (remove space within a variable)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404200#M98250</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I believe you've missed that the dot after &amp;amp;x will be consumed by the macro processor and though &amp;amp;x becomes part of the table name which can be up to 32 characters.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&amp;nbsp;code looks like a suitable solution to me.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2017 09:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-remove-space-within-a-variable/m-p/404200#M98250</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-14T09:32:55Z</dc:date>
    </item>
  </channel>
</rss>

