Hi,
I am trying to implementing a treeboost procedure for my dataset.
modevals is the dataset that consists of the variables that I want to use for the treeboost.
ParamList consists of the list of variable names.
I am getting the error "The %DO statement is not valid in open code" when I run the below code.
PROC TREEBOOST data=modelvals
CATEGORICALBINS=6
INTERVALBINS=20
EXHAUSTIVE=100
INTERVALDECIMALS= MAX
MAXDEPTH = 3
MAXBRANCH = 5
leafsize=15
Iterations=2000
Mincatsize=10
seed=n
TRAINPROPORTION = 0.5
SHRINKAGE=0.1
SPLITSIZE=30;
%let i = 1;
%let token = %scan(&ParamList,&i);
%do %while(%length(&token));
INPUT &TOKEN/MISSING=BIGBRANCH MAXBRANCHES=2;
%let i = %eval(&i+1);
%let token = %scan(&ParamList,&i);
%end;
Target TARGET_VARIABLE /level=binary;
SUBSERIES LONGEST;
SAVE FIT=X._fit MODEL=ABC.X._mdl RULES=ABC.X._rul nodestats=ABC.X._nod IMPORTANCE=imp;
run;
Please help.
Regards,
Bond
%do %while is only allowed in a macro. You need to create a macro and execute it (partial code):
SPLITSIZE=30;
%macro mymac;
%let i = 1;
%let token = %scan(&ParamList,&i);
%do %while(%length(&token));
INPUT &TOKEN/MISSING=BIGBRANCH MAXBRANCHES=2;
%let i = %eval(&i+1);
%let token = %scan(&ParamList,&i);
%end;
%mend;
%mymac
Target TARGET_VARIABLE /level=binary;
%do %while is only allowed in a macro. You need to create a macro and execute it (partial code):
SPLITSIZE=30;
%macro mymac;
%let i = 1;
%let token = %scan(&ParamList,&i);
%do %while(%length(&token));
INPUT &TOKEN/MISSING=BIGBRANCH MAXBRANCHES=2;
%let i = %eval(&i+1);
%let token = %scan(&ParamList,&i);
%end;
%mend;
%mymac
Target TARGET_VARIABLE /level=binary;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.