<?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 SAS Enterprise Miner: SAS Code. in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Enterprise-Miner-SAS-Code/m-p/534676#M7651</link>
    <description>&lt;P&gt;I have to run K-fold validation and i am writing a code in SAS node for creating 10 folds.&lt;/P&gt;&lt;P&gt;Code is as below:&lt;/P&gt;&lt;P&gt;data MyLib.selection;&lt;BR /&gt;call streaminit(12345);&lt;BR /&gt;set &amp;amp;em_import_data;&lt;BR /&gt;urand=rand('uniform');&lt;BR /&gt;proc sort data=MyLib.selection;&lt;BR /&gt;by urand;&lt;BR /&gt;data &amp;amp;em_export_train;&lt;BR /&gt;drop fold_size urand;&lt;BR /&gt;set MyLib.selection NOBS=nobs_;&lt;BR /&gt;fold_size=round(nobs_/10);&lt;BR /&gt;if _N_&amp;lt;= fold_size then fold='A';&lt;BR /&gt;if _N_&amp;gt; fold_size and _N_&amp;lt;=2*foold_size then fold='B';&lt;BR /&gt;if _N_ &amp;gt;2*fold_size and _N_&amp;lt;=3*fold_size then fold='C';&lt;BR /&gt;if _N_ &amp;gt;3*fold_size and _N_&amp;lt;=4*fold_size then fold='D';&lt;BR /&gt;if _N_ &amp;gt;4*fold_size and _N_&amp;lt;=5*fold_size then fold='E';&lt;BR /&gt;if _N_ &amp;gt;5*fold_size and _N_&amp;lt;=6*fold_size then fold='F';&lt;BR /&gt;if _N_ &amp;gt;6*fold_size and _N_&amp;lt;=7*fold_size then fold='G';&lt;BR /&gt;if _N_ &amp;gt;7*fold_size and _N_&amp;lt;=8*fold_size then fold='H';&lt;BR /&gt;if _N_ &amp;gt;8*fold_size and _N_&amp;lt;=9*fold_size then fold='I';&lt;BR /&gt;if _N_ &amp;gt;9*fold_size then fold='J';&lt;BR /&gt;proc means data=&amp;amp;em_export_train;&lt;BR /&gt;by fold;&lt;BR /&gt;run;&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;&lt;P&gt;But I am getting this error :&lt;/P&gt;&lt;P&gt;ERROR: Write access to member EMWS1.EMCODE_TRAIN.DATA is denied&lt;/P&gt;&lt;P&gt;ERROR: Data set EMWS1.EMCODE_TRAIN is not sorted in ascending sequence. The current BY group has fold = A and the next BY group has fold = ''.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 01:33:55 GMT</pubDate>
    <dc:creator>Ayan_Patel</dc:creator>
    <dc:date>2019-02-12T01:33:55Z</dc:date>
    <item>
      <title>SAS Enterprise Miner: SAS Code.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Enterprise-Miner-SAS-Code/m-p/534676#M7651</link>
      <description>&lt;P&gt;I have to run K-fold validation and i am writing a code in SAS node for creating 10 folds.&lt;/P&gt;&lt;P&gt;Code is as below:&lt;/P&gt;&lt;P&gt;data MyLib.selection;&lt;BR /&gt;call streaminit(12345);&lt;BR /&gt;set &amp;amp;em_import_data;&lt;BR /&gt;urand=rand('uniform');&lt;BR /&gt;proc sort data=MyLib.selection;&lt;BR /&gt;by urand;&lt;BR /&gt;data &amp;amp;em_export_train;&lt;BR /&gt;drop fold_size urand;&lt;BR /&gt;set MyLib.selection NOBS=nobs_;&lt;BR /&gt;fold_size=round(nobs_/10);&lt;BR /&gt;if _N_&amp;lt;= fold_size then fold='A';&lt;BR /&gt;if _N_&amp;gt; fold_size and _N_&amp;lt;=2*foold_size then fold='B';&lt;BR /&gt;if _N_ &amp;gt;2*fold_size and _N_&amp;lt;=3*fold_size then fold='C';&lt;BR /&gt;if _N_ &amp;gt;3*fold_size and _N_&amp;lt;=4*fold_size then fold='D';&lt;BR /&gt;if _N_ &amp;gt;4*fold_size and _N_&amp;lt;=5*fold_size then fold='E';&lt;BR /&gt;if _N_ &amp;gt;5*fold_size and _N_&amp;lt;=6*fold_size then fold='F';&lt;BR /&gt;if _N_ &amp;gt;6*fold_size and _N_&amp;lt;=7*fold_size then fold='G';&lt;BR /&gt;if _N_ &amp;gt;7*fold_size and _N_&amp;lt;=8*fold_size then fold='H';&lt;BR /&gt;if _N_ &amp;gt;8*fold_size and _N_&amp;lt;=9*fold_size then fold='I';&lt;BR /&gt;if _N_ &amp;gt;9*fold_size then fold='J';&lt;BR /&gt;proc means data=&amp;amp;em_export_train;&lt;BR /&gt;by fold;&lt;BR /&gt;run;&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;&lt;P&gt;But I am getting this error :&lt;/P&gt;&lt;P&gt;ERROR: Write access to member EMWS1.EMCODE_TRAIN.DATA is denied&lt;/P&gt;&lt;P&gt;ERROR: Data set EMWS1.EMCODE_TRAIN is not sorted in ascending sequence. The current BY group has fold = A and the next BY group has fold = ''.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 01:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Enterprise-Miner-SAS-Code/m-p/534676#M7651</guid>
      <dc:creator>Ayan_Patel</dc:creator>
      <dc:date>2019-02-12T01:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise Miner: SAS Code.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Enterprise-Miner-SAS-Code/m-p/534886#M7653</link>
      <description>&lt;P&gt;When I tried your code, I only got the 2nd error, and to fix that, you just need to add a PROC SORT before the PROC MEANS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=&amp;amp;em_export_train;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;by fold;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure why you would be getting the write access error.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 15:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Enterprise-Miner-SAS-Code/m-p/534886#M7653</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2019-02-12T15:48:08Z</dc:date>
    </item>
  </channel>
</rss>

