this is my code data want; set have;
do i=9 to nvars;
varname = vname(i);
newname = substr(varname,1,length(varname)-5);
rename varname = newname;
end;
drop i varname newname; the error: NOTE: Variable nvars is uninitialized.
WARNING: The variable varname in the DROP, KEEP, or RENAME list has never been referenced.
ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing, zero, or invalid. Note: the variables names from the 9th until the last one end with '_2017'. I want to remove that. There are 139 variables in total. 131 variables ending with '_2017' What am I doing wrong?
... View more