<?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: ERROR: Open code statement recursion detected in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407657#M99356</link>
    <description>&lt;P&gt;The %input is not the same as the datastep input function.&lt;/P&gt;
&lt;P&gt;And the macro language doesn't like "input" it wants the specific INPUTN or INPUTC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%LET&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; lwrd = &lt;/FONT&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(INPUTn(&amp;amp;lwrs,date9.));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;You will have the numeric value for the date such as 10958 result&amp;nbsp;for 01Jan1990.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2017 14:30:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-10-26T14:30:11Z</dc:date>
    <item>
      <title>ERROR: Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407649#M99352</link>
      <description>&lt;P&gt;In the following code, I pass in a string "1990" and build another string "01jan1990".&amp;nbsp; I now need to convert this string to a date.&amp;nbsp; The first two LET statements work fine:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%LET yyyy=&amp;amp;sysparm;&lt;BR /&gt;%PUT &amp;amp;yyyy;&lt;/P&gt;&lt;P&gt;%LET lwrs = 01jan&amp;amp;yyyy;&lt;BR /&gt;%PUT &amp;amp;lwrs;&lt;/P&gt;&lt;P&gt;%LET lwrd = %INPUT(&amp;amp;lwrs, date9.);&lt;BR /&gt;%PUT &amp;amp;lwrd;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;but the final LET statement gives rise to "ERROR: Open code statement recursion detected."&amp;nbsp; How can this conversion be correctly performed?&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp; I examined&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/ERROR-Open-code-statement-recursion-detected/td-p/54068" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/ERROR-Open-code-statement-recursion-detected/td-p/54068&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/intnx-macro-variable/td-p/217078" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/intnx-macro-variable/td-p/217078&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but still cannot find a workaround.&amp;nbsp; Apologies if this is an FAQ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407649#M99352</guid>
      <dc:creator>sfinch</dc:creator>
      <dc:date>2017-10-26T14:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407654#M99353</link>
      <description>&lt;P&gt;the %INPUT statement is for textual input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To convert characters and numeric within a macro function I always tend to use %sysfunc() around a SAS function. You can either use PUTN or INPUTN like below depending on the outcome you wish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%LET lwrd = %sysfunc(putn("&amp;amp;lwrs."d, date9.));&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:32:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407654#M99353</guid>
      <dc:creator>ClarkLawson</dc:creator>
      <dc:date>2017-10-26T14:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Open code statement recursion detected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407657#M99356</link>
      <description>&lt;P&gt;The %input is not the same as the datastep input function.&lt;/P&gt;
&lt;P&gt;And the macro language doesn't like "input" it wants the specific INPUTN or INPUTC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%LET&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; lwrd = &lt;/FONT&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(INPUTn(&amp;amp;lwrs,date9.));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;You will have the numeric value for the date such as 10958 result&amp;nbsp;for 01Jan1990.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Open-code-statement-recursion-detected/m-p/407657#M99356</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-26T14:30:11Z</dc:date>
    </item>
  </channel>
</rss>

