Hi: What is actually happening is that HEIGHT is being treated as an ANALYSIS variable with a default statistic of SUM. In the COMPUTE block, you are NOT trying to use HEIGHT as a 'temporary" variable, it is being referred to incorrectly in the COMPUTE block. In a COMPUTE block any reference to an existing numeric variable MUST use a COMPOUND name of variable.statistic, as explained here, in the doc: Base SAS(R) 9.3 Procedures Guide, Second Edition Look at the section entitled: "Four Ways to Reference Report Items in a Compute Block". You can use temporary items in a COMPUTE block, but in the code below, HEIGHT is a report item coming from the dataset and HEIGHT.SUM is the compound name that must be used in the COMPUTE block to change the style. So, for example, if you try this alternate code, you will see that the error goes away. I changed the CALL DEFINE to use a simple style override, since not everybody has kermit.gif on their system. In the code below the use of the simple reference to HEIGHT will get a note in the log for #2 and #3, the correct reference to HEIGHT.SUM (not a temporary item) will not generate a message. cynthia ods _all_ close; ods html file='c:\temp\geterror.html'; proc report data=sashelp.class nowd; title1 '1) Will Get Error'; column name age sex height weight; define name / order 'Name'; define height / 'Height'; compute height; if height gt 55 then call define(_col_,'style','style={background=lightgreen}'); endcomp; run; proc report data=sashelp.class nowd; title1 '2) Will NOT Get Error'; column name age sex height weight; define name / order 'Name'; define height / 'Height'; compute height; if height.sum gt 55 then call define(_col_,'style','style={background=lightgreen}'); endcomp; run; proc report data=sashelp.class nowd; title1 '3) Will NOT Get Error'; column name age sex height weight; define name / order 'Name'; define height / 'Height'; compute height; if height.sum gt 55 then call define(_col_,'style','style={postimage="c:\temp\arrow.gif"}'); endcomp; run; ods html close;
... View more