<?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 trim function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429524#M106095</link>
    <description>&lt;P&gt;Hello all. i want to use trim function in statement but it gives me error.Bellow is my code. any help to solve the error is appreciated.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data afewwords;&lt;BR /&gt;input Word1$ Word2$ ;&lt;BR /&gt;cards;&lt;BR /&gt;*some/&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&lt;BR /&gt;*every*&amp;nbsp;&amp;nbsp; THING&lt;BR /&gt;*no*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BODY&lt;BR /&gt;;&lt;BR /&gt;select trim(word1) from afewwords ;&lt;BR /&gt;proc print ;run;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jan 2018 01:24:10 GMT</pubDate>
    <dc:creator>fatemeh</dc:creator>
    <dc:date>2018-01-22T01:24:10Z</dc:date>
    <item>
      <title>trim function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429524#M106095</link>
      <description>&lt;P&gt;Hello all. i want to use trim function in statement but it gives me error.Bellow is my code. any help to solve the error is appreciated.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data afewwords;&lt;BR /&gt;input Word1$ Word2$ ;&lt;BR /&gt;cards;&lt;BR /&gt;*some/&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&lt;BR /&gt;*every*&amp;nbsp;&amp;nbsp; THING&lt;BR /&gt;*no*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BODY&lt;BR /&gt;;&lt;BR /&gt;select trim(word1) from afewwords ;&lt;BR /&gt;proc print ;run;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 01:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429524#M106095</guid>
      <dc:creator>fatemeh</dc:creator>
      <dc:date>2018-01-22T01:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: trim function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429527#M106096</link>
      <description>&lt;P&gt;A lot of confusion this question has.&lt;/P&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data AFEWWORDS;
input WORD1 $ WORD2 $ ;
cards;
*some/    WHERE
*every*   THING
*no*      BODY
run;
proc sql;
  select trim(WORD1) 'Word1' from AFEWWORDS ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure SQL: Query Results" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;Word1&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;*some/&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;*every*&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;*no*&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 22 Jan 2018 01:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429527#M106096</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-01-22T01:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: trim function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429528#M106097</link>
      <description>&lt;P&gt;A few items to consider ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a DATA step, CARDS always comes last.&amp;nbsp; Anything that follows the data is not part of that DATA step.&amp;nbsp; The programming statements must precede the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While there is such a thing as a DATA step SELECT statement, it does not function the way you are trying to use it.&amp;nbsp; What you are doing looks more like SELECT within PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to print the first variable, you don't have to change the data.&amp;nbsp; You can change the report instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=afewwords;&lt;/P&gt;
&lt;P&gt;var word1;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 01:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429528#M106097</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-22T01:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: trim function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429542#M106101</link>
      <description>&lt;P&gt;SAS uses fixed length character strings. So the TRIM() function will trim the trailing spaces from the value of a variable, but as soon as you put it back into a variable SAS will pad it with spaces to fill the length of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want to use the TRIM() function to do?&amp;nbsp; You do not need to use for normal comparisons since SAS knows that 'FRED' and 'FRED&amp;nbsp; &amp;nbsp; ' are the same thing.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 05:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trim-function/m-p/429542#M106101</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-22T05:10:54Z</dc:date>
    </item>
  </channel>
</rss>

