<?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 What does put variable-name=@ statement do? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-does-put-variable-name-statement-do/m-p/254000#M48386</link>
    <description>&lt;P&gt;In the example given here:&amp;nbsp;&lt;A href="http://support.sas.com/kb/24/651.html," target="_blank"&gt;http://support.sas.com/kb/24/651.html,&lt;/A&gt; what does the following statement do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; &lt;STRONG&gt; put month_name= @;&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2016 22:13:54 GMT</pubDate>
    <dc:creator>mduarte</dc:creator>
    <dc:date>2016-03-02T22:13:54Z</dc:date>
    <item>
      <title>What does put variable-name=@ statement do?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-does-put-variable-name-statement-do/m-p/254000#M48386</link>
      <description>&lt;P&gt;In the example given here:&amp;nbsp;&lt;A href="http://support.sas.com/kb/24/651.html," target="_blank"&gt;http://support.sas.com/kb/24/651.html,&lt;/A&gt; what does the following statement do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; &lt;STRONG&gt; put month_name= @;&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 22:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-does-put-variable-name-statement-do/m-p/254000#M48386</guid>
      <dc:creator>mduarte</dc:creator>
      <dc:date>2016-03-02T22:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: What does put variable-name=@ statement do?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-does-put-variable-name-statement-do/m-p/254008#M48387</link>
      <description>&lt;P&gt;The trailing&amp;nbsp;@ in the put statement holds the pointer and stops is going to a new line. So in the case in the example in&amp;nbsp;&lt;A href="http://support.sas.com/kb/24/651.html" target="_blank"&gt;http://support.sas.com/kb/24/651.html&lt;/A&gt; the next 'put' statement is written to the same&amp;nbsp;output line to keep all in a row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is probably best shown by example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original code and output is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; _null_&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;SPAN&gt;input&lt;/SPAN&gt; date :&lt;SPAN&gt;mmddyy8.&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;/* Create a new variable */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; month_name=PUT(date,&lt;SPAN&gt;monname.&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;SPAN&gt;put&lt;/SPAN&gt; month_name= @;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;/* or just format the date */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;SPAN&gt;put&lt;/SPAN&gt; @&lt;SPAN&gt;&lt;STRONG&gt;25&lt;/STRONG&gt;&lt;/SPAN&gt; date @&lt;SPAN&gt;&lt;STRONG&gt;35&lt;/STRONG&gt;&lt;/SPAN&gt; date &lt;SPAN&gt;monname.&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P&gt;datalines&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;01/15/04&lt;/P&gt;
&lt;P&gt;02/29/04&lt;/P&gt;
&lt;P&gt;07/04/04&lt;/P&gt;
&lt;P&gt;08/18/04&lt;/P&gt;
&lt;P&gt;12/31/04&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output to the log is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;month_name=January&amp;nbsp; &amp;nbsp; &amp;nbsp; 16085 &amp;nbsp; &amp;nbsp; &amp;nbsp; January&lt;/P&gt;
&lt;P&gt;month_name=February &amp;nbsp; &amp;nbsp; 16130&amp;nbsp; &amp;nbsp; &amp;nbsp; February&lt;/P&gt;
&lt;P&gt;month_name=July &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16256&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; July&lt;/P&gt;
&lt;P&gt;month_name=August &amp;nbsp; &amp;nbsp; &amp;nbsp; 16301&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; August&lt;/P&gt;
&lt;P&gt;month_name=December &amp;nbsp; &amp;nbsp; 16436&amp;nbsp; &amp;nbsp; &amp;nbsp; December&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you remove the trailing '@' from the first 'put' statement using the code below, you'll see how the output differs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; _null_&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;SPAN&gt;input&lt;/SPAN&gt; date :&lt;SPAN&gt;mmddyy8.&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;/* Create a new variable */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; month_name=PUT(date,&lt;SPAN&gt;monname.&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;SPAN&gt;put&lt;/SPAN&gt; month_name= ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;/* or just format the date */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;SPAN&gt;put&lt;/SPAN&gt; @&lt;SPAN&gt;&lt;STRONG&gt;25&lt;/STRONG&gt;&lt;/SPAN&gt; date @&lt;SPAN&gt;&lt;STRONG&gt;35&lt;/STRONG&gt;&lt;/SPAN&gt; date &lt;SPAN&gt;monname.&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P&gt;datalines&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;01/15/04&lt;/P&gt;
&lt;P&gt;02/29/04&lt;/P&gt;
&lt;P&gt;07/04/04&lt;/P&gt;
&lt;P&gt;08/18/04&lt;/P&gt;
&lt;P&gt;12/31/04&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;month_name=January&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16085 &amp;nbsp; &amp;nbsp; &amp;nbsp; January&lt;/P&gt;
&lt;P&gt;month_name=February&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16130&amp;nbsp; &amp;nbsp; &amp;nbsp; February&lt;/P&gt;
&lt;P&gt;month_name=July&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16256&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; July&lt;/P&gt;
&lt;P&gt;month_name=August&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16301&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; August&lt;/P&gt;
&lt;P&gt;month_name=December&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16436&amp;nbsp; &amp;nbsp; &amp;nbsp; December&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following will probably explain it better?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000161869.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000161869.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 22:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-does-put-variable-name-statement-do/m-p/254008#M48387</guid>
      <dc:creator>moorsd</dc:creator>
      <dc:date>2016-03-02T22:37:41Z</dc:date>
    </item>
  </channel>
</rss>

