<?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 Reuse SAS Code to score new data set, Enterprise Miner in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Reuse-SAS-Code-to-score-new-data-set-Enterprise-Miner/m-p/502996#M753</link>
    <description>&lt;P&gt;Hey!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a HP Forest model in&amp;nbsp;SAS Enterprise&amp;nbsp;Miner&amp;nbsp;14.3&amp;nbsp;and I&amp;nbsp;want&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to use the same model to&amp;nbsp;&lt;SPAN&gt;score new data set on a daily basis&lt;/SPAN&gt;. The plan is to run the model in&amp;nbsp;Base SAS, so I am trying to check if the code is working properly in Enterprise Guide or Base SAS. I did the testing in the DATA step in SAS EG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data D702348.TEST_TEST_TEST;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set D702348.ML_ASK_SCORE_2;&lt;/P&gt;&lt;P&gt;run;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SASEM.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23927i37555A4E9E37882E/image-size/large?v=v2&amp;amp;px=999" role="button" title="SASEM.PNG" alt="SASEM.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied SAS Code from Score node (from Enterprise Miner) and ran it in SAS Enterprise Guide, I get several warnings and error messages:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SASEM_warns.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23926i79B733AD003C120A/image-size/large?v=v2&amp;amp;px=999" role="button" title="SASEM_warns.PNG" alt="SASEM_warns.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose I have to define some of the macro variables in order for my code to work, but I struggle to understand what are those variables and which of them I should define manually. This is the part of the SAS Code I struggle with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro em_hpfst_score;&lt;/P&gt;&lt;P&gt;%if %symexist(hpfst_score_input)=0 %then %let hpfst_score_input=&amp;amp;em_score_output;&lt;BR /&gt;%if %symexist(hpfst_score_output)=0 %then %let hpfst_score_output=&amp;amp;em_score_output;&lt;BR /&gt;%if %symexist(hpfst_id_vars)=0 %then %let hpfst_id_vars = _ALL_;&lt;/P&gt;&lt;P&gt;%let hpvvn= %sysfunc(getoption(VALIDVARNAME));&lt;BR /&gt;options validvarname=V7;&lt;BR /&gt;proc hp4score data=&amp;amp;hpfst_score_input;&lt;BR /&gt;id &amp;amp;hpfst_id_vars;&lt;BR /&gt;%if %symexist(EM_USER_OUTMDLFILE)=0 %then %do;&lt;BR /&gt;score file="C:\EMiner\ML\Workspaces\EMWS6\HPDMForest\OUTMDLFILE.bin" out=&amp;amp;hpfst_score_output;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;score file="&amp;amp;EM_USER_OUTMDLFILE" out=&amp;amp;hpfst_score_output;&lt;BR /&gt;%end;&lt;BR /&gt;PERFORMANCE DETAILS;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;options validvarname=&amp;amp;hpvvn;&lt;/P&gt;&lt;P&gt;data &amp;amp;hpfst_score_output;&lt;BR /&gt;set &amp;amp;hpfst_score_output;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to set&amp;nbsp;&lt;SPAN&gt;hpfst_score_input and&amp;nbsp;hpfst_score_output as&amp;nbsp;D702348.ML_ASK_SCORE_2 and&amp;nbsp;D702348.TEST_TEST_TEST respectively, but it didnt help much. I would really love to understand the meaning of those macro variables instead of just trying something until it possibly works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please help me to understand what I could have missed/misunderstood?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;sq&lt;/P&gt;</description>
    <pubDate>Wed, 10 Oct 2018 07:08:07 GMT</pubDate>
    <dc:creator>sq</dc:creator>
    <dc:date>2018-10-10T07:08:07Z</dc:date>
    <item>
      <title>Reuse SAS Code to score new data set, Enterprise Miner</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Reuse-SAS-Code-to-score-new-data-set-Enterprise-Miner/m-p/502996#M753</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a HP Forest model in&amp;nbsp;SAS Enterprise&amp;nbsp;Miner&amp;nbsp;14.3&amp;nbsp;and I&amp;nbsp;want&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to use the same model to&amp;nbsp;&lt;SPAN&gt;score new data set on a daily basis&lt;/SPAN&gt;. The plan is to run the model in&amp;nbsp;Base SAS, so I am trying to check if the code is working properly in Enterprise Guide or Base SAS. I did the testing in the DATA step in SAS EG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data D702348.TEST_TEST_TEST;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set D702348.ML_ASK_SCORE_2;&lt;/P&gt;&lt;P&gt;run;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SASEM.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23927i37555A4E9E37882E/image-size/large?v=v2&amp;amp;px=999" role="button" title="SASEM.PNG" alt="SASEM.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied SAS Code from Score node (from Enterprise Miner) and ran it in SAS Enterprise Guide, I get several warnings and error messages:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SASEM_warns.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23926i79B733AD003C120A/image-size/large?v=v2&amp;amp;px=999" role="button" title="SASEM_warns.PNG" alt="SASEM_warns.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose I have to define some of the macro variables in order for my code to work, but I struggle to understand what are those variables and which of them I should define manually. This is the part of the SAS Code I struggle with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro em_hpfst_score;&lt;/P&gt;&lt;P&gt;%if %symexist(hpfst_score_input)=0 %then %let hpfst_score_input=&amp;amp;em_score_output;&lt;BR /&gt;%if %symexist(hpfst_score_output)=0 %then %let hpfst_score_output=&amp;amp;em_score_output;&lt;BR /&gt;%if %symexist(hpfst_id_vars)=0 %then %let hpfst_id_vars = _ALL_;&lt;/P&gt;&lt;P&gt;%let hpvvn= %sysfunc(getoption(VALIDVARNAME));&lt;BR /&gt;options validvarname=V7;&lt;BR /&gt;proc hp4score data=&amp;amp;hpfst_score_input;&lt;BR /&gt;id &amp;amp;hpfst_id_vars;&lt;BR /&gt;%if %symexist(EM_USER_OUTMDLFILE)=0 %then %do;&lt;BR /&gt;score file="C:\EMiner\ML\Workspaces\EMWS6\HPDMForest\OUTMDLFILE.bin" out=&amp;amp;hpfst_score_output;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;score file="&amp;amp;EM_USER_OUTMDLFILE" out=&amp;amp;hpfst_score_output;&lt;BR /&gt;%end;&lt;BR /&gt;PERFORMANCE DETAILS;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;options validvarname=&amp;amp;hpvvn;&lt;/P&gt;&lt;P&gt;data &amp;amp;hpfst_score_output;&lt;BR /&gt;set &amp;amp;hpfst_score_output;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to set&amp;nbsp;&lt;SPAN&gt;hpfst_score_input and&amp;nbsp;hpfst_score_output as&amp;nbsp;D702348.ML_ASK_SCORE_2 and&amp;nbsp;D702348.TEST_TEST_TEST respectively, but it didnt help much. I would really love to understand the meaning of those macro variables instead of just trying something until it possibly works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please help me to understand what I could have missed/misunderstood?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;sq&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 07:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Reuse-SAS-Code-to-score-new-data-set-Enterprise-Miner/m-p/502996#M753</guid>
      <dc:creator>sq</dc:creator>
      <dc:date>2018-10-10T07:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reuse SAS Code to score new data set, Enterprise Miner</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Reuse-SAS-Code-to-score-new-data-set-Enterprise-Miner/m-p/503497#M833</link>
      <description>&lt;P&gt;Hello SQ-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The score code that is created by the HP Forest node includes a PROC HP4SCORE invocation - the code cannot be executed unless Enterprise Miner is installed on the machine that does the scoring.&amp;nbsp; (I.e., you cannot use just Base SAS to execute the score code.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are some details within Enterprise Miner under Help -&amp;gt; Contents -&amp;gt; Node Reference -&amp;gt; HPDM Nodes -&amp;gt; HP Forest Node -&amp;gt; HP Forest Node Requirements.&amp;nbsp; The Example section of that chapter shows how you can use code for scoring - see Step 6 and beyond.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your interest!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 17:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Reuse-SAS-Code-to-score-new-data-set-Enterprise-Miner/m-p/503497#M833</guid>
      <dc:creator>MikeStockstill</dc:creator>
      <dc:date>2018-10-11T17:51:59Z</dc:date>
    </item>
  </channel>
</rss>

