<?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: SYMPUTX in SQL—How to Delete the Trailing Blanks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586863#M167530</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Methinks this is the way it's done now as well.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2019 20:07:32 GMT</pubDate>
    <dc:creator>hashman</dc:creator>
    <dc:date>2019-09-06T20:07:32Z</dc:date>
    <item>
      <title>SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586823#M167516</link>
      <description>&lt;P&gt;I have the following data and want to create macro variables using each observation.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input variable $ abbreviation $;
cards;
apple AP
orange OR
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The _NULL_ and SYMPUTX combination can pass each observation without leading and trailing blanks as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set have(obs=1);
call symputx("variable",variable);
call symputx("abbreviation",abbreviation);
run;
%put &amp;amp;variable.&amp;amp;abbreviation.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the output is&lt;/P&gt;&lt;PRE&gt;1    %put &amp;amp;variable.&amp;amp;abbreviation.;
appleAP&lt;/PRE&gt;&lt;P&gt;I tried something similar in SQL with STRIP, but the blanks were there.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select strip(variable),strip(abbreviation)
into :variable,:abbreviation
from have(firstobs=1);
quit;
%put &amp;amp;variable.&amp;amp;abbreviation.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but&lt;/P&gt;&lt;PRE&gt;1    %put &amp;amp;variable.&amp;amp;abbreviation.;
apple   AP&lt;/PRE&gt;&lt;P&gt;It seems SQL respects the length of each variable and locates the values correspondingly. I wonder whether there's something similar to SYMPUTX in SQL as the length of VARIABLE varies observation by observation—for instance, I cannot add LENGTH=5 after STRIP(VARIABLE). Many thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 17:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586823#M167516</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2019-09-06T17:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586826#M167517</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select variable,abbreviation
into :variable trimmed,:abbreviation trimmed
from have(firstobs=1);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Sep 2019 17:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586826#M167517</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-06T17:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586841#M167518</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;It's a great tip for two reasons:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. TRIMMED removes &lt;EM&gt;both leading and trailing blanks&lt;/EM&gt;, so using the STRIP function is superfluous. So, the keyword TRIMMED itself is a bit of a misnomer: In all candor, for the sake of semantic consistency, it should be called STRIPPED (or just STRIP would be better).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Its behavior, use, indeed the very existence, runs contrary to the SAS documentation here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;because it states, in particular:&lt;/P&gt;
&lt;P&gt;(a) That the leading and trailing blanks are removed by default. Yet in reality, they are &lt;EM&gt;not&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;(b) To preserve them, the NOTRIM option should be used. Yet in reality, an attempt to use NOTRIM results in a &lt;EM&gt;syntax error&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;(c) TRIMMED is not even mentioned. So, how does one learn about it? Either from the user space (like this one, or user papers) or by introducing a syntax error and looking at the log, which says:&lt;/P&gt;
&lt;PRE&gt;ERROR 22-322: Syntax error, expecting one of the following: ',', -, FROM, SEPARATED, THROUGH, THRU, TRIMMED.
&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 18:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586841#M167518</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-06T18:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586850#M167522</link>
      <description>&lt;PRE&gt; 71         proc sql noprint;
 72         select name into :name1 - :name19 &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;notrim&lt;/STRONG&gt;&lt;/FONT&gt; from sashelp.class;
 73         select name into :namev1 - :namev19 from sashelp.class;
 74         quit;
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              5513.46k
       OS Memory           33960.00k
       Timestamp           09/06/2019 07:21:11 PM
       Step Count                        53  Switch Count  0
       Page Faults                       0
       Page Reclaims                     62
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           0
       
 
 75         
 76         %put :&amp;amp;name1.:;
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt; :Alfred  :&lt;/STRONG&gt;&lt;/FONT&gt;
 77         %put :&amp;amp;namev1.:;
 &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;:Alfred:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;Am I missing something? It seems to work fine for me without any syntax errors.&lt;/P&gt;
&lt;P&gt;I'm testing on SAS Studio 9.4M5&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 19:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586850#M167522</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-06T19:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586851#M167523</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;It's a great tip for two reasons:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. TRIMMED removes &lt;EM&gt;both leading and trailing blanks&lt;/EM&gt;, so using the STRIP function is superfluous. So, the keyword TRIMMED itself is a bit of a misnomer: In all candor, for the sake of semantic consistency, it should be called STRIPPED (or just STRIP would be better).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Its behavior, use, indeed the very existence, runs contrary to the SAS documentation here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;because it states, in particular:&lt;/P&gt;
&lt;P&gt;(a) That the leading and trailing blanks are removed by default. Yet in reality, they are &lt;EM&gt;not&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;(b) To preserve them, the NOTRIM option should be used. Yet in reality, an attempt to use NOTRIM results in a &lt;EM&gt;syntax error&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;(c) TRIMMED is not even mentioned. So, how does one learn about it? Either from the user space (like this one, or user papers) or by introducing a syntax error and looking at the log, which says:&lt;/P&gt;
&lt;PRE&gt;ERROR 22-322: Syntax error, expecting one of the following: ',', -, FROM, SEPARATED, THROUGH, THRU, TRIMMED.
&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Could this be an omission/error in the documentation of PROC SQL? How would we notify SAS that an update to the documentation appears to be necessary?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think once a long time ago, I opened a ticket through SAS technical support when I found a typographical error in the documentation.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 19:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586851#M167523</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-06T19:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586853#M167525</link>
      <description>&lt;P&gt;Apparently, way back in 2013 (SAS version 9.3) the TRIMMED option was introduced!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2013/01/17/a-neat-new-trick-to-trim-your-macro-variables-in-9-3/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2013/01/17/a-neat-new-trick-to-trim-your-macro-variables-in-9-3/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 19:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586853#M167525</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-06T19:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586859#M167527</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Perhaps you are - and I am, too ... because out of the six queries below, only the last two work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint ;                                                    
  select name into :name notrim                   from sashelp.class ; *nope;
  select name into :name notrim separated by ","  from sashelp.class ; *nope;
  select name into :name trimmed separated by "," from sashelp.class ; *nope; 
  select name into :name separated by "," trimmed from sashelp.class ; *nope;
  select name into :name trimmed                  from sashelp.class ; *yup;
  select name into :name separated by "," notrim  from sashelp.class ; *yup;
quit ;                                                                
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then there's this part of the confusion: Are the values returned by INTO (a) stripped by default or (b) not stripped? If it is (a), then using TRIMMED is pointless; and if it is (b), then using NOTRIM is pointless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above shows that the rules are sort of convoluted, to say at least. I have a nagging suspicion that the default stripping behavior - and the respective validity of TRIMMED and NOTRIM depends on whether or not INTO is used to return a single value or a list. And have you found TRIMMED mentioned anywhere in the documentation? I haven't, but perhaps it's because I assumed that it would be described in the "INTO Clause" chapter of the Macro Language Reference alongside with NOTRIM, while it is ensconced somewhere else. Go figure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 19:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586859#M167527</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-06T19:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586860#M167528</link>
      <description>&lt;P&gt;It has always been my understand (well, at least for the last few years) that if you have a variable from one observation of a data set (as in the original question above) being placed into a macro variable via the INTO command, that TRIMMED was necessary. If you have a variable from multiple observations, with SEPARATED BY ',' (or any other separator) that by default the values of the variable were TRIMMED, so TRIMMED is not necessary, and only in this case would NOTRIM be needed, if that's what you wanted.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 20:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586860#M167528</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-06T20:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586862#M167529</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Yup, I've seen this one. But it's not part of the SAS documentation!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then, I'd greatly prefer that the documentation put the clear description of TRIMMED and NOTRIM functionality and applicability - alongside with the clear delineation of the cases where leading/trailing blanks are stripped or not by default - in the same location, so that folks wouldn't have to scratch their heads and have this kind of conversation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 20:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586862#M167529</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-06T20:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586863#M167530</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Methinks this is the way it's done now as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 20:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586863#M167530</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-06T20:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586864#M167531</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;You may very well be right. But it begs two questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. it should be said so explicitly in the SAS docs, should it not?&lt;/P&gt;
&lt;P&gt;2. Why are the trimming/no trimming defaults not uniform across the board?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 20:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586864#M167531</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-06T20:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586865#M167532</link>
      <description>&lt;P&gt;And for even more mystery, using this have data set:&lt;/P&gt;
&lt;PRE&gt;data have;
input variable $ abbreviation $;
cards;
apple AP
;&lt;/PRE&gt;
&lt;P&gt;and a very slight modification of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s demonstration code:&lt;/P&gt;
&lt;PRE&gt;6181  proc sql noprint;
6182   select variable into :name1 - :name19  from have;
6183   select variable into :namev1  from have;
6184  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


6185  %put :&amp;amp;name1.:;
:apple:
6186  %put :&amp;amp;namev1.:;
:apple   :

&lt;/PRE&gt;
&lt;P&gt;So apparently using the : var1- varn applies something differently than extracting just the value.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 20:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586865#M167532</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-06T20:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586979#M167576</link>
      <description>&lt;P&gt;Guru&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp; First off, great info &lt;EM&gt;"&amp;nbsp;for the sake of semantic consistency, &lt;U&gt;it should be called STRIPPED (or just STRIP would be better)&lt;/U&gt;."&lt;/EM&gt;.&amp;nbsp;Made me laugh&lt;/P&gt;
&lt;P&gt;Do you remember what I said about your amazing "&lt;EM&gt;sense of humor"&lt;/EM&gt; more than a year ago on LinkedIn. This one is yet another one. Very witty one too. If anything I know of Guru besides the SAS genie doctorate in physics+knowledge on AN255 is you must possess a &lt;EM&gt;Doctorate&lt;/EM&gt; in humor too.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS, I didn't mean to divert the topic or attention of the seriousness of the thread. So my apologies to all however unapologetic to write that funny note.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 15:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586979#M167576</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-07T15:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586984#M167577</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(c) TRIMMED is not even mentioned. So, how does one learn about it? Either from the user space (like this one, or user papers) or by introducing a syntax error and looking at the log, which says:&lt;/P&gt;
&lt;PRE&gt;ERROR 22-322: Syntax error, expecting one of the following: ',', -, FROM, SEPARATED, THROUGH, THRU, TRIMMED.
&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good point. I came across this omission in the SAS® 9.4 &lt;EM&gt;Macro Language Reference&lt;/EM&gt; in June and then found the documentation in the&amp;nbsp;SAS® 9.4 &lt;EM&gt;SQL Procedure User’s Guide&lt;/EM&gt; (&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=sqlproc&amp;amp;docsetTarget=p0hwg3z33gllron184mzdoqwpe3j.htm&amp;amp;locale=en#n1tupenuhmu1j0n19d3curl9igt4" target="_blank" rel="noopener"&gt;SELECT Statement, INTO Clause&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-argOption"&gt;&amp;lt;TRIMMED&amp;gt;&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;stores the values that are returned into a single macro variable.&lt;/P&gt;
&lt;P class="xis-paraSimpleFirst"&gt;(...)&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;TRIMMED&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;trims the leading and trailing blanks from values that are stored in a single macro variable.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 07 Sep 2019 17:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586984#M167577</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-09-07T17:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586995#M167578</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Thanks for the link! That's what I was looking for - and couldn't locate.&lt;/P&gt;
&lt;P&gt;Now this piece of documentation looks as though it is written properly, orderly, and without omissions.&lt;/P&gt;
&lt;P&gt;Methinks they should delete the related incomplete (and thus misleading by omission) piece from the Macro Language documentation and merely provide a link to the proc SQL Guide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 18:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/586995#M167578</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-07T18:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/587047#M167607</link>
      <description>&lt;P&gt;Hi Paul (et al.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think perhaps you're being a little bit too harsh on the macro documentation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1y2jszlvs4hugn14nooftfrxhp3.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With a close reading, it defines three different "forms" of macro variable specification&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;:&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable&lt;/SPAN&gt;&lt;/H4&gt;
&lt;H4 class="xis-argument"&gt;:&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable-1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;− :&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable-n&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;NOTRIM&amp;gt;&lt;/H4&gt;
&lt;H4 class="xis-argument"&gt;:&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SEPARATED BY '&lt;SPAN class="xis-userSuppliedValue"&gt;characters&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;' &amp;lt;NOTRIM&amp;gt;&lt;/H4&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only the second and third form say that leading and trailing blanks are automatically trimmed (yes should be "stripped").&amp;nbsp; So that part is accurate.&amp;nbsp; Definitely it should be updated to describe the &amp;lt;TRIMMED&amp;gt; option which is available for the first form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  x="  foo  " ;
run ;

proc sql ;
  select x into :mvar1 from have ;
  select x into :mvar2 trimmed from have ;
  select x into :mvar3- from have ;
  select x into :mvar4- notrim from have ;                   
  select x into :mvar5 separated by " " from have ;
  select x into :mvar6 separated by " " notrim from have ;
quit ;

%put &amp;gt;&amp;gt;&amp;amp;mvar1&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;mvar2&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;mvar3&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;mvar4&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;mvar5&amp;lt;&amp;lt; &amp;gt;&amp;gt;&amp;amp;mvar6&amp;lt;&amp;lt; ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Returns:&lt;/P&gt;
&lt;PRE&gt;&amp;gt;&amp;gt;  foo  &amp;lt;&amp;lt; &amp;gt;&amp;gt;foo&amp;lt;&amp;lt; &amp;gt;&amp;gt;foo&amp;lt;&amp;lt; &amp;gt;&amp;gt;  foo  &amp;lt;&amp;lt; &amp;gt;&amp;gt;foo&amp;lt;&amp;lt; &amp;gt;&amp;gt;  foo  &amp;lt;&amp;lt;
&lt;/PRE&gt;
&lt;P&gt;Which is consistent with the docs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the second form, since the upper bound is optional, I suppose it should be:&lt;/P&gt;
&lt;H4 id="toc-hId--1207118532" class="xis-argument"&gt;:&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable-1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;−&amp;nbsp; &amp;lt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;macro-variable-n&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;NOTRIM&amp;gt;&lt;/H4&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Q.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2019 04:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/587047#M167607</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-09-08T04:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/587049#M167608</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;;&lt;/P&gt;
&lt;P&gt;Quentin, fair enough.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best - Paul&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Sep 2019 05:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/587049#M167608</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-09-08T05:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: SYMPUTX in SQL—How to Delete the Trailing Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/587085#M167628</link>
      <description>The error message should also be updated to include NOTRIM as an option in the list. Currently it's not shown but TRIMMED is included.</description>
      <pubDate>Sun, 08 Sep 2019 16:56:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMPUTX-in-SQL-How-to-Delete-the-Trailing-Blanks/m-p/587085#M167628</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-08T16:56:08Z</dc:date>
    </item>
  </channel>
</rss>

