<?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: bining action score code issue: ERROR: Insufficient resources to perform the operation. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/933075#M367008</link>
    <description>&lt;P&gt;I think runCodeTable will do it.&amp;nbsp;&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_050/caspg/cas-datastep-runcodetable.htm" target="_blank"&gt;SAS Help Center: runCodeTable Action&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
   datastep.runcodetable /                                     
     codeTable="scory"                                       
     casout={name="ac_test ", caslib="dna"}                                           
     table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna"}        
     /* dropvars= */                                     
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, you could try dumping the scoring code to the temp file yourself and running your original dataStep.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   file score;
   set casuser.scory;
   put DataStepSrc;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Jun 2024 02:54:47 GMT</pubDate>
    <dc:creator>DerylHollick</dc:creator>
    <dc:date>2024-06-20T02:54:47Z</dc:date>
    <item>
      <title>bining action score code issue: ERROR: Insufficient resources to perform the operation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/930672#M366154</link>
      <description>&lt;P&gt;I run into this error when I use the codegen technique, for 1 groupby variables it works, but if I add a second one it fails.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without the code gen option it still works, but I need the code option for scoring purpose.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME SCORE TEMP; 
proc cas;                                             
    datapreprocess.binning result=r /                      
      	table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna", groupby={'combustible'}, 
					groupByMode="REDISTRIBUTE",
				where="((orig='data_in' and last_event) or orig='toscore') and (0 &amp;lt; _KMJEREAL_Max &amp;lt; 200000)"}
      		inputs={"PotenCV", "EmisioCO2"}
   		code={comment=true, tabForm=true}
			method="quantile" nBinsArray={3, 3}
;
run;
	print r;
run; 
   saveresult r['CodeGen'] file=score;        
run;

proc cas;
  code = readfile("score");                 
 dscode = 
   "data DNA.ac_test;
     set DNA.AUTO_SEGURO_LEARNER_V11;" 
     || code ||
"
keep bin: PotenCV EmisioCO2;

run;";
run;
dataStep.runCode / code = dscode;         
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What does not work although I only add one more groupby variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

FILENAME SCORE TEMP; 
proc cas;                                             
    datapreprocess.binning result=r /                      
      	table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna", groupby={'from_brand', 'combustible'}, 
					groupByMode="REDISTRIBUTE",
				where="((orig='data_in' and last_event) or orig='toscore') and (0 &amp;lt; _KMJEREAL_Max &amp;lt; 200000)"}
      		inputs={"PotenCV", "EmisioCO2"}
   		code={comment=true, tabForm=true}
			method="quantile" nBinsArray={3, 3}
;
run;
	print r;
run; 
   saveresult r['CodeGen'] file=score;        
run;

proc cas;
  code = readfile("score");                 
 dscode = 
   "data DNA.ac_test;
     set DNA.AUTO_SEGURO_LEARNER_V11;" 
     || code ||
"
keep bin: PotenCV EmisioCO2 from_brand combustible;

run;";
run;
dataStep.runCode / code = dscode;         
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The error appears:&amp;nbsp;ERROR: Insufficient resources to perform the analytic operation.&lt;/P&gt;
&lt;P&gt;If I skip the code block, it still works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;                                             
    datapreprocess.binning result=r /                      
      	table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna", groupby={'from_brand', 'combustible'}, 
					groupByMode="REDISTRIBUTE",
				where="((orig='data_in' and last_event) or orig='toscore') and (0 &amp;lt; _KMJEREAL_Max &amp;lt; 200000)"}
      		inputs={"PotenCV", "EmisioCO2"}
/*    		code={comment=true, tabForm=true} */
			method="quantile" nBinsArray={3, 3}
;
run;
	print r;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jun 2024 18:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/930672#M366154</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2024-06-03T18:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: bining action score code issue: ERROR: Insufficient resources to perform the operation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/931574#M366469</link>
      <description>&lt;P&gt;If the scoring is limited to just a few observations does it complete?&amp;nbsp;&amp;nbsp;If so, at least we know the generated code should be sound for the two groupby case and some resource limit is indeed most likely being hit.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"data DNA.ac_test;
    set DNA.AUTO_SEGURO_LEARNER_V11;
    if _N_ &amp;lt;= 10;"  
    || code ||
"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try reducing the resources used during scoring by only reading in the needed variables and compressing the output table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"data DNA.ac_test (compress=yes);
   set DNA.AUTO_SEGURO_LEARNER_V11 (keep=PotenCV EmisioCO2 from_brand combustible);" 
   || code ||
"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if the scoring code is not being used elsewhere, you could let the binning action do the scoring.&amp;nbsp;&amp;nbsp;It may be just doing the same thing behind-the-scenes and not make any difference, but it's worth a try.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;                                             
    datapreprocess.binning result=r /                      
         table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna", groupby={'from_brand', 'combustible'}, 
               groupByMode="REDISTRIBUTE",
            where="((orig='data_in' and last_event) or orig='toscore') and (0 &amp;lt; _KMJEREAL_Max &amp;lt; 200000)"}
            inputs={"PotenCV", "EmisioCO2"}
/*          code={comment=true, tabForm=true} */
         method="quantile" nBinsArray={3, 3}
      includeInputVars=TRUE
      casout={name="ac_test", caslib="DNA", replace=true /*, compress=true, replication=0*/}
;
run;
   print r;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 15:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/931574#M366469</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2024-06-10T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: bining action score code issue: ERROR: Insufficient resources to perform the operation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/931691#M366525</link>
      <description>&lt;P&gt;Thanks for your reply.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error happens while trying to generate the code file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Insufficient resources to perform the analytic operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In other circunstances (applied to a different table with other group by variables) the code works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The faulty code even works when I leave only one group by variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scoring the current table does not suffice. I need the scoring code. I could generate the score code in a caslib table, but then I don't succeed in referencing the caslib table with when I use the score code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, this one works, but how can I use casuser.scory table for scoring purpose?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME SCORE TEMP; 
cas mySession sessopts=(caslib="casuser");
proc cas;                                             
    datapreprocess.binning result=r /                      
      	table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna", groupby={'from_brand', 'combustible'}, 
					groupByMode="REDISTRIBUTE",
				where="((orig='data_in' and last_event) or orig='toscore') and (0 &amp;lt; _KMJEREAL_Max &amp;lt; 200000)"}
      		inputs={"PotenCV", "EmisioCO2"}
   		code={comment=true, casout='scory'}
			method="quantile" nBinsArray={3, 3}
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 12:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/931691#M366525</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2024-06-11T12:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: bining action score code issue: ERROR: Insufficient resources to perform the operation.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/933075#M367008</link>
      <description>&lt;P&gt;I think runCodeTable will do it.&amp;nbsp;&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_050/caspg/cas-datastep-runcodetable.htm" target="_blank"&gt;SAS Help Center: runCodeTable Action&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
   datastep.runcodetable /                                     
     codeTable="scory"                                       
     casout={name="ac_test ", caslib="dna"}                                           
     table={name="AUTO_SEGURO_LEARNER_V11", caslib="dna"}        
     /* dropvars= */                                     
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, you could try dumping the scoring code to the temp file yourself and running your original dataStep.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   file score;
   set casuser.scory;
   put DataStepSrc;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2024 02:54:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bining-action-score-code-issue-ERROR-Insufficient-resources-to/m-p/933075#M367008</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2024-06-20T02:54:47Z</dc:date>
    </item>
  </channel>
</rss>

