<?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 Put statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Put-statement/m-p/926260#M364508</link>
    <description>&lt;P&gt;Hi guys, just wanna know what's wrong with my code.&lt;/P&gt;
&lt;P&gt;I expect the outcome is written into log like following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;text = 31/07/2023&lt;BR /&gt;text = 31/08/2023&lt;BR /&gt;text = 30/09/2023&lt;BR /&gt;text = 31/10/2023&lt;BR /&gt;text = 30/11/2023&lt;BR /&gt;text = 31/12/2023&lt;BR /&gt;text = 31/01/2024&lt;BR /&gt;text = 29/02/2024&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* My code */&lt;BR /&gt;&lt;BR /&gt;data _null_;
	do 1 = 0 to 7;
	put "text = " put(intnx("month","01Jul2023"d,i,"end"),ddmmyy10.);
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Apr 2024 06:31:02 GMT</pubDate>
    <dc:creator>ChrisWoo</dc:creator>
    <dc:date>2024-04-29T06:31:02Z</dc:date>
    <item>
      <title>Put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-statement/m-p/926260#M364508</link>
      <description>&lt;P&gt;Hi guys, just wanna know what's wrong with my code.&lt;/P&gt;
&lt;P&gt;I expect the outcome is written into log like following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;text = 31/07/2023&lt;BR /&gt;text = 31/08/2023&lt;BR /&gt;text = 30/09/2023&lt;BR /&gt;text = 31/10/2023&lt;BR /&gt;text = 30/11/2023&lt;BR /&gt;text = 31/12/2023&lt;BR /&gt;text = 31/01/2024&lt;BR /&gt;text = 29/02/2024&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* My code */&lt;BR /&gt;&lt;BR /&gt;data _null_;
	do 1 = 0 to 7;
	put "text = " put(intnx("month","01Jul2023"d,i,"end"),ddmmyy10.);
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Apr 2024 06:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-statement/m-p/926260#M364508</guid>
      <dc:creator>ChrisWoo</dc:creator>
      <dc:date>2024-04-29T06:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-statement/m-p/926261#M364509</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/442441"&gt;@ChrisWoo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1spe7nmkmi7ywn175002rof97fv.htm" target="_blank" rel="noopener"&gt;PUT statement&lt;/A&gt; works only with variables and string constants. Results of a function must be stored in a variable first.&lt;/P&gt;
&lt;PRE&gt;data _null_;
do &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/FONT&gt; = 0 to 7;
  &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;text=&lt;/STRONG&gt;&lt;/FONT&gt;put(intnx("month","01Jul2023"d,i,"end"),ddmmyy10.);
  put "text = " text;
end;
run;&lt;/PRE&gt;
&lt;P&gt;With &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n177esg96c9hkgn10bforsq2886s.htm" target="_blank" rel="noopener"&gt;&lt;EM&gt;named&lt;/EM&gt; output&lt;/A&gt; the PUT statement can be simplified to&lt;/P&gt;
&lt;PRE&gt;put text=;&lt;/PRE&gt;
&lt;P&gt;This doesn't put blanks around the equals signs, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option is &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0jks6tlw4a1v1n1ssob6gtpxfth.htm" target="_blank" rel="noopener"&gt;&lt;EM&gt;formatted&lt;/EM&gt; output&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;data _null_;
do i = 0 to 7;
  &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;d=&lt;/STRONG&gt;&lt;/FONT&gt;intnx("month","01Jul2023"d,i,"end");
  put "text = " &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;d ddmmyy10.&lt;/STRONG&gt;&lt;/FONT&gt;;
end;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Apr 2024 07:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-statement/m-p/926261#M364509</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-04-29T07:52:22Z</dc:date>
    </item>
  </channel>
</rss>

