Hi everyone,
I am fairly new to Proc Report and am struggling with a requirement. I am using ODS to output a dataset to Excel, and I need to conditionally format a cell based on the value of another variable. (My code is below).
Requirement: If the value of visnd = 1 then the FU30DALD variable should be grey for that row. The whole row shouldn't be grey, just that cell under FU30DALD.
My dataset contains all the variables I am referencing in the compute block.
I have this error in my log:
"ERROR: Invalid column specification in CALL DEFINE" with "NOTE: Argument 1 to function DEFINE(' '[12 of 100 characters shown],'style','style={backg'[12 of 27 characters shown]) at line 2 column 7 is invalid."
Any guidance is appreciated!
Current code:
proc report data=final nowd headline headskip spacing=3 split='|' missing ls=256 ps=42 ;
column dummy1 _all_ ;
define dummy1 / noprint;
define FU30DALD / display;
define visnd / display;
*if FU30 not done then grey out the FU30DALD cell;
compute dummy1;
if (visnd = 1) then do;
call define (FU30DALD,'style','style={background=lightgray}');
end;
endcomp;
run;
Does your variable FU30DALD ever have the value "12 of 100 characters shown" or have a format that would show that?
From the documentation:
specifies a column name or a column number (that is, the position of the column from the left edge of the report). A column ID can be one of the following:
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.