The SAS Output Delivery System and reporting techniques

Proc Report Call Define

Reply
Regular Contributor
Posts: 237

Proc Report Call Define

compute ENT_STATE;
if upcase(ENT_STATE) not in ('UP','') then
call define (_col_,'STYLE','style={background=#CD5916}');
endcomp;

hello, this works quite well, but actually i want to do this:

compute Tool;
if upcase(ENT_STATE) not in ('UP','') then
call define (_col_,'STYLE','style={background=#CD5916}');
endcomp;

so coloring one column depending on the value of an other variable, this doesn't work for me... any tips?

define Tool / display ;
define ExecBy/ display;
define Ent_State / display; Message was edited by: Filipvdr
N/A
Posts: 0

Re: Proc Report Call Define

Hello,




does the Tool variable is before ENT_STATE variable in your column statement?



Marius

Regular Contributor
Posts: 237

Re: Proc Report Call Define

Posted in reply to deleted_user
Yes

column OperSeq OpersAway Facility Lot_ID Operation PreferredTool OperParValue WaferstobeprocessedNr oCycleTime ExecBy OperOwner dpHold Holdnote ProcessEngineer Holdcode BatchEngineer Route Datim DaysOper Ent_State oper24 oper48;
/* Start Defining Columns */
define OperSeq / display ;
define OpersAway / display ;
define Facility / group;
define Lot_id /group;
define Operation / display width=15 FLOW;
define PreferredTool / display ;
define OperParValue / display ;
define WaferstobeprocessedNr / display ;
define oCycleTime/ display;
define ExecBy/ display noprint;
define OperOwner / display ;
define DpHold / display ;
define HoldNote / noprint ;
define ProcessEngineer / noprint ;
define HoldCode / noprint ;
define BatchEngineer / noprint ;
define Route / noprint ;
define Datim / display noprint ;
define DaysOper / display noprint ;
define Ent_State / display;


Tool = PreferredTool Message was edited by: Filipvdr
N/A
Posts: 0

Re: Proc Report Call Define

hello,



I don't see your Tool variable on the column statement, but anyway I will give an example based on alises which may help you in solving your issue. the key is to have the values of the variable in the if clause availabe before the vlues of the variable you are trying to "polish":



[pre]
proc report data=sashelp.class nowd ;
column name=name_n age sex name ;

define name_n / noprint;
define sex / width=5 center;

compute sex;
if upcase(name_n) not in ('Alfred','') then
call define (_col_,'STYLE','style={background=#CD5916}');
endcomp;

run;
[/pre]

Marius
Regular Contributor
Posts: 237

Re: Proc Report Call Define

Posted in reply to deleted_user
Ok, thanks, that worked.

Next question:

If the ent_state is not up, then i want PreferredTool (Ent_state) to be displayed

compute PreferredTool;
if upcase(ENT_STATE) not in ('UP','') then
call define (_col_,'STYLE','style={background=#CD5916}');
if upcase(ENT_STATE) not in ('UP','') then
PreferredTool = PreferredTool || "(" || ENT_STATE || ")" || ;
endcomp;
Regular Contributor
Posts: 237

Re: Proc Report Call Define

solved it by making this field in the dataset which is used Message was edited by: Filipvdr
Ask a Question
Discussion stats
  • 5 replies
  • 541 views
  • 0 likes
  • 2 in conversation