<?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: Trim Function options (Does the documentation need updating?) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541608#M149557</link>
    <description>&lt;P&gt;Note that you're in the FEDSQL documentation. You likely want the main SAS documentation instead, this doesn't apply to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n1io938ofitwnzn18e1hzel3u9ut.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n1io938ofitwnzn18e1hzel3u9ut.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43996"&gt;@kjohnsonm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;Minor question, I was just testing to see if the 'options' on TRIM would work for me in a project. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#n1x15ai82patq8n1v4xryc1phpdr.htm" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#n1x15ai82patq8n1v4xryc1phpdr.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I see options 'Both | leading | trailing', I had never used an option with trim before so I tried it and so far cannot get anything to work but the default no option. Just curious.&amp;nbsp; ?? Any chance this is obsolete document?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example &lt;BR /&gt;Table: AFEWWORDS &lt;BR /&gt;The following statements illustrate the TRIM function: &lt;BR /&gt;Statements &lt;BR /&gt;Results &lt;BR /&gt;select trim(word1) from afewwords;&lt;BR /&gt;*some/&lt;BR /&gt;*every*&lt;BR /&gt;*no*&lt;BR /&gt;select trim(both '*' from word1) from afewwords;&lt;BR /&gt;some&lt;BR /&gt;every&lt;BR /&gt;no&lt;BR /&gt;select trim(leading '*' from word1) from afewwords;&lt;BR /&gt;some/&lt;BR /&gt;every*&lt;BR /&gt;no*&lt;BR /&gt;select trim(trailing '*' from word1) from afewwords;&lt;BR /&gt;*some/&lt;BR /&gt;*every&lt;BR /&gt;*no&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data AfewWords;
infile datalines dlm=',';
input Word1 &amp;amp; $10. Word2 $15.;
datalines;
*some/ , WHERE 
*every* , THING 
*no* , BODY 
*no* ,  BODY  body   
;
proc print data=AfewWords;run;

proc sql;
select trim(word1) as trim_word1_exp1 from AfewWords
;quit;

/*
The above works, the below fails??
*/
proc sql;
select trim(both '*' from word1) as trim_word1_exp2 from AfewWords
;quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;PS It seems that many of the SAS provided examples are very roughly written and leave a lot to the user or do not w&lt;CODE class=" language-sas"&gt;ork.&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2019 21:03:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-03-08T21:03:05Z</dc:date>
    <item>
      <title>Trim Function options (Does the documentation need updating?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541591#M149548</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;Minor question, I was just testing to see if the 'options' on TRIM would work for me in a project. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#n1x15ai82patq8n1v4xryc1phpdr.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#n1x15ai82patq8n1v4xryc1phpdr.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I see options 'Both | leading | trailing', I had never used an option with trim before so I tried it and so far cannot get anything to work but the default no option. Just curious.&amp;nbsp; ?? Any chance this is obsolete document?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example &lt;BR /&gt;Table: AFEWWORDS &lt;BR /&gt;The following statements illustrate the TRIM function: &lt;BR /&gt;Statements &lt;BR /&gt;Results &lt;BR /&gt;select trim(word1) from afewwords;&lt;BR /&gt;*some/&lt;BR /&gt;*every*&lt;BR /&gt;*no*&lt;BR /&gt;select trim(both '*' from word1) from afewwords;&lt;BR /&gt;some&lt;BR /&gt;every&lt;BR /&gt;no&lt;BR /&gt;select trim(leading '*' from word1) from afewwords;&lt;BR /&gt;some/&lt;BR /&gt;every*&lt;BR /&gt;no*&lt;BR /&gt;select trim(trailing '*' from word1) from afewwords;&lt;BR /&gt;*some/&lt;BR /&gt;*every&lt;BR /&gt;*no&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data AfewWords;
infile datalines dlm=',';
input Word1 &amp;amp; $10. Word2 $15.;
datalines;
*some/ , WHERE 
*every* , THING 
*no* , BODY 
*no* ,  BODY  body   
;
proc print data=AfewWords;run;

proc sql;
select trim(word1) as trim_word1_exp1 from AfewWords
;quit;

/*
The above works, the below fails??
*/
proc sql;
select trim(both '*' from word1) as trim_word1_exp2 from AfewWords
;quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;PS It seems that many of the SAS provided examples are very roughly written and leave a lot to the user or do not w&lt;CODE class=" language-sas"&gt;ork.&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 20:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541591#M149548</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2019-03-08T20:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trim Function options (Does the documentation need updating?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541608#M149557</link>
      <description>&lt;P&gt;Note that you're in the FEDSQL documentation. You likely want the main SAS documentation instead, this doesn't apply to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n1io938ofitwnzn18e1hzel3u9ut.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n1io938ofitwnzn18e1hzel3u9ut.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43996"&gt;@kjohnsonm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;Minor question, I was just testing to see if the 'options' on TRIM would work for me in a project. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#n1x15ai82patq8n1v4xryc1phpdr.htm" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#n1x15ai82patq8n1v4xryc1phpdr.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I see options 'Both | leading | trailing', I had never used an option with trim before so I tried it and so far cannot get anything to work but the default no option. Just curious.&amp;nbsp; ?? Any chance this is obsolete document?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example &lt;BR /&gt;Table: AFEWWORDS &lt;BR /&gt;The following statements illustrate the TRIM function: &lt;BR /&gt;Statements &lt;BR /&gt;Results &lt;BR /&gt;select trim(word1) from afewwords;&lt;BR /&gt;*some/&lt;BR /&gt;*every*&lt;BR /&gt;*no*&lt;BR /&gt;select trim(both '*' from word1) from afewwords;&lt;BR /&gt;some&lt;BR /&gt;every&lt;BR /&gt;no&lt;BR /&gt;select trim(leading '*' from word1) from afewwords;&lt;BR /&gt;some/&lt;BR /&gt;every*&lt;BR /&gt;no*&lt;BR /&gt;select trim(trailing '*' from word1) from afewwords;&lt;BR /&gt;*some/&lt;BR /&gt;*every&lt;BR /&gt;*no&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data AfewWords;
infile datalines dlm=',';
input Word1 &amp;amp; $10. Word2 $15.;
datalines;
*some/ , WHERE 
*every* , THING 
*no* , BODY 
*no* ,  BODY  body   
;
proc print data=AfewWords;run;

proc sql;
select trim(word1) as trim_word1_exp1 from AfewWords
;quit;

/*
The above works, the below fails??
*/
proc sql;
select trim(both '*' from word1) as trim_word1_exp2 from AfewWords
;quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;PS It seems that many of the SAS provided examples are very roughly written and leave a lot to the user or do not w&lt;CODE class=" language-sas"&gt;ork.&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 21:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541608#M149557</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-08T21:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trim Function options (Does the documentation need updating?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541616#M149562</link>
      <description>&lt;P&gt;You need to use PROC FEDSQL to use that version of TRIM().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data AfewWords;
infile datalines dlm=',';
input Word1 &amp;amp; $10. Word2 $15.;
datalines;
*some/ , WHERE 
*every* , THING 
*no* , BODY 
*no* ,  BODY  body   
;

proc fedsql;
  select *
       , trim(word1) as trim_word1_exp1 
       , trim(both '*' from word1) as trim_word1_exp2
       , trim(both '*' from trim(word1)) as trim_word1_exp3
  from AfewWords
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27798i9C6587772F56E6BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 21:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541616#M149562</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-08T21:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trim Function options (Does the documentation need updating?)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541637#M149571</link>
      <description>&lt;P&gt;Tom, I normally just google SAS and the key word/command I want to use. I feel a bit silly now. Thank you for the pointer, I had no idea there was a fedsql. -thanks. &lt;BR /&gt;However in my defense when I search for “sas 'proc sql' trim” no double quotes the number one hit is the fedsql version, the third hit is the proc sql' version to the documents. d'oh&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 22:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trim-Function-options-Does-the-documentation-need-updating/m-p/541637#M149571</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2019-03-08T22:37:29Z</dc:date>
    </item>
  </channel>
</rss>

