<?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: How to save over-session an astore model in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939719#M368943</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127222"&gt;@acordes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Now it works,&lt;/P&gt;
&lt;P&gt;just added these lines to save as sashdat to recover later.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had made these before but with the compress option in the save statement, not a good idea for astores...&lt;/P&gt;
&lt;P&gt;.... stuff deleted ...&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Excellent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now mark your own second note as the solution, so people know that there is a solution.&lt;/P&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>Sat, 17 Aug 2024 02:52:07 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2024-08-17T02:52:07Z</dc:date>
    <item>
      <title>How to save over-session an astore model</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939650#M368923</link>
      <description>&lt;P&gt;The following code works and derives a score as expected, even the download and upload execute without errors and show the expected results.&lt;/P&gt;
&lt;P&gt;BUT when I close the session and come back, I cannot re-activate the scoring code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How Do I make it survive the session?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
cas mySession sessopts=(caslib='casuser');
PROC CAS;
regression.glm
      table={name='rema', caslib='casuser', groupby={'_brand'}, where=" _o_sales_res ne .", 
                                                           computedvars='months_since_covid', 
                                                           computedvarsprogram="months_since_covid= intck('month', '15mar2020'd, today())"},
      class={{name={'/msi_model\b|_gama_agg\b/'}}
},
      model={ depVar='RMNVALORVENTA',
              effects={{ vars='/_gama_agg|MESES_EFECTIVOS|_o_actual_mileage/'
interact='bar'   ,maxinteract=1 }
, {vars={ 'poly'}}
}},       
selection={method='forward'}, spline={{basis="BSPLINE",
dataBoundary=false, degree=2, vars={'months_since_covid'}, name="spl"}
}, 
polynomial={{
degree=2,
mdegree=2,
details=TRUE,
labelStyle={
expand=TRUE
exponent="^"
includeName=TRUE
productSymbol="NONE"
},
name='poly',
vars={"MESES_EFECTIVOS"}
}},
      output={casOut={name='out1', replace=true},  
              copyVars="ALL_MODEL",
              pred='pred', resid='resid', role='role'}, outputtables={includeall=true, replace=true} 
store={name='myModel', replace=true};
run;

proc cas;
   regression.glmScore
      restore='myModel',
/*       restore={caslib='casuser', name='VR_ABS_SIMPLE'}, */
      table={name='rema', caslib='casuser', groupby={'_brand'}, where="1=1"},
      fitData='false',
      casOut={name='out2', replace=true, caslib='mkt'},
/*     copyVars="ALL", */
      pred='pred', resid='resid', rstudent='rstudent';
run;

proc astore;
describe rstore=casuser.MYMODEL ;
quit;

proc astore;
download rstore=casuser.MYMODEL
store='VR_ABS_SIMPLE';
quit;

proc astore;
upload rstore=casuser.model_restored
store='VR_ABS_SIMPLE';
describe rstore=casuser.model_restored;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Aug 2024 15:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939650#M368923</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2024-08-16T15:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to save over-session an astore model</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939651#M368924</link>
      <description>&lt;P&gt;Now it works,&lt;/P&gt;
&lt;P&gt;just added these lines to save as sashdat to recover later.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had made these before but with the compress option in the save statement, not a good idea for astores...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let DEST_LIB=casuser; /* The CAS library where the destination data should go */
%let DEST_DATA=MYMODEL; /* The CAS table name where the destination data should go */

proc casutil;
  Save casdata="&amp;amp;DEST_DATA" incaslib="&amp;amp;DEST_LIB" casout="&amp;amp;DEST_DATA%str(.)sashdat" outcaslib="Models" replace;
Quit;

proc casutil;
load casdata="MYMODEL.sashdat" incaslib="Models"
casout="VR_ABS_SIMPLE" outcaslib="casuser" replace;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Aug 2024 15:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939651#M368924</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2024-08-16T15:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to save over-session an astore model</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939719#M368943</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127222"&gt;@acordes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Now it works,&lt;/P&gt;
&lt;P&gt;just added these lines to save as sashdat to recover later.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had made these before but with the compress option in the save statement, not a good idea for astores...&lt;/P&gt;
&lt;P&gt;.... stuff deleted ...&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Excellent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now mark your own second note as the solution, so people know that there is a solution.&lt;/P&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>Sat, 17 Aug 2024 02:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-over-session-an-astore-model/m-p/939719#M368943</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-08-17T02:52:07Z</dc:date>
    </item>
  </channel>
</rss>

