<?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: Max with array has an issue in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634736#M21238</link>
    <description>&lt;P&gt;&lt;SPAN&gt;If &amp;amp;m. does have a value, then your problem is probably that you specify m-1 variables in your array in the lines below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{1:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;You should either specify m variables like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_1 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{1:&amp;amp;m.} arrs_inst_1 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or specify m-1 entries in your array like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2020 12:54:11 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-03-25T12:54:11Z</dc:date>
    <item>
      <title>Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634725#M21233</link>
      <description>&lt;P&gt;I have inherited the code but I am not an experienced SAS Coder. I have never seen arrays in any code before. I am getting error when running a section with the MAX and Array loop within it. Please assist. The code is:-&lt;/P&gt;&lt;P&gt;data final_ccf_fca;&lt;BR /&gt;set all_data_fca;&lt;/P&gt;&lt;P&gt;array amt_arrs{1:&amp;amp;m.} amt_arrears_1 - amt_arrears_&amp;amp;m.;&lt;BR /&gt;array ltr_arrs{1:&amp;amp;m.} amt_ltr_fee_1 - amt_ltr_fee_&amp;amp;m.;&lt;BR /&gt;array arrs_bal{1:&amp;amp;m.} arrs_bal_1 - arrs_bal_&amp;amp;m.;&lt;BR /&gt;array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;&lt;BR /&gt;array arrs_inst{1:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;/P&gt;&lt;P&gt;do i=1 to &amp;amp;m.;&lt;BR /&gt;arrs_bal{i} = amt_arrs{i} - ltr_arrs{i};&lt;BR /&gt;j=i-1;&lt;BR /&gt;if i&amp;gt;1 then do;&lt;BR /&gt;arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};&lt;BR /&gt;arrs_inst{i} = arrs_bal_inc{i} / amt_inst;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;max_value = max(of arrs_inst{*});&lt;/P&gt;&lt;P&gt;if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the error message:-&lt;/P&gt;&lt;P&gt;35932 data final_ccf_fca;&lt;BR /&gt;35933 set all_data_fca;&lt;BR /&gt;35934&lt;BR /&gt;35935 array amt_arrs{1:&amp;amp;m.} amt_arrears_1 - amt_arrears_&amp;amp;m.;&lt;BR /&gt;35936 array ltr_arrs{1:&amp;amp;m.} amt_ltr_fee_1 - amt_ltr_fee_&amp;amp;m.;&lt;BR /&gt;35937 array arrs_bal{1:&amp;amp;m.} arrs_bal_1 - arrs_bal_&amp;amp;m.;&lt;BR /&gt;35938 array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;&lt;BR /&gt;ERROR: Too few variables defined for the dimension(s) specified for the array arrs_bal_inc.&lt;BR /&gt;35939 array arrs_inst{1:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;BR /&gt;ERROR: Too few variables defined for the dimension(s) specified for the array arrs_inst.&lt;BR /&gt;35940&lt;BR /&gt;35941 do i=1 to &amp;amp;m.;&lt;BR /&gt;35942 arrs_bal{i} = amt_arrs{i} - ltr_arrs{i};&lt;BR /&gt;35943 j=i-1;&lt;BR /&gt;35944 if i&amp;gt;1 then do;&lt;BR /&gt;35945 arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};&lt;BR /&gt;35946 arrs_inst{i} = arrs_bal_inc{i} / amt_inst;&lt;BR /&gt;35947 end;&lt;BR /&gt;35948 end;&lt;BR /&gt;35949&lt;BR /&gt;35950 max_value = max(of arrs_inst{*});&lt;BR /&gt;---&lt;BR /&gt;71&lt;BR /&gt;ERROR 71-185: The MAX function call does not have enough arguments.&lt;/P&gt;&lt;P&gt;35951&lt;BR /&gt;35952 if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;&lt;BR /&gt;35953&lt;BR /&gt;35954 run;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;35946:24&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.FINAL_CCF_FCA may be incomplete. When this step was stopped there were 0 observations and 12 variables.&lt;BR /&gt;WARNING: Data set WORK.FINAL_CCF_FCA was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 12:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634725#M21233</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T12:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634733#M21235</link>
      <description>&lt;P&gt;The problem may be that your code has not produced a value for &amp;amp;M, or the value of &amp;amp;M is not valid for arrays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please add this line at the top of your code (immediately above&amp;nbsp;&lt;SPAN&gt;data final_ccf_fca;) and run it again, and show us the log.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;=M;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 12:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634733#M21235</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-25T12:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634734#M21236</link>
      <description>&lt;P&gt;In a SAS log, the last ERROR message is always the least important. Start debugging from the top down.&lt;/P&gt;
&lt;P&gt;In your case, the crucial problem lies here:&lt;/P&gt;
&lt;PRE&gt;35938 array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
ERROR: Too few variables defined for the dimension(s) specified for the array arrs_bal_inc.
35939 array arrs_inst{1:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;
ERROR: Too few variables defined for the dimension(s) specified for the array arrs_inst.
&lt;/PRE&gt;
&lt;P&gt;Suppose that macro variable &amp;amp;m contains a value of 5, then the code translates to this after the macro variable is resolved:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{1:5} arrs_bal_inc_2 - arrs_bal_inc_5;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since the variable list expands to only 4 members (&lt;SPAN&gt;arrs_bal_inc_2,&amp;nbsp;arrs_bal_inc_3,&amp;nbsp;arrs_bal_inc_4,&amp;nbsp;arrs_bal_inc_5), but the dimension requires 5 elements, you get the ERROR. Either adapt the dimension or the variable list, but this depends on what the code should do.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My suspicion is that the last two array definitions should be&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2020 12:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634734#M21236</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T12:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634735#M21237</link>
      <description>The Value for &amp;amp;m. is 2. That is defined further up in the code.</description>
      <pubDate>Wed, 25 Mar 2020 12:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634735#M21237</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T12:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634736#M21238</link>
      <description>&lt;P&gt;&lt;SPAN&gt;If &amp;amp;m. does have a value, then your problem is probably that you specify m-1 variables in your array in the lines below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{1:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;You should either specify m variables like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_1 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{1:&amp;amp;m.} arrs_inst_1 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or specify m-1 entries in your array like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 12:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634736#M21238</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-25T12:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634737#M21239</link>
      <description>Thanks KurtBremser. I amended the code as you suggested and now get the below message:-&lt;BR /&gt;36111&lt;BR /&gt;36112 max_value = max(of arrs_inst{*});&lt;BR /&gt;---&lt;BR /&gt;71&lt;BR /&gt;ERROR 71-185: The MAX function call does not have enough arguments.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Mar 2020 12:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634737#M21239</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T12:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634739#M21240</link>
      <description>I have changed the last 2 arrays as advised and that is working now. But the MAX function is now say 'ERROR 71-185: The MAX function call does not have enough arguments.'</description>
      <pubDate>Wed, 25 Mar 2020 13:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634739#M21240</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T13:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634744#M21241</link>
      <description>&lt;P&gt;Did you read the WHOLE log?&lt;/P&gt;
&lt;P&gt;Because this works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data all_data_fca;
input amt_arrears_1 amt_arrears_2 amt_ltr_fee_1 amt_ltr_fee_2 amt_inst;
datalines;
1 2 3 4 5
;

%let m=2;

data final_ccf_fca;
set all_data_fca;
array amt_arrs{1:&amp;amp;m.} amt_arrears_1 - amt_arrears_&amp;amp;m.;
array ltr_arrs{1:&amp;amp;m.} amt_ltr_fee_1 - amt_ltr_fee_&amp;amp;m.;
array arrs_bal{1:&amp;amp;m.} arrs_bal_1 - arrs_bal_&amp;amp;m.;
array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;
do i = 1 to &amp;amp;m.;
  arrs_bal{i} = amt_arrs{i} - ltr_arrs{i};
  j = i - 1;
  if i &amp;gt; 1 then do;
    arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};
    arrs_inst{i} = arrs_bal_inc{i} / amt_inst;
  end;
end;
max_value = max(of arrs_inst{*});
if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt; 81         data final_ccf_fca;
 82         set all_data_fca;
 83         array amt_arrs{1:&amp;amp;m.} amt_arrears_1 - amt_arrears_&amp;amp;m.;
 84         array ltr_arrs{1:&amp;amp;m.} amt_ltr_fee_1 - amt_ltr_fee_&amp;amp;m.;
 85         array arrs_bal{1:&amp;amp;m.} arrs_bal_1 - arrs_bal_&amp;amp;m.;
 86         array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;
 87         array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;
 88         do i = 1 to &amp;amp;m.;
 89           arrs_bal{i} = amt_arrs{i} - ltr_arrs{i};
 90           j = i - 1;
 91           if i &amp;gt; 1 then do;
 92             arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};
 93             arrs_inst{i} = arrs_bal_inc{i} / amt_inst;
 94           end;
 95         end;
 96         max_value = max(of arrs_inst{*});
 97         if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;
 98         run;
 
 NOTE: There were 1 observations read from the data set WORK.ALL_DATA_FCA.
 NOTE: The data set WORK.FINAL_CCF_FCA has 1 observations and 13 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.00 seconds
       cpu time            0.01 seconds
&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634744#M21241</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T13:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634745#M21242</link>
      <description>This is my log from running the code :&lt;BR /&gt;&lt;BR /&gt;NOTE: Remote submit to SASSRV commencing.&lt;BR /&gt;36365 data final_ccf_fca;&lt;BR /&gt;36366 set all_data_fca;&lt;BR /&gt;36367 array amt_arrs{1:&amp;amp;m.} amt_arrears_1 - amt_arrears_&amp;amp;m.;&lt;BR /&gt;36368 array ltr_arrs{1:&amp;amp;m.} amt_ltr_fee_1 - amt_ltr_fee_&amp;amp;m.;&lt;BR /&gt;36369 array arrs_bal{1:&amp;amp;m.} arrs_bal_1 - arrs_bal_&amp;amp;m.;&lt;BR /&gt;36370 array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;&lt;BR /&gt;36371 array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;BR /&gt;36372 do i = 1 to &amp;amp;m.;&lt;BR /&gt;36373 arrs_bal{i} = amt_arrs{i} - ltr_arrs{i};&lt;BR /&gt;36374 j = i - 1;&lt;BR /&gt;36375 if i &amp;gt; 1 then do;&lt;BR /&gt;36376 arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};&lt;BR /&gt;36377 arrs_inst{i} = arrs_bal_inc{i} / amt_inst;&lt;BR /&gt;36378 end;&lt;BR /&gt;36379 end;&lt;BR /&gt;36380 max_value = max(of arrs_inst{*});&lt;BR /&gt;---&lt;BR /&gt;71&lt;BR /&gt;ERROR 71-185: The MAX function call does not have enough arguments.&lt;BR /&gt;&lt;BR /&gt;36381 if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;&lt;BR /&gt;36382 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.FINAL_CCF_FCA may be incomplete. When this step was stopped there were 0 observations and 14 variables.&lt;BR /&gt;WARNING: Data set WORK.FINAL_CCF_FCA was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: Remote submit to SASSRV complete.&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634745#M21242</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T13:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634746#M21243</link>
      <description>&lt;P&gt;Hi KurtBremser. I have just ran your code and get the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1 data all_data_fca;&lt;BR /&gt;2 input amt_arrears_1 amt_arrears_2 amt_ltr_fee_1 amt_ltr_fee_2 amt_inst;&lt;BR /&gt;3 datalines;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.ALL_DATA_FCA has 1 observations and 5 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;5 ;&lt;BR /&gt;6&lt;BR /&gt;7 %let m=2;&lt;BR /&gt;8&lt;BR /&gt;9 data final_ccf_fca;&lt;BR /&gt;10 set all_data_fca;&lt;BR /&gt;11 array amt_arrs{1:&amp;amp;m.} amt_arrears_1 - amt_arrears_&amp;amp;m.;&lt;BR /&gt;12 array ltr_arrs{1:&amp;amp;m.} amt_ltr_fee_1 - amt_ltr_fee_&amp;amp;m.;&lt;BR /&gt;13 array arrs_bal{1:&amp;amp;m.} arrs_bal_1 - arrs_bal_&amp;amp;m.;&lt;BR /&gt;14 array arrs_bal_inc{2:&amp;amp;m.} arrs_bal_inc_2 - arrs_bal_inc_&amp;amp;m.;&lt;BR /&gt;15 array arrs_inst{2:&amp;amp;m.} arrs_inst_2 - arrs_inst_&amp;amp;m.;&lt;BR /&gt;16 do i = 1 to &amp;amp;m.;&lt;BR /&gt;17 arrs_bal{i} = amt_arrs{i} - ltr_arrs{i};&lt;BR /&gt;18 j = i - 1;&lt;BR /&gt;19 if i &amp;gt; 1 then do;&lt;BR /&gt;20 arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};&lt;BR /&gt;21 arrs_inst{i} = arrs_bal_inc{i} / amt_inst;&lt;BR /&gt;22 end;&lt;BR /&gt;23 end;&lt;BR /&gt;24 max_value = max(of arrs_inst{*});&lt;BR /&gt;---&lt;BR /&gt;71&lt;BR /&gt;ERROR 71-185: The MAX function call does not have enough arguments.&lt;/P&gt;&lt;P&gt;25 if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;&lt;BR /&gt;26 run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.FINAL_CCF_FCA may be incomplete. When this step was stopped there&lt;BR /&gt;were 0 observations and 13 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634746#M21243</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T13:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634747#M21244</link>
      <description>What version of SAS are you running? I cannot get the MAX() function to generate that error message.</description>
      <pubDate>Wed, 25 Mar 2020 13:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634747#M21244</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-25T13:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634749#M21245</link>
      <description>&lt;P&gt;I can get that error using an empty variable list, but not with an ARRAY reference.&amp;nbsp; Perhaps older versions of SAS generate it with only one variable?&lt;/P&gt;
&lt;P&gt;If you can add another input to the max function to make sure there are at least one (two) inputs then the error will not occur.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;max(.,of array_name[*])&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example log from SAS 9.2 showing that it does generate an error when using only one variable with MAX(). Adding the extract missing value in the call will make it works since now there are at least two arguments.&lt;/P&gt;
&lt;PRE&gt;8    data test;
9      x=1;
10     max=max(of x);
           ---
           71
ERROR 71-185: The MAX function call does not have enough arguments.

11     max=max(.,of x);
12   run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634749#M21245</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-25T13:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634750#M21246</link>
      <description>&lt;P&gt;I'm using SAS 9.2&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634750#M21246</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T13:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634752#M21247</link>
      <description>That version is 10 years old.  You are paying SAS. You can update your version.</description>
      <pubDate>Wed, 25 Mar 2020 13:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634752#M21247</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-25T13:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634753#M21248</link>
      <description>&lt;P&gt;I can execute your exact code without that error. Read what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;tells you. That's likely the issue here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try:&lt;/P&gt;
&lt;PRE&gt;  max_value = max(arrs_inst_2 - arrs_inst_&amp;amp;m.);
&lt;/PRE&gt;
&lt;P&gt;or...&lt;/P&gt;
&lt;PRE&gt;max(.,of array_name[*])&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634753#M21248</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-25T13:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634755#M21249</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/245095"&gt;@primmer3001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm using SAS 9.2&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Upgrade. NOW. Most of the software you get from others (and all the hints you get here on the Communities) is created with the current version.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 13:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634755#M21249</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T13:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Max with array has an issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634760#M21250</link>
      <description>I use SAS through work. They are currently in the process of moving to SAS Studio. I have a similar piece of cod ethat does work, but this one doesn't. Below is the other piece of inherited code but DOES work:-&lt;BR /&gt;&lt;BR /&gt;data final;&lt;BR /&gt;set cfs_instal_fca;&lt;BR /&gt;&lt;BR /&gt;%let prev_m = %sysevalf(&amp;amp;m.-1);&lt;BR /&gt;&lt;BR /&gt;array arrs_bal{0:&amp;amp;m.} amt_delq_0 - amt_delq_&amp;amp;m.;&lt;BR /&gt;array arrs_bal_inc{1:&amp;amp;m.} arrs_bal_inc_1 - arrs_bal_inc_&amp;amp;m.;&lt;BR /&gt;array arrs_inst{1:&amp;amp;m.} arrs_inst_1 - arrs_inst_&amp;amp;m.;&lt;BR /&gt;array min_pay{0:&amp;amp;prev_m.} amt_last_min_pymt_0 - amt_last_min_pymt_&amp;amp;prev_m.;&lt;BR /&gt;&lt;BR /&gt;do i=1 to &amp;amp;m.; j=i-1;&lt;BR /&gt;arrs_bal_inc{i} = arrs_bal{i} - arrs_bal{j};&lt;BR /&gt;arrs_inst{i} = arrs_bal_inc{i} / min_pay{j};&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;max_value=max(of arrs_inst{*});&lt;BR /&gt;&lt;BR /&gt;if round(max_value,0.00001)&amp;gt;=1 then whole_payment=1; else whole_payment=0;&lt;BR /&gt;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 25 Mar 2020 13:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Max-with-array-has-an-issue/m-p/634760#M21250</guid>
      <dc:creator>primmer3001</dc:creator>
      <dc:date>2020-03-25T13:53:56Z</dc:date>
    </item>
  </channel>
</rss>

