Ok, the quotes around the 10 were simply to indicate I knew the macro is text, not a literal numeric.
The macro variable does resolve correctly.
Sorry, cutting and pasting both code and results is ridiculous with SAS University, I have tried to attach a code, log and results as a file below (failed I guess). There is a lot of stuff there, my question is limited to definition of the array size.
data size ;
set treefreq end=eof ;
if eof = 1 then do ;
call symput("SIZE_NEEDED",_N_) ;
output ;
end ;
proc print ;
title "Size Needed is &size_needed" ;
That works perfectly and &size_needed prints correctly as 11 (the correct value).
This is my question on immediately following code:
data two ;
set treefreq ;
array countree {*} count_1 - count_&size_needed ; ***<<<this fails immediately****;
run ;
The error I get in the log is:
ERROR: MISSING NUMERIC SUFFIX ON NUMBERED VARIABLE LIST (count_1 - count_ )
I figure because text does not resolve as numeric. Like I said I tried a couple of things -- putting in periods to get resolution but nothing worked. I am not referencing the array correctly in some way.
How do I use a macro variable to reference an array element ?
... View more