I have to run K-fold validation and i am writing a code in SAS node for creating 10 folds. Code is as below: data MyLib.selection; call streaminit(12345); set &em_import_data; urand=rand('uniform'); proc sort data=MyLib.selection; by urand; data &em_export_train; drop fold_size urand; set MyLib.selection NOBS=nobs_; fold_size=round(nobs_/10); if _N_<= fold_size then fold='A'; if _N_> fold_size and _N_<=2*foold_size then fold='B'; if _N_ >2*fold_size and _N_<=3*fold_size then fold='C'; if _N_ >3*fold_size and _N_<=4*fold_size then fold='D'; if _N_ >4*fold_size and _N_<=5*fold_size then fold='E'; if _N_ >5*fold_size and _N_<=6*fold_size then fold='F'; if _N_ >6*fold_size and _N_<=7*fold_size then fold='G'; if _N_ >7*fold_size and _N_<=8*fold_size then fold='H'; if _N_ >8*fold_size and _N_<=9*fold_size then fold='I'; if _N_ >9*fold_size then fold='J'; proc means data=&em_export_train; by fold; run; But I am getting this error : ERROR: Write access to member EMWS1.EMCODE_TRAIN.DATA is denied 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 = ''.
... View more