全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1690 1
2016-07-26
为什么下面的代码输出的结果 a, b是orange, c是green呢?



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;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-7-26 14:40:59
问题解决了
data test;
        c = 1;
        a = "x123";
        b = " X123";

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  c a b;
        Define c        / Display;
        Define a        / Display;
        Define b        / Display;
       
        Compute c;
                if c = 1 then call define(_COL_,"style","style=[background=green foreground=white]");
                else call define(_COL_,"style","style=[background=orange]");
        Endcomp;
        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;
Run;
ods tagsets.ExcelXP close;
ods listing;

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群