<?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 Format Value via Compute in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371765#M65150</link>
    <description>&lt;P&gt;You can alias a column and list it twice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/41/576.html" target="_blank"&gt;http://support.sas.com/kb/41/576.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Modifying it slightly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
   input a $  b $ mydate mmddyy8.; ;
   datalines;
wilma stone   01122001
wilma stone   02122001
wilma stone   01012001
fred  stone   03052008
fred  stone   03152008
fred  stone   03152009
;
run;

ods html;

title 'MIN and MAX date per patient';

proc report nowd data=example;
   column a b mydate=min_mydate mydate=max_mydate;
   define a / group;
   define b / group;
   define min_mydate / min format=mmddyy10. 'min date';
   define max_mydate / max format=date9. 'max date';
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Jun 2017 15:16:31 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-06-29T15:16:31Z</dc:date>
    <item>
      <title>Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371754#M65148</link>
      <description>&lt;P&gt;Is there a way to use a&amp;nbsp; compute block in proc report to display a numeric column as an integer in one line and percent on another?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 15:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371754#M65148</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2017-06-29T15:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371757#M65149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5059"&gt;@DavidPhillips2&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Is there a way to use a&amp;nbsp; compute block in proc report to display a numeric column as an integer in one line and percent on another?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is this supposed to be conditional on another value? Row number? How do you know which display you want on a given line? or do you mean to display both for every result but on separate lines, possibly stacked in a cell?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 15:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371757#M65149</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-29T15:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371765#M65150</link>
      <description>&lt;P&gt;You can alias a column and list it twice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/41/576.html" target="_blank"&gt;http://support.sas.com/kb/41/576.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Modifying it slightly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
   input a $  b $ mydate mmddyy8.; ;
   datalines;
wilma stone   01122001
wilma stone   02122001
wilma stone   01012001
fred  stone   03052008
fred  stone   03152008
fred  stone   03152009
;
run;

ods html;

title 'MIN and MAX date per patient';

proc report nowd data=example;
   column a b mydate=min_mydate mydate=max_mydate;
   define a / group;
   define b / group;
   define min_mydate / min format=mmddyy10. 'min date';
   define max_mydate / max format=date9. 'max date';
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 15:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371765#M65150</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-29T15:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371770#M65151</link>
      <description>&lt;P&gt;How can I use this format conditionally? &amp;nbsp;If a = 'wilma' then format 1?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 15:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371770#M65151</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2017-06-29T15:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371776#M65152</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; compute n;
  if name='Wilma' then call define('row','format','dollar10.');
   else call define('row', 'format', 'percent10.1');
 endcomp;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 15:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371776#M65152</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-29T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371793#M65153</link>
      <description>&lt;P&gt;data example;&lt;BR /&gt;input a $ b $ mydate mmddyy8.;&lt;BR /&gt;datalines;&lt;BR /&gt;wilma stone 01122001&lt;BR /&gt;wilma stone 02122001&lt;BR /&gt;wilma stone 01012001&lt;BR /&gt;fred stone 03052008&lt;BR /&gt;fred stone 03152008&lt;BR /&gt;fred stone 03152009&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title 'MIN and MAX date per patient';&lt;/P&gt;&lt;P&gt;proc report nowd data=example;&lt;BR /&gt;column a b mydate=min_mydate mydate=max_mydate;&lt;BR /&gt;define a / group;&lt;BR /&gt;define b / group;&lt;BR /&gt;/*define min_mydate / min format=mmddyy10. 'min date';*/&lt;BR /&gt;define max_mydate / max format=date9. 'max date';&lt;BR /&gt;compute min_mydate;&lt;BR /&gt;if a='Wilma' then call define('min_mydate','format','dollar10.');&lt;BR /&gt;else call define('min_mydate', 'format', 'percent10.1');&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results in&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;a b mydate max date &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;fred&lt;/TD&gt;&lt;TD&gt;stone&lt;/TD&gt;&lt;TD&gt;6595700%&lt;/TD&gt;&lt;TD&gt;15MAR2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;wilma&lt;/TD&gt;&lt;TD&gt;stone&lt;/TD&gt;&lt;TD&gt;6579800%&lt;/TD&gt;&lt;TD&gt;12FEB2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;aiming for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;a b mydate max date &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;fred&lt;/TD&gt;&lt;TD&gt;stone&lt;/TD&gt;&lt;TD&gt;6595700%&lt;/TD&gt;&lt;TD&gt;15MAR2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;wilma&lt;/TD&gt;&lt;TD&gt;stone&lt;/TD&gt;&lt;TD&gt;$6579800&lt;/TD&gt;&lt;TD&gt;12FEB2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 16:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371793#M65153</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2017-06-29T16:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371795#M65154</link>
      <description>you test for Wilma whereas your data is wilma</description>
      <pubDate>Thu, 29 Jun 2017 16:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371795#M65154</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2017-06-29T16:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371796#M65155</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data example;&lt;BR /&gt;input a $ b $ mydate mmddyy8.;&lt;BR /&gt;datalines;&lt;BR /&gt;wilma stone 01122001&lt;BR /&gt;wilma stone 02122001&lt;BR /&gt;wilma stone 01012001&lt;BR /&gt;fred stone 03052008&lt;BR /&gt;fred stone 03152008&lt;BR /&gt;fred stone 03152009&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title 'MIN and MAX date per patient';&lt;/P&gt;&lt;P&gt;proc report nowd data=example;&lt;BR /&gt;column a b mydate=mydate2;&lt;BR /&gt;define a / group;&lt;BR /&gt;define b / group;&lt;BR /&gt;/*define min_mydate / min format=mmddyy10. 'min date';*/&lt;BR /&gt;/*define max_mydate / max format=date9. 'max date';*/&lt;BR /&gt;compute mydate2;&lt;BR /&gt;if a='wilma' then call define('mydate2','format','dollar10.');&lt;BR /&gt;else call define('mydate2', 'format', 'percent10.1');&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 16:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371796#M65155</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2017-06-29T16:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371848#M65156</link>
      <description>&lt;P&gt;I am trying to display the data across so I added a comma in&lt;/P&gt;&lt;P&gt;column a b mydate=mydate2;&lt;/P&gt;&lt;P&gt;Is there something I’m missing to display the data across?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below works but&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data example;&lt;BR /&gt;input a $ b $ mydate mmddyy8.;&lt;BR /&gt;datalines;&lt;BR /&gt;wilma stone 01122001&lt;BR /&gt;wilma stone 02122001&lt;BR /&gt;wilma stone 01012001&lt;BR /&gt;fred stone 03052008&lt;BR /&gt;fred stone 03152008&lt;BR /&gt;fred stone 03152009&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title 'MIN and MAX date per patient';&lt;/P&gt;&lt;P&gt;proc report nowd data=example;&lt;BR /&gt;column a b mydate=mydate2;&lt;BR /&gt;compute mydate2;&lt;BR /&gt;if a='wilma' then call define('mydate2', 'format','dollar10.');&lt;BR /&gt;endcomp;&lt;BR /&gt;define a / group;&lt;BR /&gt;define b / across;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This block produces ERROR: Invalid column specification in CALL DEFINE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data example;&lt;BR /&gt;input a $ b $ mydate mmddyy8.;&lt;BR /&gt;datalines;&lt;BR /&gt;wilma stone 01122001&lt;BR /&gt;wilma stone 02122001&lt;BR /&gt;wilma stone 01012001&lt;BR /&gt;fred stone 03052008&lt;BR /&gt;fred stone 03152008&lt;BR /&gt;fred stone 03152009&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title 'MIN and MAX date per patient';&lt;/P&gt;&lt;P&gt;proc report nowd data=example;&lt;BR /&gt;column a b, mydate=mydate2;&lt;BR /&gt;compute mydate2;&lt;BR /&gt;if a='wilma' then call define('mydate2', 'format','dollar10.');&lt;BR /&gt;endcomp;&lt;BR /&gt;define a / group;&lt;BR /&gt;define b / across;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 18:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371848#M65156</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2017-06-29T18:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Format Value via Compute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371854#M65157</link>
      <description>&lt;P&gt;This worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title 'MIN and MAX date per patient';&lt;/P&gt;&lt;P&gt;proc report nowd data=example;&lt;BR /&gt;column a b, mydate;&lt;BR /&gt;compute mydate;&lt;BR /&gt;if a='wilma' then call define(_col_, 'format','dollar10.');&lt;BR /&gt;endcomp;&lt;BR /&gt;define a / group;&lt;BR /&gt;define b / across;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 18:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Format-Value-via-Compute/m-p/371854#M65157</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2017-06-29T18:24:32Z</dc:date>
    </item>
  </channel>
</rss>

