<?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 why trim when use symput in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355683#M83297</link>
    <description>&lt;P&gt;DATA _null_; Threshold=250000; call symput('u_Threshold',trim(Threshold)); RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see above code. I do not understand, since threshold is already hard coded, I do not know why there is the need for trim(thresold).&lt;/P&gt;
&lt;P&gt;Anyone gives me the exaplanation?&lt;/P&gt;
&lt;P&gt;And what if I replace this with symputx?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2017 17:12:37 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2017-05-03T17:12:37Z</dc:date>
    <item>
      <title>why trim when use symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355683#M83297</link>
      <description>&lt;P&gt;DATA _null_; Threshold=250000; call symput('u_Threshold',trim(Threshold)); RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see above code. I do not understand, since threshold is already hard coded, I do not know why there is the need for trim(thresold).&lt;/P&gt;
&lt;P&gt;Anyone gives me the exaplanation?&lt;/P&gt;
&lt;P&gt;And what if I replace this with symputx?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 17:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355683#M83297</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2017-05-03T17:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: why trim when use symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355687#M83299</link>
      <description>&lt;P&gt;If you were to examine the value of &amp;amp;U_THRESHOLD, you would find it contains 12 characters:&amp;nbsp;&amp;nbsp; 6 blanks followed by 6 digits.&amp;nbsp; You can see this easily using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put *&amp;amp;u_threshold*;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there are no trailing blanks, TRIM would not affect the result.&amp;nbsp; However, STRIP would remove both leading and trailing blanks, and would make a difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The extra blanks get added because the second parameter to CALL SYMPUT is supposed to be a character string.&amp;nbsp; When a numeric is supplied, it forces SAS to make a numeric-to-character conversion.&amp;nbsp; You can see that this took place, by reading the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CALL SYMPUTX would make a difference.&amp;nbsp; Although it still must perform the numeric-to-character conversion, it also removes the leading blanks that result.&amp;nbsp; &amp;amp;U_THRESHOLD would be only 6 characters long.&amp;nbsp; Also, the note in the log about numeric-to-character conversion would disappear when using CALL SYMPUTX.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 17:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355687#M83299</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-03T17:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: why trim when use symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355705#M83313</link>
      <description>&lt;P&gt;Can you explain?&lt;/P&gt;
&lt;P&gt;Do you mean, when I type, "put *&amp;amp;u_threshold*;" I can see it contains 12 characters?&lt;/P&gt;
&lt;P&gt;Do you mean, if I use CALL SYMPUTX&amp;nbsp;, I do not need to use "Trim"&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 18:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355705#M83313</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2017-05-03T18:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: why trim when use symput</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355708#M83315</link>
      <description>&lt;P&gt;You cannot use PUT.&amp;nbsp; You must use %PUT.&amp;nbsp; Then you will see 12 characters appear between the two asterisks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, if you use SYMPUTX you do not need TRIM (or STRIP or LEFT or COMPRESS) ... all leading and trailing blanks will be gone.&amp;nbsp; You can see that in the same way (with %PUT).&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 18:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-trim-when-use-symput/m-p/355708#M83315</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-03T18:20:05Z</dc:date>
    </item>
  </channel>
</rss>

