<?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 &amp;quot;put&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242144#M44936</link>
    <description>You do raise a valid point, that I could have reviewed the documentation, but in this case, I would have actually been lost in the PUT function. I honestly, didn't know you're allowed to use the same function and as a statement. Knowing that is a useful bit of information. Thought I knew "PUT" quite well, but it seems that I only knew the function, not the statement. Thanks for your reply.</description>
    <pubDate>Thu, 07 Jan 2016 00:34:27 GMT</pubDate>
    <dc:creator>Durlov</dc:creator>
    <dc:date>2016-01-07T00:34:27Z</dc:date>
    <item>
      <title>Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242076#M44919</link>
      <description>&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;Given the SAS data set PERM.STUDENTS:
PERM.STUDENTS
NAME  AGE
---------  -------
Alfred  14
Alice  13
Barbara  13
Carol  14
The following SAS program is submitted:
libname perm ‘SAS data library’;
data students;
set perm.students;
file ‘file specification’;
put name $ age;
&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;lt;insert statement here&amp;gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;
run;
The following double-spaced file is desired as output
Alfred 14
Alice 13
Barbara 13
Carol 14
Which statement completes the program and creates the desired file?&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;A. put _null_;
B. put;
C. double;
D. put/;&lt;/PRE&gt;So, the answer is B. put; But I don't get why. I mean you already have a put statement right above. Plus, as far as I understand "put" is meant to be used for changing a numeric variable to a character variable. What would a "put" do on it's own?&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Jan 2016 17:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242076#M44919</guid>
      <dc:creator>Durlov</dc:creator>
      <dc:date>2016-01-06T17:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242079#M44921</link>
      <description>&lt;P&gt;It's worth learning to navigate the documentation, it has &lt;EM&gt;almost&lt;/EM&gt; all the answers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you're mixing up a STATEMENT vs a FUNCTION, both with the same name. The comparison section of the PUT statement also details this explicitly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It mayalso be worth looking up SUM(), since it's another one, with both a function and statement and they behave differently as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#n1spe7nmkmi7ywn175002rof97fv.htm" target="_self"&gt;PUT &lt;STRONG&gt;STATEMENT&lt;/STRONG&gt;&lt;/A&gt;:&lt;/P&gt;
&lt;DIV id="n04rvvk1n7x2j8n1sixy7xsqv0g9" class="xis-paragraph"&gt;The PUT statement without arguments is called a &lt;SPAN class="xis-userSuppliedValue"&gt;null PUT statement&lt;/SPAN&gt;. The null PUT statement
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="n0i5f8x7vvc7fwn1xcm7ay3cfgk4" class="xis-item"&gt;
&lt;DIV id="p0vjncajkjcelyn1wu5dcy0ddyp2" class="xis-paraSimpleFirst"&gt;writes the current output line to the current location, even if the current output line is blank&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV id="p0e27ncjwu3uzln1318pkmdhhhva" class="xis-item"&gt;
&lt;DIV id="n18e4071gmw0n2n1jykpyzz0aphs" class="xis-paraSimpleFirst"&gt;releases an output line that is being held with a trailing @ by a previous PUT statement.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="p0cx4f9ncxpgopn19zi306umfe7l" class="xis-paragraph"&gt;&lt;SPAN class="xis-xrefSee"&gt;&lt;SPAN class="xis-xrefText"&gt;For an example, see &lt;/SPAN&gt;&lt;A title="" href="https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/n1spe7nmkmi7ywn175002rof97fv.htm#p0unvhexf9px5hn1u1nj5s68fhux" target="_blank"&gt;Holding and Releasing Output Lines&lt;/A&gt;&lt;SPAN class="xis-xrefText"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="xis-xrefSee"&gt;&lt;SPAN class="xis-xrefText"&gt;For more information, see &lt;/SPAN&gt;&lt;A title="" href="https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/n1spe7nmkmi7ywn175002rof97fv.htm#n1uo30njxxdx7in1f117hqa5q33q" target="_blank"&gt;Using Line-Hold Specifiers&lt;/A&gt;&lt;/SPAN&gt;.&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n0mlfb88dkhbmun1x08qbh5xbs7e.htm" target="_self"&gt;PUT &lt;STRONG&gt;FUNCTION:&amp;nbsp;&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="xis-details"&gt;
&lt;H2 class="xis-title"&gt;Details&lt;/H2&gt;
&lt;DIV class="xis-topicContent"&gt;&lt;A id="n0vaugjmmdzkfgn18patq1xpbujd" target="_blank"&gt;&lt;/A&gt;
&lt;DIV id="p1e63o5e513am2n1weow88md50q0" class="xis-paragraph"&gt;If the PUT function returns a value to a variable that has not yet been assigned a length, by default the variable length is determined by the width of the format.&lt;/DIV&gt;
&lt;DIV id="n07xz8x2mib5z1n1k6jk48w31yf6" class="xis-paragraph"&gt;Use the PUT function to convert a numeric value to a character value. The PUT function has no effect on which formats are used in PUT statements or which formats are assigned to variables in data sets. You cannot use the PUT function to directly change the type of variable in a data set from numeric to character. However, you can create a new character variable as the result of the PUT function. Then, if needed, use the DROP statement to drop the original numeric variable, followed by the RENAME statement to rename the new variable back to the original variable name.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-comparisons"&gt;&lt;A id="p1jimxn5zz84wyn1va8sfr4hot0e" target="_blank"&gt;&lt;/A&gt;
&lt;H2 class="xis-title"&gt;Comparisons&lt;/H2&gt;
&lt;DIV id="n1ppmwkdb604dan1as9idyecyjz8" class="xis-paragraph"&gt;&lt;STRONG&gt;The PUT statement and the PUT function are similar. The PUT function returns a value using a specified format. You must use an assignment statement to store the value in a variable. The PUT statement writes a value to an external destination (either the SAS log or a destination, that you specify).&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Jan 2016 17:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242079#M44921</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-06T17:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242082#M44922</link>
      <description>&lt;P&gt;As is, the program writes the desired report, writing each line of data to a separate line.&amp;nbsp; The requirements were actually a little bit different, however, to get a double-spaced report.&amp;nbsp; So you need to make a change that will write out a blank line as well.&amp;nbsp; That's why B is needed.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 17:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242082#M44922</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-01-06T17:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242144#M44936</link>
      <description>You do raise a valid point, that I could have reviewed the documentation, but in this case, I would have actually been lost in the PUT function. I honestly, didn't know you're allowed to use the same function and as a statement. Knowing that is a useful bit of information. Thought I knew "PUT" quite well, but it seems that I only knew the function, not the statement. Thanks for your reply.</description>
      <pubDate>Thu, 07 Jan 2016 00:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242144#M44936</guid>
      <dc:creator>Durlov</dc:creator>
      <dc:date>2016-01-07T00:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242145#M44937</link>
      <description>&lt;P&gt;Just to be more confusing the there are actually two&amp;nbsp;SUM() functions.&lt;/P&gt;
&lt;P&gt;There is the SQL aggregate function SUM() that takes one argument and produces the sum across rows.&lt;/P&gt;
&lt;P&gt;There is data step function SUM() that takes two or more arguments and produces the sum of its arguments, which&amp;nbsp;could be thought of as producing the sum across columns instead of rows.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 00:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/242145#M44937</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-01-07T00:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/389295#M93350</link>
      <description>&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-leadinText"&gt;If you visit this site:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n1h2bc0rkcufgwn11accg1uiksto.htm" target="_self"&gt;http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n1h2bc0rkcufgwn11accg1uiksto.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-leadinText"&gt;It says,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-leadinText"&gt;Print the data set EXPREV.&lt;/SPAN&gt;&lt;SPAN class="xis-codeDescription"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;EXPREV contains information about a company's product order type and price per unit for two months. DOUBLE inserts a blank line between observations. The DOUBLE option has no effect on the HTML output.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-codeDescription"&gt;proc print data = exprev double;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-codeDescription"&gt;Does this not mean that the answer should actually be double and not put?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-codeDescription"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-codeBlock"&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 19 Aug 2017 04:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/389295#M93350</guid>
      <dc:creator>preetimangtani</dc:creator>
      <dc:date>2017-08-19T04:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding "put"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/389306#M93352</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159704"&gt;@preetimangtani&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-leadinText"&gt;If you visit this site:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n1h2bc0rkcufgwn11accg1uiksto.htm" target="_self"&gt;http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n1h2bc0rkcufgwn11accg1uiksto.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-leadinText"&gt;It says,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-leadinText"&gt;Print the data set EXPREV.&lt;/SPAN&gt;&lt;SPAN class="xis-codeDescription"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;EXPREV contains information about a company's product order type and price per unit for two months. DOUBLE inserts a blank line between observations. The DOUBLE option has no effect on the HTML output.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-codeDescription"&gt;proc print data = exprev double;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-codeDescription"&gt;Does this not mean that the answer should actually be double and not put?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&lt;SPAN class="xis-codeDescription"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="xis-codeDescriptionBlock"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-codeBlock"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The DOUBLE keyword in the article you linked to is an option on the PROC PRINT statement and not a stand alone statement like in the choices listed in the original problem.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Aug 2017 11:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-quot-put-quot/m-p/389306#M93352</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-19T11:09:25Z</dc:date>
    </item>
  </channel>
</rss>

