<?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 Style not applied to SAS variable in Proc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731782#M227979</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Below is my simple report to export dataset to excel and highlight a row if it has value as null for a particular record,&lt;/P&gt;&lt;P&gt;Dataset used has following records,&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="meenakshim_0-1617758458925.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57026iBC4B109AC6069054/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_0-1617758458925.png" alt="meenakshim_0-1617758458925.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods results on ;ods excel file="C:\Data\GENDER.xlsx"&lt;BR /&gt;options (sheet_interval='none' embedded_titles = 'yes' SHEET_NAME="PROVTYPE_ERR" );&lt;BR /&gt;proc report data = UNIQUEPROVIDERTYPES ;&lt;BR /&gt;column FIELD_NAME VALUE cnt&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;define field_name/display;&lt;BR /&gt;define value/display;&lt;BR /&gt;define cnt/display ;&lt;BR /&gt;compute value;&lt;BR /&gt;if value = ' ' then do ;&lt;BR /&gt;call define ('field_name','style','style = {background=red}');&lt;BR /&gt;call define ('value','style','style = {background=red}');&lt;BR /&gt;call define ('cnt','style','style = {background=red}');&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case 1:&lt;/STRONG&gt; When i run above program , i get report as below without highlighting CNT column,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="meenakshim_1-1617758521190.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57027i29DD6388D0CC6E25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_1-1617758521190.png" alt="meenakshim_1-1617758521190.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case 2:&lt;/STRONG&gt; When i replace multiple define statements into one as below ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call define (_row_,'style','style = {background=red}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My report looks like below (Highlighting the CNT last column as well)&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="meenakshim_2-1617758634782.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57028i2C107522832457EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_2-1617758634782.png" alt="meenakshim_2-1617758634782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case 3:&lt;/STRONG&gt; when i replace only my column statement as below , bringing CNT variable in the front (not as last variable)&lt;/P&gt;&lt;P&gt;column FIELD_NAME &lt;STRONG&gt;cnt&lt;/STRONG&gt; VALUE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My report looks like below (Highlighting the CNT but this time it is not the last column because of order changed in column statement)&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="meenakshim_3-1617758880044.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57029i62074AAEC454D55D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_3-1617758880044.png" alt="meenakshim_3-1617758880044.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My doubt is why i am not getting the required results as below during the case 1 scenario.&lt;/P&gt;&lt;P&gt;Why CNT variable as last column is not highlighted in case1? Why order changing in column statement in case 3 highlight the column CNT good?&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="meenakshim_2-1617758634782.png" style="width: 251px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57028i2C107522832457EA/image-dimensions/251x67?v=v2" width="251" height="67" role="button" title="meenakshim_2-1617758634782.png" alt="meenakshim_2-1617758634782.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 01:35:31 GMT</pubDate>
    <dc:creator>meenakshim</dc:creator>
    <dc:date>2021-04-07T01:35:31Z</dc:date>
    <item>
      <title>Style not applied to SAS variable in Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731782#M227979</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Below is my simple report to export dataset to excel and highlight a row if it has value as null for a particular record,&lt;/P&gt;&lt;P&gt;Dataset used has following records,&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="meenakshim_0-1617758458925.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57026iBC4B109AC6069054/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_0-1617758458925.png" alt="meenakshim_0-1617758458925.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods results on ;ods excel file="C:\Data\GENDER.xlsx"&lt;BR /&gt;options (sheet_interval='none' embedded_titles = 'yes' SHEET_NAME="PROVTYPE_ERR" );&lt;BR /&gt;proc report data = UNIQUEPROVIDERTYPES ;&lt;BR /&gt;column FIELD_NAME VALUE cnt&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;define field_name/display;&lt;BR /&gt;define value/display;&lt;BR /&gt;define cnt/display ;&lt;BR /&gt;compute value;&lt;BR /&gt;if value = ' ' then do ;&lt;BR /&gt;call define ('field_name','style','style = {background=red}');&lt;BR /&gt;call define ('value','style','style = {background=red}');&lt;BR /&gt;call define ('cnt','style','style = {background=red}');&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case 1:&lt;/STRONG&gt; When i run above program , i get report as below without highlighting CNT column,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="meenakshim_1-1617758521190.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57027i29DD6388D0CC6E25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_1-1617758521190.png" alt="meenakshim_1-1617758521190.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case 2:&lt;/STRONG&gt; When i replace multiple define statements into one as below ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call define (_row_,'style','style = {background=red}');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My report looks like below (Highlighting the CNT last column as well)&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="meenakshim_2-1617758634782.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57028i2C107522832457EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_2-1617758634782.png" alt="meenakshim_2-1617758634782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case 3:&lt;/STRONG&gt; when i replace only my column statement as below , bringing CNT variable in the front (not as last variable)&lt;/P&gt;&lt;P&gt;column FIELD_NAME &lt;STRONG&gt;cnt&lt;/STRONG&gt; VALUE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My report looks like below (Highlighting the CNT but this time it is not the last column because of order changed in column statement)&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="meenakshim_3-1617758880044.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57029i62074AAEC454D55D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="meenakshim_3-1617758880044.png" alt="meenakshim_3-1617758880044.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My doubt is why i am not getting the required results as below during the case 1 scenario.&lt;/P&gt;&lt;P&gt;Why CNT variable as last column is not highlighted in case1? Why order changing in column statement in case 3 highlight the column CNT good?&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="meenakshim_2-1617758634782.png" style="width: 251px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57028i2C107522832457EA/image-dimensions/251x67?v=v2" width="251" height="67" role="button" title="meenakshim_2-1617758634782.png" alt="meenakshim_2-1617758634782.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 01:35:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731782#M227979</guid>
      <dc:creator>meenakshim</dc:creator>
      <dc:date>2021-04-07T01:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Style not applied to SAS variable in Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731805#M227989</link>
      <description>&lt;P&gt;Proc report cannot see upcoming columns in &lt;EM&gt;compute column&lt;/EM&gt; block, only columns already processed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also:&lt;/P&gt;
&lt;P&gt;1. Use SASHELP data for this type of example so we can replicate easily&lt;/P&gt;
&lt;P&gt;2. Paste your code using the appropriate icon&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 04:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731805#M227989</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-04-07T04:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Style not applied to SAS variable in Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731807#M227991</link>
      <description>&lt;P&gt;All will work if you change to &lt;FONT face="courier new,courier"&gt;compute CNT;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 04:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Style-not-applied-to-SAS-variable-in-Proc-report/m-p/731807#M227991</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-04-07T04:50:35Z</dc:date>
    </item>
  </channel>
</rss>

