<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc report / coloring cells based on the 95% CI statistical significance in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542447#M149886</link>
    <description>Paige, hope my question is now made clearer.</description>
    <pubDate>Tue, 12 Mar 2019 15:31:47 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2019-03-12T15:31:47Z</dc:date>
    <item>
      <title>Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542427#M149879</link>
      <description>&lt;P&gt;Hi SAS Community and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to produce a colored table on the statistical significance of 95%CI of RR(rate ratio). Proc report code below produces wrong decision in coloring. Where am I making mistake? Any hints or suggestions highly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Problem statement:&lt;/P&gt;
&lt;P&gt;Rules for coloring are:&lt;/P&gt;
&lt;P&gt;A.&lt;/P&gt;
&lt;P&gt;If LCL (_c5_) and UCL (_c6_) are both greater than 1 then color the cells peachpuff;&lt;/P&gt;
&lt;P&gt;If LCL (_c5_) and UCL (_c6_) are both less than 1 then color the lighgreen;&lt;/P&gt;
&lt;P&gt;else color the cell white.&lt;/P&gt;
&lt;P&gt;B.&lt;/P&gt;
&lt;P&gt;Paint RR with a color selected based on the rules using LCL and UCL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This logic was written in SAS codes below. However, rules appear not correctly applied in the final output as shown in the image.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF (_c5_&amp;gt;1 AND _c6_&amp;gt;1) THEN do; svarp='style={background=peachpuff}'; END;&lt;BR /&gt;ELSE IF _c5_&amp;lt;1 AND _c6_&amp;lt;1 THEN do; svarp='style={background=lightgreen}'; END;&lt;BR /&gt;ELSE DO; svarp='style={background=white}'; END;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="show Cynthia mar12.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27875i9093D74DA54FFAD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="show Cynthia mar12.png" alt="show Cynthia mar12.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
options nolabel; 
ODS SELECT ALL; 
proc report data=PAR_SEX_MAR11 out=e.check_columns;  
 column CANCER_TYPE row altsite col,SEX,(RR LCL UCL) dummycalc;
   define CANCER_TYPE/ " " group noprint;
   define row /" " group;
   define col /" " across NOZERO FORMAT=$Parameter.;
   define SEX / " " across FORMAT=$SEX.;
   define altsite/ ' ' group;
   define rr/analysis; 
   DEFINE dummycalc /NOPRINT; 
   define lcl/analysis /*NOPRINT*/; 
   define ucl/analysis /*NOPRINT*/; 
compute dummycalc;

IF (_c5_&amp;gt;1 AND _c6_&amp;gt;1) THEN do; svarp='style={background=peachpuff}'; END;
ELSE IF _c5_&amp;lt;1 AND _c6_&amp;lt;1  THEN do; svarp='style={background=lightgreen}'; END;
ELSE DO; svarp='style={background=white}'; END;

IF (_c8_&amp;gt;1 AND _c9_&amp;gt;1) THEN do; svarn='style={background=peachpuff}'; END;
ELSE IF _c8_&amp;lt;1 AND _c9_&amp;lt;1  THEN do; svarn='style={background=lightgreen}'; END;
ELSE DO; svarn='style={background=white}'; END;

IF (_c11_&amp;gt;1 AND _c12_&amp;gt;1) THEN DO; svara='style={background=peachpuff}'; END;
ELSE IF _c11_&amp;lt;1 AND _c12_&amp;lt;1 THEN DO; svara='style={background=lightgreen}'; END;
ELSE DO; svara='style={background=white}'; END;

IF (_c14_&amp;gt;1 AND _c15_&amp;gt;1) THEN DO; svarb='style={background=peachpuff}'; END;
ELSE IF (_c14_&amp;lt;1 AND _c15_&amp;lt;1) THEN DO; svarb='style={background=lightgreen}'; END;
ELSE DO; svarb='style={background=white}'; END;

IF (_c17_&amp;gt;1 AND _c18_&amp;gt;1) THEN DO; svarc='style={background=peachpuff}'; END;
ELSE IF (_c17_&amp;lt;1 AND _c18_&amp;lt;1) THEN DO; svarc='style={background=lightgreen}'; END;
ELSE DO; svarc='style={background=white}'; END;

IF (_c20_&amp;gt;1 AND _c21_&amp;gt;1) THEN DO; svard='style={background=peachpuff}'; END;
ELSE IF (_c20_&amp;lt;1 AND _c21_&amp;lt;1) THEN DO; svard='style={background=lightgreen}'; END;
ELSE DO; svard='style={background=white}'; END;

IF (_c23_&amp;gt;1 AND _c24_&amp;gt;1) THEN DO; svare='style={background=peachpuff}'; END;
ELSE IF (_c23_&amp;lt;1 AND _c24_&amp;lt;1) THEN DO; svare='style={background=lightgreen}'; END;
ELSE DO; svare='style={background=white}'; END;

IF (_c26_&amp;gt;1 AND _c27_&amp;gt;1) THEN DO; svarf='style={background=peachpuff}'; END;
ELSE IF (_c26_&amp;lt;1 AND _c27_&amp;lt;1) THEN DO; svarf='style={background=lightgreen}'; END;
ELSE DO; svarf='style={background=white}'; END;

IF (_c29_&amp;gt;1 AND _c30_&amp;gt;1) THEN DO; svarg='style={background=peachpuff}'; END;
ELSE IF (_c29_&amp;lt;1 AND _c30_&amp;lt;1) THEN DO; svarg='style={background=lightgreen}'; END;
ELSE DO; svarg='style={background=white}'; END;

IF (_c32_&amp;gt;1 AND _c33_&amp;gt;1) THEN DO; svarh='style={background=peachpuff}'; END;
ELSE IF (_c32_&amp;lt;1 AND _c33_&amp;lt;1) THEN DO; svarh='style={background=lightgreen}'; END;
ELSE DO; svarh='style={background=white}'; END;

IF (_c35_&amp;gt;1 AND _c36_&amp;gt;1) THEN DO; svari='style={background=peachpuff}'; END;
ELSE IF (_c35_&amp;lt;1 AND _c36_&amp;lt;1) THEN DO; svari='style={background=lightgreen}'; END;
ELSE DO; svari='style={background=white}'; END;

IF (_c38_&amp;gt;1 AND _c39_&amp;gt;1) THEN DO; svarj='style={background=peachpuff}'; END;
ELSE IF (_c38_&amp;lt;1 AND _c39_&amp;lt;1) THEN DO; svarj='style={background=lightgreen}'; END;
ELSE DO; svarj='style={background=white}'; END;

IF (_C41_&amp;gt;1 AND _c42_&amp;gt;1) THEN DO; svark='style={background=peachpuff}'; END;
ELSE IF (_c41_&amp;lt;1 AND _c42_&amp;lt;1) THEN DO; svark='style={background=lightgreen}'; END;
ELSE DO; svark='style={background=white}'; END;

IF (_C44_&amp;gt;1 AND _c45_&amp;gt;1) THEN DO; svarl='style={background=peachpuff}'; END;
ELSE IF (_c44_&amp;lt;1 AND _c45_&amp;lt;1) THEN DO; svarl='style={background=lightgreen}'; END;
ELSE DO; svarl='style={background=white}'; END;

IF (_C47_&amp;gt;1 AND _c48_&amp;gt;1) THEN DO; svarm='style={background=peachpuff}'; END;
ELSE IF (_c47_&amp;lt;1 AND _c48_&amp;lt;1) THEN DO; svarm='style={background=lightgreen}'; END;
ELSE DO; svarm='style={background=white}'; END;

IF (_C50_&amp;gt;1 AND _c51_&amp;gt;1) THEN DO; svarn='style={background=peachpuff}'; END;
ELSE IF (_c50_&amp;lt;1 AND _c51_&amp;lt;1) THEN DO; svarn='style={background=lightgreen}'; END;
ELSE DO; svarn='style={background=white}'; END;

IF (_C53_&amp;gt;1 AND _c54_&amp;gt;1) THEN DO; svaro='style={background=peachpuff}'; END;
ELSE IF (_c53_&amp;lt;1 AND _c54_&amp;lt;1) THEN DO; svaro='style={background=lightgreen}'; END;
ELSE DO; svaro='style={background=white}'; END;

IF (_C56_&amp;gt;1 AND _c57_&amp;gt;1) THEN DO; svarp='style={background=peachpuff}'; END;
ELSE IF (_c56_&amp;lt;1 AND _c57_&amp;lt;1) THEN DO; svarp='style={background=lightgreen}'; END;
ELSE DO; svarp='style={background=white}'; END;

IF (_C59_&amp;gt;1 AND _c60_&amp;gt;1) THEN DO; svarq='style={background=peachpuff}'; END;
ELSE IF (_c59_&amp;lt;1 AND _c60_&amp;lt;1) THEN DO; svarq='style={background=lightgreen}'; END;
ELSE DO; svarq='style={background=white}'; END;

IF (_C62_&amp;gt;1 AND _c63_&amp;gt;1) THEN DO; svarr='style={background=peachpuff}'; END;
ELSE IF (_c62_&amp;lt;1 AND _c63_&amp;lt;1) THEN DO; svarr='style={background=lightgreen}'; END;
ELSE DO; svarr='style={background=white}'; END;

IF (_C65_&amp;gt;1 AND _c66_&amp;gt;1) THEN DO; svars='style={background=peachpuff}'; END;
ELSE IF (_c65_&amp;lt;1 AND _c66_&amp;lt;1) THEN DO; svars='style={background=lightgreen}'; END;
ELSE DO; svars='style={background=white}'; END;

IF (_C68_&amp;gt;1 AND _c69_&amp;gt;1) THEN DO; svart='style={background=peachpuff}'; END;
ELSE IF (_c68_&amp;lt;1 AND _c69_&amp;lt;1) THEN DO; svart='style={background=lightgreen}'; END;
ELSE DO; svart='style={background=white}'; END;

IF (_C71_&amp;gt;1 AND _c72_&amp;gt;1) THEN DO; svaru='style={background=peachpuff}'; END;
ELSE IF (_c71_&amp;lt;1 AND _c72_&amp;lt;1) THEN DO; svaru='style={background=lightgreen}'; END;
ELSE DO; svaru='style={background=white}'; END;

IF (_C74_&amp;gt;1 AND _c75_&amp;gt;1) THEN DO; svarv='style={background=peachpuff}'; END;
ELSE IF (_c74_&amp;lt;1 AND _c75_&amp;lt;1) THEN DO; svarv='style={background=lightgreen}'; END;
ELSE DO; svarv='style={background=white}'; END;

call define('_c4_','style',svarp);   call define('_c5_','style',svarp); call define('_c6_','style',svarp);
call define('_c7_','style',svarn);   call define('_c8_','style',svarn); call define('_c9_','style',svarn);
call define('_c10_','style',svara); call define('_c11_','style',svara); call define('_c12_','style',svara);
call define('_c13_','style',svarb); call define('_c14_','style',svarb); call define('_c15_','style',svarb);
call define('_c16_','style',svarc); call define('_c17_','style',svarc); call define('_c18_','style',svarc);
call define('_c19_','style',svard); call define('_c20_','style',svard); call define('_c21_','style',svard);
call define('_c22_','style',svare); call define('_c23_','style',svare); call define('_c24_','style',svare);
call define('_c25_','style',svarf); call define('_c26_','style',svarf); call define('_c27_','style',svarf);
call define('_c28_','style',svarg); call define('_c29_','style',svarg); call define('_c30_','style',svarg);
call define('_c31_','style',svarh); call define('_c32_','style',svarh); call define('_c33_','style',svarh);
call define('_c34_','style',svari); call define('_c35_','style',svari); call define('_c36_','style',svari);
call define('_c37_','style',svarj); call define('_c38_','style',svarj); call define('_c39_','style',svarj);
call define('_C40_','style',svark); call define('_C41_','style',svark); call define('_C42_','style',svark);
call define('_C43_','style',svarl); call define('_C44_','style',svarl); call define('_C45_','style',svarl);
call define('_C46_','style',svarm); call define('_C47_','style',svarm); call define('_C48_','style',svarm);
call define('_C49_','style',svarn); call define('_C50_','style',svarn); call define('_C51_','style',svarn);
call define('_C52_','style',svaro); call define('_C53_','style',svaro); call define('_C54_','style',svaro);
call define('_C55_','style',svarp); call define('_C56_','style',svarp); call define('_C57_','style',svarp);
call define('_C58_','style',svarq); call define('_C59_','style',svarq); call define('_C60_','style',svarq);
call define('_C61_','style',svarr); call define('_C62_','style',svarr); call define('_C63_','style',svarr);
call define('_C64_','style',svars); call define('_C65_','style',svars); call define('_C66_','style',svars);
call define('_C67_','style',svart); call define('_C68_','style',svart); call define('_C69_','style',svart);
call define('_C70_','style',svaru); call define('_C71_','style',svaru); call define('_C72_','style',svaru);
call define('_C73_','style',svarv); call define('_C74_','style',svarv); call define('_C75_','style',svarv);
endcomp;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mock data;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE1; 
   LENGTH PARAMETER $10.;
   INPUT PARAMETER $ SITES $ SEX Level1 RR LCL UCL;
CARDS;
PM25	LIVER	1	.	1.02	1.01	1.02
SMOKE_CAT	LIVER	1	2	0.86	0.79	0.93
SMOKE_CAT	LIVER	1	3	1.21	1.08	1.34
SMOKE_CAT	LIVER	1	4	1.32	1.1	1.54
SMOKE_CAT	LIVER	1	5	1.25	1.07	1.43
NO2	LIVER	1	.	1.41	1.14	1.68
SMOKE_CAT	LIVER	1	2	0.81	0.63	0.99
SMOKE_CAT	LIVER	1	3	1.6	1.23	1.97
SMOKE_CAT	LIVER	1	4	0.59	0.63	0.54
SMOKE_CAT	LIVER	1	5	0.98	0.96	0.99
PM25	LIVER	2	.	1.02	1.01	1.02
SMOKE_CAT	LIVER	2	2	0.86	0.79	0.93
SMOKE_CAT	LIVER	2	3	1.21	1.08	1.34
SMOKE_CAT	LIVER	2	4	1.32	1.1	1.54
SMOKE_CAT	LIVER	2	5	1.25	1.07	1.43
NO2	LIVER	2	.	1.41	1.14	1.68
SMOKE_CAT	LIVER	2	2	0.81	0.63	0.99
SMOKE_CAT	LIVER	2	3	1.6	1.23	1.97
SMOKE_CAT	LIVER	2	4	0.59	0.63	0.54
SMOKE_CAT	LIVER	2	5	0.98	0.96	0.99
PM25	STOMACH	1	.	1.88	1.35	2.4
SMOKE_CAT	STOMACH	1	2	0.34	0.23	0.45
SMOKE_CAT	STOMACH	1	3	2.06	1.44	2.68
SMOKE_CAT	STOMACH	1	4	0.98	0.96	0.99
SMOKE_CAT	STOMACH	1	5	2.25	1.53	2.97
NO2	STOMACH	1	.	2.34	1.57	3.11
SMOKE_CAT	STOMACH	1	2	2.43	1.61	3.25
SMOKE_CAT	STOMACH	1	3	0.58	0.56	0.59
SMOKE_CAT	STOMACH	1	4	2.62	1.7	3.54
SMOKE_CAT	STOMACH	1	5	2.71	1.74	3.68
PM25	STOMACH	2	.	1.88	1.35	2.4
SMOKE_CAT	STOMACH	2	2	0.34	0.23	0.45
SMOKE_CAT	STOMACH	2	3	2.06	1.44	2.68
SMOKE_CAT	STOMACH	2	4	0.98	0.96	0.99
SMOKE_CAT	STOMACH	2	5	2.25	1.53	2.97
NO2	STOMACH	2	.	2.34	1.57	3.11
SMOKE_CAT	STOMACH	2	2	2.43	1.61	3.25
SMOKE_CAT	STOMACH	2	3	0.58	0.56	0.59
SMOKE_CAT	STOMACH	2	4	2.62	1.7	3.54
SMOKE_CAT	STOMACH	2	5	2.71	1.74	3.68
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542427#M149879</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-03-12T15:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542432#M149883</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi SAS Community and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to produce a colored table on the statistical significance of 95%CI of RR(rate ratio). Proc report code below produces wrong decision in coloring. Where am I making mistake? Any hints or suggestions highly appreciated.&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Color wrong&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc report wrong.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27874iB62012F27CAEA800/image-size/large?v=v2&amp;amp;px=999" role="button" title="proc report wrong.png" alt="proc report wrong.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Explain. What is wrong? What should the correct coloring be?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542432#M149883</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-12T15:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542447#M149886</link>
      <description>Paige, hope my question is now made clearer.</description>
      <pubDate>Tue, 12 Mar 2019 15:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542447#M149886</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-03-12T15:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542490#M149897</link>
      <description>&lt;P&gt;I see two problems (and there may be more)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have a value of 1, and the test is to see if the value is &amp;lt; 1, it may be that the formatted values is 1 (not less than 1) but the actual value is &amp;lt; 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next problem is that variables svarp and svarn are computed in two different places, which of course will cause the wrong colors in one of the two places.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 16:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542490#M149897</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-12T16:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542497#M149900</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;It would be easier for anyone to help you if you:&lt;BR /&gt;1) posted data for your test and &lt;BR /&gt;2) posted a program that can be used on your test data and&lt;BR /&gt;3) post ALL the code -- for example no one can run your program without getting FORMAT errors, since you did NOT provide the format&lt;BR /&gt;&lt;BR /&gt;As it stands now, anyone who wants to help you has to use your fake data and then has to immediately edit the PROC REPORT code you've posted. Either post the data that goes with the program or post a program that works with the data.&lt;BR /&gt;&lt;BR /&gt;Then, post the output that was produced with the fake data and identify exactly what is wrong. Typically, with the color coding and CALL DEFINE, the issue is that you are getting the absolute column numbers wrong. &lt;BR /&gt;&lt;BR /&gt;This is my guess with your use of NOZERO. Remember that I explained, in the previous posting, that with NOPRINT you still had to account for "empty" columns, which would get an absolute column number. The same is true of using NOZERO. Just because you cannot see the empty columns with NOZERO does NOT prevent PROC REPORT from assigning an absolute column number. So, if you go back to my SASHELP.PRDSALE example, I think I can illustrate what is going wrong by using OUT=, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="prob_col_nums_wrong.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27880iC6D963150DFD6570/image-size/large?v=v2&amp;amp;px=999" role="button" title="prob_col_nums_wrong.png" alt="prob_col_nums_wrong.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; Understand how the absolute column numbers work WITHOUT using NOPRINT or NOZERO first. Because when you use NOPRINT or NOZERO, the column numbers do NOT change. As you can see from a simple example using a SASHELP dataset, the use of NOZERO improves the display in the results viewer, but does NOT change the absolute column numbers used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542497#M149900</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-12T17:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542507#M149904</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt; , I totally agree with you Cynthia. I apologize for inconsistency between mock data and the code provided. My puzzle was that everything worked well on my mock data but the actual one had problems. I'll make sure mock data and the code are consistent in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; , you were right on both claims. I corrected svarpn and svarp duplicates. And I also needed to convert SEX to numeric first in data step and use format in proc report. It's strange that I had an error "ERROR: SEX must use a character format" even after I converted SEX to numeric. Therefore, I still used (define SEX / " " across FORMAT=$SEX.;) while SEX in data was numeric. SAS gave no error and resulting output appears to be correct now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CORRECT DECISION MAR12.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27881i5450FA68ED10095B/image-size/large?v=v2&amp;amp;px=999" role="button" title="CORRECT DECISION MAR12.png" alt="CORRECT DECISION MAR12.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542507#M149904</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-03-12T17:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542554#M149915</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro colorcells;
     %do s=5 %to 74 %by 3;
        if (_c&amp;amp;s._&amp;gt;1 and _c%eval(&amp;amp;s+1)_&amp;gt;1 then
            svar&amp;amp;s ='style={background=peachpuff}';
        else if (_c&amp;amp;s._&amp;lt;1 and _c%eval(&amp;amp;s+1)_&amp;lt;1 then
            svar&amp;amp;s ='style={background=lightgreen}';
        else svar&amp;amp;s ='style={background=white}';
        call define ("_c%eval(&amp;amp;s-1)_",'style',svar&amp;amp;s);
        call define ("_c&amp;amp;s._",'style',svar&amp;amp;s);
        call define ("_c%eval(&amp;amp;s+1)_",'style',svar&amp;amp;s);
    %end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute dummycalc;
    %colorcells
endcompute;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 19:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542554#M149915</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-12T19:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542556#M149916</link>
      <description>VERY EFFICIENT! where was %eval defined?</description>
      <pubDate>Tue, 12 Mar 2019 19:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542556#M149916</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-03-12T19:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542557#M149917</link>
      <description>&lt;P&gt;It's a built in macro. You don't have to define it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 19:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542557#M149917</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-12T19:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542571#M149923</link>
      <description>&lt;P&gt;Hi: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I would not recommend using any macro approach however, until you really, really understand how PROC REPORT is assigning values to the absolute column numbers and you really, really understand on all your data (not just on your test data) that you have the "pattern" of absolute numbers correct. &lt;BR /&gt;&lt;BR /&gt;When something works on your test data, but not on your full data, that is generally a clue that you have made some miscalculation in the absolute column numbers.&lt;BR /&gt;&lt;BR /&gt;So as tedious as it might be to use OUT= on the whole dataset with PROC REPORT, you would have then seen the whole universe of absolute column numbers and would have been able to desk check whether your logic was correct for all the columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In my previous posting, I said there was a paper by Allison McMahill Booth that showed a routine that could help you and she showed the %EVAL macro function in her example. The challenge with her macro example is that you would have to take the NOPRINT and NOZERO columns into account in order to use her macro logic. Here's the paper, &lt;A href="https://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" target="_blank"&gt;https://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt; on pages 12, 13, 14 is the code. I did work up a macro example for your previous posting, but then when I realized that you were restructuring the data and had a different report in mind, I never posted it. &lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 21:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542571#M149923</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-12T21:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542574#M149924</link>
      <description>after working with you few days, my understanding of absolute columns and how to locate them in the out=data significantly improved. i still would not use macro though. notepad+++ helps me so far. thanks Cynthia!</description>
      <pubDate>Tue, 12 Mar 2019 21:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542574#M149924</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-03-12T21:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542594#M149928</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I would not recommend using any macro approach however, until you really, really understand how PROC REPORT is assigning values to the absolute column numbers and you really, really understand on all your data (not just on your test data) that you have the "pattern" of absolute numbers correct. &lt;BR /&gt;&lt;BR /&gt;So as tedious as it might be to use OUT= on the whole dataset with PROC REPORT, you would have then seen the whole universe of absolute column numbers and would have been able to desk check whether your logic was correct for all the columns.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But the original poster &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt; did print out the OUT= data set, and so he knows what the column numbers are. I know the column numbers too, as I saw this OUT= data set.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;And anyway, we didn't go to a macro approach until the non-macro code was working.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 22:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542594#M149928</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-12T22:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report / coloring cells based on the 95% CI statistical significance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542596#M149929</link>
      <description>Thanks for pointing that out. I was being overly cautious in my warning. Unfortunately, too many people jump straight to macro coding without understanding the underlying processes first. &lt;BR /&gt;&lt;BR /&gt;  Your macro solution was a good example of how to resolve the absolute column numbers and also create a unique name for the style variable for the CALL DEFINE -- once the underlying pattern was clear.&lt;BR /&gt;  &lt;BR /&gt;Cynthia</description>
      <pubDate>Tue, 12 Mar 2019 22:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-coloring-cells-based-on-the-95-CI-statistical/m-p/542596#M149929</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-12T22:27:55Z</dc:date>
    </item>
  </channel>
</rss>

