Hi,
I have test program and want to control the style of one field based on the value of another field in Proc report. The program I wrote to test this is below. The computed block doesn't work as the value of topzip is uninitialized. But it appears in the check debug file. ?
Thanks!
--Ben
data pcts; input cust pct zip; topzip+1; if lag(cust)^=cust then topzip=1; cards; 1 53 43058 1 17 43220 1 12 43235 1 7 43081 1 4 43214 ;;; proc format; picture pct low-high= '000% of your clients reside in '; run; ods escapechar='^'; options papersize=(1.5in 2.4in); proc report data=pcts split='\' out=check; by cust; column square pct zip topzip; define topzip /noprint; define pct /display format=pct. '^{unicode ''2605''x}' color=red width=10 flow right; define zip /display 'You are located here' color=red left; define square /display computed '';
compute square /character length=20; square='^{unicode ''220e''x}'; if topzip=1 then call define('square','style','style={color=red}'); if topzip=2 then call define('square','style','style={color=green}'); if topzip=3 then call define('square','style','style={color=black}'); if topzip=4 then call define('square','style','style={color=orange}'); if topzip=5 then call define('square','style','style={color=blue}'); endcomp; run;
... View more