sas error: hpspit was unable to open the rules file for output
Emily Wong
I am getting the below error when i am running 'proc hpsplit' in sas to create a decision tree.
sas error: hpspit was unable to open the rules file for outputMy code is -
proc hpsplit data=sashelp.hmeq maxdepth=7 maxbranch=2;
target BAD;
input DELINQ DEROG JOB NINQ REASON / level=nom;
input CLAGE CLNO DEBTINC LOAN MORTDUE VALUE YOJ / level=int;
criterion entropy;
prune misc / N <= 6;
partition fraction(validate=0.2);
rules file='hpsplhme2-rules.txt';
score out=scored2;
run;But if I change the statement 'rules file' declaration to the below -
rules file="%sysfunc(pathname(work))/rule.txt";It runs fine in this case but then i am unable to view the rule.txt file. Please suggest a way i can view the file or any other way i can proceed.
22 Answers
rules file='hpsplhme2-rules.txt'; will not necessarily write to work; it depends on what your default directory is in the current session. It's usually not WORK in my experience. If you're running SAS in DM mode it's whatever is in the bottom right of the window (for my installation the default is my User directory, i.e. C:\Users\myusername). But it can be anywhere, just depends on where your admin set it up to be, and if you executed any cd commands in the code.
The answer here is to fully qualify your path name. If you're running this on a server, make sure that path is a path you can write to from the server (not "c:\something" probably).
It could be as simple as
options noxwait noxsync xmin;
%sysexec start "Preview output" "%sysfunc(pathname(WORK))\temp.txt"
;If simple does not work the solution depends on your SAS client and the SAS host security policies.