<?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: Understanding Put Statements in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530911#M5836</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/257888"&gt;@BigVinnie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am completely new to SAS and I am trying to make sense of the following piece of code.&lt;/P&gt;
&lt;P&gt;(PUT(TRIM(BFT_TYPE_CODE_VALUE), $CNBS_bft_type.)) as BFT_TYPE_DESCRIPTION&lt;/P&gt;
&lt;P&gt;length = 200&lt;/P&gt;
&lt;P&gt;format = $200&lt;/P&gt;
&lt;P&gt;informat = $200&lt;/P&gt;
&lt;P&gt;label = 'BFT_TYPE_DESCRIPTION'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is the code in brackets that I am trying to understand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can somebody explain in English what the code is doing?&lt;/P&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;Vinnie&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here, you are not using the put &lt;EM&gt;statement&lt;/EM&gt;, but the put &lt;EM&gt;function&lt;/EM&gt; in an SQL select.&lt;/P&gt;
&lt;P&gt;The put() function takes the first argument and formats it with the format supplied as the second argument, and delivers the result as a character string.&lt;/P&gt;
&lt;P&gt;The trim() function used to prepare the first argument to put() simply removes trailing blanks from a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation for SAS data step functions (which can also be used in SAS SQL) is found &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=titlepage.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;here&lt;/A&gt; (so you can follow Maxim 1).&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2019 10:51:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-01-29T10:51:58Z</dc:date>
    <item>
      <title>Understanding Put Statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530908#M5833</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am completely new to SAS and I am trying to make sense of the following piece of code.&lt;/P&gt;&lt;P&gt;(PUT(TRIM(BFT_TYPE_CODE_VALUE), $CNBS_bft_type.)) as BFT_TYPE_DESCRIPTION&lt;/P&gt;&lt;P&gt;length = 200&lt;/P&gt;&lt;P&gt;format = $200&lt;/P&gt;&lt;P&gt;informat = $200&lt;/P&gt;&lt;P&gt;label = 'BFT_TYPE_DESCRIPTION'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is the code in brackets that I am trying to understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody explain in English what the code is doing?&lt;/P&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;Vinnie&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 10:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530908#M5833</guid>
      <dc:creator>BigVinnie</dc:creator>
      <dc:date>2019-01-29T10:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding Put Statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530910#M5835</link>
      <description>&lt;P&gt;Hi and welcome to the SAS communities &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks like something from a PROC SQL step.. The code in the brackets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(PUT(TRIM(BFT_TYPE_CODE_VALUE), $CNBS_bft_type.)) as BFT_TYPE_DESCRIPTION&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Working our way from the inside out.. The &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1io938ofitwnzn18e1hzel3u9ut.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Trim Function&lt;/A&gt; removes trailing blanks from the character variable &lt;STRONG&gt;BFT_TYPE_CODE_VALUE.&lt;/STRONG&gt; Next, the PUT FUNCTION is used to return the value of the trimmed variable in the format specified by $CNBS_bft_type. This value is assigned to the new variable BFT_TYPE_DESCRIPTION.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 10:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530910#M5835</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-29T10:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding Put Statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530911#M5836</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/257888"&gt;@BigVinnie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am completely new to SAS and I am trying to make sense of the following piece of code.&lt;/P&gt;
&lt;P&gt;(PUT(TRIM(BFT_TYPE_CODE_VALUE), $CNBS_bft_type.)) as BFT_TYPE_DESCRIPTION&lt;/P&gt;
&lt;P&gt;length = 200&lt;/P&gt;
&lt;P&gt;format = $200&lt;/P&gt;
&lt;P&gt;informat = $200&lt;/P&gt;
&lt;P&gt;label = 'BFT_TYPE_DESCRIPTION'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is the code in brackets that I am trying to understand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can somebody explain in English what the code is doing?&lt;/P&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;Vinnie&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here, you are not using the put &lt;EM&gt;statement&lt;/EM&gt;, but the put &lt;EM&gt;function&lt;/EM&gt; in an SQL select.&lt;/P&gt;
&lt;P&gt;The put() function takes the first argument and formats it with the format supplied as the second argument, and delivers the result as a character string.&lt;/P&gt;
&lt;P&gt;The trim() function used to prepare the first argument to put() simply removes trailing blanks from a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation for SAS data step functions (which can also be used in SAS SQL) is found &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=titlepage.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;here&lt;/A&gt; (so you can follow Maxim 1).&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 10:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530911#M5836</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-29T10:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding Put Statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530916#M5839</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 11:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530916#M5839</guid>
      <dc:creator>BigVinnie</dc:creator>
      <dc:date>2019-01-29T11:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding Put Statements</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530917#M5840</link>
      <description>Thank you</description>
      <pubDate>Tue, 29 Jan 2019 11:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-Put-Statements/m-p/530917#M5840</guid>
      <dc:creator>BigVinnie</dc:creator>
      <dc:date>2019-01-29T11:21:24Z</dc:date>
    </item>
  </channel>
</rss>

