Hi:
Well, here are some questions... Here's your column statement:
[pre]
COLUMNS dx bx s col1-col8 tempo;
[/pre]
I'm not sure why you even need TEMPO on the report. You want to highlight one of the 8 numbered columns, COL1-COL8, correct???
The first argument to CALL DEFINE should usually be quoted. (the exceptions are _COL_ and _ROW_ -- all other references are quoted.) So that's just one reason why the CALL DEFINE is not working. Right now, it looks like you're trying to highlight the variable TEMPO, but since TEMPO is NOPRINT, that doesn't make sense and besides, PROC REPORT would expect to see 'TEMPO' in quotes, which still doesn't make sense from what you describe.
As it describes here in the doc:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473624.htm
values for column ID (first argument to CALL DEFINE) can only be
_ROW_ (which signifies that the entire report row should have some attribute changed via CALL DEFINE) or...
A column ID can be one of the following:
--a character literal (in quotation marks) that is the column name
--a character expression that resolves to the column name
--a numeric literal that is the column number
--a numeric expression that resolves to the column number
--a name of the form '_Cn_', where n is the column number
--the automatic variable _COL_, which identifies the column that contains the report item that the compute block is attached to
It looks to me like you're trying to parse out what is in the S variable and then
use the number to indicate which column to highlight. You could use a character expression to append the number that you parse from S to the string 'COL', but that expression would be something like this:
[pre]
COMPUTE s;
*****some kind of loop, where I is the counter....;
if left(scan(s,i,' ,')) gt ' ' then do;
CALL DEFINE('col'||put(scan(s,i,' ,'),1.0)||'.sum',
'style','style={background=CXcccccc}');
END;
***** end of whatever loop.....;
ENDCOMP;
[/pre]
For example, in the above DO loop, let's say the value of S was 5,6. When I is 2, then the second value from the scan will be 6. So now, you want to build the CALL DEFINE (out of the character expression) as though it was:
CALL DEFINE('COL6.SUM','style','....style info');
After the expression is resolved, PROC REPORT now knows that COL6.SUM is the variable column that gets highlighted.
I show the suffix ".sum" appended, because if those variables are numeric, then the appropriate way to refer to them in the CALL DEFINE is with .SUM appended. Since I didn't know what your data looked like, I figured that one possible value for S could be:
1,2,3,4,5,6,7,8 and another could be 1,3 or 5,6,7. If you only have COL1-COL8 that need to be highlighted, you're not going to ever find variable S with a value of 1,87,43???
This is one of those instances where an example of the data and a more SPECIFIC description of what you want to see in the final report would be immensely helpful. For example, I imagine that you might have data that looks like this:
[pre]
DX BX S col1 col2 col3 col4 col5 col6 col7 col8
111 aaa 1,3 10 20 30 40 50 60 70 80
111 bbb 3,4 11 21 31 41 51 61 71 81
222 aaa 5,6 12 22 33 44 55 66 77 88
[/pre]
I didn't understand your original statement that:
The problem I am trying to solved is that the shading of an indivdual cell isn't related to the value in the cell. It's related to the intersection of the column label and the value in the variable col1.
I don't see that you're ever testing the value of the COL1 variable.
Can you explain a bit more or show some made up data and clarify whether COL1-COL8 are character or numeric?? And clarify HOW you're testing the value in COL1???
cynthia