<?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: Formatting single row based on parameter value in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53931#M14940</link>
    <description>Cynthia; &lt;BR /&gt;
Will certaintly give this a try!&lt;BR /&gt;
Thank you!</description>
    <pubDate>Tue, 14 Oct 2008 19:22:14 GMT</pubDate>
    <dc:creator>_LB</dc:creator>
    <dc:date>2008-10-14T19:22:14Z</dc:date>
    <item>
      <title>Formatting single row based on parameter value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53927#M14936</link>
      <description>Hello all; &lt;BR /&gt;
I am trying to format a single row apart from the others so that the calculated  (CRBSI) rate has two decimal points in a 5.2 format while all  other rows have a standard 5. format; &lt;BR /&gt;
Been playing around with it, but to no avail...&lt;BR /&gt;
The code:&lt;BR /&gt;
&lt;BR /&gt;
format bwcat1-bwcat6 total 5.;&lt;BR /&gt;
if _label_ ='CRBSI RATE' THEN DO;&lt;BR /&gt;
format  bwcat1-bwcat6 total 5.2 ;&lt;BR /&gt;
End; &lt;BR /&gt;
&lt;BR /&gt;
I understand what it is doing-when the variable name matches the if statement it reverts all the rows to the new format...I just don't how to specify... &lt;BR /&gt;
&lt;BR /&gt;
Much thanks... &lt;BR /&gt;
&lt;BR /&gt;
Lawrence</description>
      <pubDate>Tue, 14 Oct 2008 16:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53927#M14936</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2008-10-14T16:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting single row based on parameter value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53928#M14937</link>
      <description>The format statement is "global" for variables in the whole table, and a format cannot be assigned based on a row basis in table. Is _label_ a user defined variable? (showing your whole code make it easier for us to help you). If you like to set a certain format conditionally on the table level, you can use macro programming.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
      <pubDate>Tue, 14 Oct 2008 17:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53928#M14937</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-10-14T17:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting single row based on parameter value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53929#M14938</link>
      <description>Linus;&lt;BR /&gt;
I figured as much as to the fact that format is a "global statement"&lt;BR /&gt;
_LABEL_ is generated as a byproduct of a proc transpose...&lt;BR /&gt;
The whole code is quite lengthy and it is only this part that is causing a small obstacle. &lt;BR /&gt;
&lt;BR /&gt;
I will take a stab at writing a macro perhaps...&lt;BR /&gt;
Thank you for the clarity on this issue...&lt;BR /&gt;
&lt;BR /&gt;
Lawrence</description>
      <pubDate>Tue, 14 Oct 2008 17:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53929#M14938</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2008-10-14T17:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting single row based on parameter value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53930#M14939</link>
      <description>Hi:&lt;BR /&gt;
  I think a macro approach would not be required, when PROC REPORT can do this easily for reporting purposes. &lt;BR /&gt;
&lt;BR /&gt;
As far as the data set descriptor goes, the same format has to be applied to the same numeric column -- unless you turn the numeric variable into a character variable using the PUT function and different formats.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods listing;&lt;BR /&gt;
options nodate nonumber;&lt;BR /&gt;
proc report data=sashelp.class nowd;&lt;BR /&gt;
  column name age height;&lt;BR /&gt;
  define name / order;&lt;BR /&gt;
  define age / f=8.0;&lt;BR /&gt;
  define height / f=8.0;&lt;BR /&gt;
  compute age;&lt;BR /&gt;
    if name = 'Barbara' then do;&lt;BR /&gt;
      call define (_col_,'format','8.3');&lt;BR /&gt;
    end;&lt;BR /&gt;
    else if name = 'John' then do;&lt;BR /&gt;
      call define (_col_,'format','8.5');&lt;BR /&gt;
    end;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute height;&lt;BR /&gt;
    if name = 'Barbara' then do;&lt;BR /&gt;
      call define (_col_,'format','8.3');&lt;BR /&gt;
    end;&lt;BR /&gt;
    else if name = 'John' then do;&lt;BR /&gt;
      call define (_col_,'format','8.5');&lt;BR /&gt;
    end;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 14 Oct 2008 19:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53930#M14939</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-10-14T19:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting single row based on parameter value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53931#M14940</link>
      <description>Cynthia; &lt;BR /&gt;
Will certaintly give this a try!&lt;BR /&gt;
Thank you!</description>
      <pubDate>Tue, 14 Oct 2008 19:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53931#M14940</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2008-10-14T19:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting single row based on parameter value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53932#M14941</link>
      <description>Cynthia; &lt;BR /&gt;
Worked like a charm!&lt;BR /&gt;
Thank you! &lt;BR /&gt;
&lt;BR /&gt;
Lawrence</description>
      <pubDate>Tue, 14 Oct 2008 23:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-single-row-based-on-parameter-value/m-p/53932#M14941</guid>
      <dc:creator>_LB</dc:creator>
      <dc:date>2008-10-14T23:37:32Z</dc:date>
    </item>
  </channel>
</rss>

