<?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 troubleshooting call execute error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23380#M3876</link>
    <description>hi all,&lt;BR /&gt;
&lt;BR /&gt;
rsubmit;&lt;BR /&gt;
%macro get_calcs(time);&lt;BR /&gt;
gross_combined_ratio_&amp;amp;time.=(inc_&amp;amp;time.+comearn_&amp;amp;time.)/earn_&amp;amp;time.;	&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
data mydata ;&lt;BR /&gt;
	set ba_summary;&lt;BR /&gt;
	array time_interval{4}$ 10 ('month','month3','annual','ytd');&lt;BR /&gt;
	do i=1 to 1;&lt;BR /&gt;
		&lt;B&gt;call execute('%get_calcs('||time_interval{i}||')');&lt;/B&gt;	end;&lt;BR /&gt;
	*%get_calcs(month);&lt;BR /&gt;
 	run;&lt;BR /&gt;
endrsubmit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;after running the code i get the error:&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the CALL EXECUTE routine.&lt;BR /&gt;
12   + gross_combined_ratio_month=(inc_month+comearn_month)/earn_month;&lt;BR /&gt;
       --------------------------&lt;BR /&gt;
       180&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
any sugestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
sachin</description>
    <pubDate>Wed, 27 Oct 2010 04:06:24 GMT</pubDate>
    <dc:creator>SachinRuk</dc:creator>
    <dc:date>2010-10-27T04:06:24Z</dc:date>
    <item>
      <title>troubleshooting call execute error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23380#M3876</link>
      <description>hi all,&lt;BR /&gt;
&lt;BR /&gt;
rsubmit;&lt;BR /&gt;
%macro get_calcs(time);&lt;BR /&gt;
gross_combined_ratio_&amp;amp;time.=(inc_&amp;amp;time.+comearn_&amp;amp;time.)/earn_&amp;amp;time.;	&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
data mydata ;&lt;BR /&gt;
	set ba_summary;&lt;BR /&gt;
	array time_interval{4}$ 10 ('month','month3','annual','ytd');&lt;BR /&gt;
	do i=1 to 1;&lt;BR /&gt;
		&lt;B&gt;call execute('%get_calcs('||time_interval{i}||')');&lt;/B&gt;	end;&lt;BR /&gt;
	*%get_calcs(month);&lt;BR /&gt;
 	run;&lt;BR /&gt;
endrsubmit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;after running the code i get the error:&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the CALL EXECUTE routine.&lt;BR /&gt;
12   + gross_combined_ratio_month=(inc_month+comearn_month)/earn_month;&lt;BR /&gt;
       --------------------------&lt;BR /&gt;
       180&lt;BR /&gt;
&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
&lt;BR /&gt;
any sugestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
sachin</description>
      <pubDate>Wed, 27 Oct 2010 04:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23380#M3876</guid>
      <dc:creator>SachinRuk</dc:creator>
      <dc:date>2010-10-27T04:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting call execute error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23381#M3877</link>
      <description>The CALL EXECUTE routine is used to pass text to a code stack.  The stack, in this case a macro call, is then executed AFTER the DATA step has finished execution.  This is, of course not helpful to your cause.&lt;BR /&gt;
&lt;BR /&gt;
Your solution will be to tackle this problem a bit differently.  There are several approaches to list processing with the macro language.  See the following paper by Ron Fehd for more information.&lt;BR /&gt;
&lt;A href="http://caloxy.com/papers/72Lists.pdf" target="_blank"&gt;http://caloxy.com/papers/72Lists.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
The four values in your fixed array are the elements of the macro list.  You will process across that list, building the assignment statement for each element using a %DO loop of one form or another.&lt;BR /&gt;
Art</description>
      <pubDate>Wed, 27 Oct 2010 04:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23381#M3877</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-10-27T04:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting call execute error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23382#M3878</link>
      <description>hi artc,&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to elaborate a bit further. I am new to SAS so finding it a bit difficult.&lt;BR /&gt;
&lt;BR /&gt;
Basically in my case is it not possible to use 'call execute'? does having retain in the data step help at all?&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions would be welcome.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Sachin</description>
      <pubDate>Wed, 27 Oct 2010 05:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23382#M3878</guid>
      <dc:creator>SachinRuk</dc:creator>
      <dc:date>2010-10-27T05:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting call execute error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23383#M3879</link>
      <description>Hi Sachin,&lt;BR /&gt;
&lt;BR /&gt;
I don't know if this is what you are really expecting but I've created the following sample program in order to show what are the possibilities.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%macro get_calcs(time_interval, cnt_intervals);&lt;BR /&gt;
	%global %quote(&amp;amp;cnt_intervals);&lt;BR /&gt;
	%local word;&lt;BR /&gt;
	%let %quote(&amp;amp;cnt_intervals)=1;&lt;BR /&gt;
	%let word=%qscan(&amp;amp;time_interval,&amp;amp;&amp;amp;&amp;amp;cnt_intervals,%str( ));&lt;BR /&gt;
	%do %while(&amp;amp;word ne);&lt;BR /&gt;
	  %global word&amp;amp;&amp;amp;&amp;amp;cnt_intervals;&lt;BR /&gt;
	  %let word&amp;amp;&amp;amp;&amp;amp;cnt_intervals = &amp;amp;word;&lt;BR /&gt;
	  %*put %superq(word&amp;amp;&amp;amp;&amp;amp;cnt_intervals);&lt;BR /&gt;
	  %let %quote(&amp;amp;cnt_intervals)=%eval(&amp;amp;&amp;amp;&amp;amp;cnt_intervals+1);&lt;BR /&gt;
	  %let word=%qscan(&amp;amp;time_interval,&amp;amp;&amp;amp;&amp;amp;cnt_intervals,%str( ));&lt;BR /&gt;
	%end;&lt;BR /&gt;
	%let %quote(&amp;amp;cnt_intervals)=%eval(&amp;amp;&amp;amp;&amp;amp;cnt_intervals-1);&lt;BR /&gt;
	%*put "&amp;amp;time_interval" contains &amp;amp;&amp;amp;&amp;amp;cnt_intervals words.;&lt;BR /&gt;
&lt;BR /&gt;
	data test;&lt;BR /&gt;
		set dummy;&lt;BR /&gt;
&lt;BR /&gt;
		%do i=1 %to &amp;amp;&amp;amp;&amp;amp;cnt_intervals.;&lt;BR /&gt;
			gross_combined_ratio_%left(&amp;amp;&amp;amp;word&amp;amp;i) = (inc_%left(&amp;amp;&amp;amp;word&amp;amp;i) + comearn_%left(&amp;amp;&amp;amp;word&amp;amp;i)) / earn_%left(&amp;amp;&amp;amp;word&amp;amp;i);&lt;BR /&gt;
		%end;&lt;BR /&gt;
	run;&lt;BR /&gt;
%mend get_calcs;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data dummy;&lt;BR /&gt;
	inc_month = 1;&lt;BR /&gt;
	inc_month3 = 2;&lt;BR /&gt;
	inc_annual = 3;&lt;BR /&gt;
	inc_ytd = 4;&lt;BR /&gt;
&lt;BR /&gt;
	comearn_month = 5;&lt;BR /&gt;
	comearn_month3 = 6;&lt;BR /&gt;
	comearn_annual = 7;&lt;BR /&gt;
	comearn_ytd = 8;&lt;BR /&gt;
&lt;BR /&gt;
	earn_month = 2;&lt;BR /&gt;
	earn_month3 = 2;&lt;BR /&gt;
	earn_annual = 2;&lt;BR /&gt;
	earn_ytd = 2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%get_calcs(month month3 annual ytd, cntWrd);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I hope it helps.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Florent</description>
      <pubDate>Thu, 28 Oct 2010 14:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/troubleshooting-call-execute-error/m-p/23383#M3879</guid>
      <dc:creator>Florent</dc:creator>
      <dc:date>2010-10-28T14:00:25Z</dc:date>
    </item>
  </channel>
</rss>

