<?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: sas report format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402093#M66811</link>
    <description>&lt;P&gt;you can use call define statement in proc report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id $ val;
datalines;
a .1
b .5
c .7
d 5
;




proc report nowd data=have;
   col id val; 
   compute val;
      if id in('a','b', 'c') then do;
         call define(_col_,'format','percent10.2');
      end;
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Oct 2017 15:46:27 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2017-10-07T15:46:27Z</dc:date>
    <item>
      <title>sas report format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402078#M66809</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to assign different format according to the value of the var&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suppose if the value of variable is a,b,c then all the numeric variable show percent format&lt;/P&gt;&lt;P&gt;other show normal number format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 13:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402078#M66809</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2017-10-07T13:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: sas report format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402093#M66811</link>
      <description>&lt;P&gt;you can use call define statement in proc report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id $ val;
datalines;
a .1
b .5
c .7
d 5
;




proc report nowd data=have;
   col id val; 
   compute val;
      if id in('a','b', 'c') then do;
         call define(_col_,'format','percent10.2');
      end;
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 15:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402093#M66811</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-10-07T15:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: sas report format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402094#M66812</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You can do this in a PROC REPORT COMPUTE block. There have been many previous postings on this topic. Here's an example of the COMPUTE block if you wanted to change the format for the whole row:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute var_b;
   if var_a in ('a', 'b', 'c') then do;
      call define(_row_,'format','percent9.2');
   end;
   else if var_a in ('d','e') then do;
      call define(_row_,'format','comma6.');
   end;
endcomp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; If you only wanted selected columns/variables to be formatted, then the CALL DEFINE would change to:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;call define('thevar','format','comma6.');&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Anything other than _col_ or _row_ must be quoted as the first argument in the CALL DEFINE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 16:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sas-report-format/m-p/402094#M66812</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-10-07T16:18:31Z</dc:date>
    </item>
  </channel>
</rss>

