SAS中文论坛

标题: 求助! sas report中关于compute的问题 [打印本页]

作者: wx_XuQ7vwH1    时间: 2016-7-26 09:19
标题: 求助! sas report中关于compute的问题
data test;
        a = "x123";
        b = " X123";
        c = 1;
run;
ods listing close;                                       
ods tagsets.ExcelXP
    file = "\\cnbej-vsfs02\data1\Users\q823268\test_&sysdate9..xml"
    style=sasweb;

ods tagsets.ExcelXP options(sheet_name='test' orientation='landscape' embedded_titles='yes'
        autofit_height='yes' Frozen_Headers='9' row_repeat='1-9' AutoFilter='All' FitToPage='yes'
        Pages_FitWidth='1' Pages_FitHeight='300' zoom='70' absolute_column_width='17');
proc report data=test nowd headline headskip missing spacing=5 split='*';

        Columns  a b c;
        Define a        / Display;
        Define b        / Display;
        Define c        / Display;

        Compute a;
                if c = 1 then call define(_COL_,"style","style=[background=green foreground=white]");
                else call define(_COL_,"style","style=[background=orange]");
        Endcomp;
        Compute b;
                if c = 1 then call define(_COL_,"style","style=[background=green foreground=white]");
                else call define(_COL_,"style","style=[background=orange]");
        Endcomp;
        Compute c;
        if c = 1 then call define(_COL_,"style","style=[background=green foreground=white]");
        else call define(_COL_,"style","style=[background=orange]");
Endcomp;

Run;
ods tagsets.ExcelXP close;
ods listing;


为什么出来的结果 a b颜色是orange, c是green呢




欢迎光临 SAS中文论坛 (http://www.mysas.net/forum/) Powered by Discuz! X3.2