<?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: How to compute column in proc report with Across . in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/248134#M15216</link>
    <description>Hi:&lt;BR /&gt;  Yes, you can do that kind of thing if you use SAS macro coding. That takes the program to another level of complexity. In this paper &lt;A href="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" target="_blank"&gt;http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt; the example of the macro code starts at the bottom of page 12 and extends to the top of page 14. I would warn that you need to be very sure of the working code to start with before you "macroize" it. &lt;BR /&gt; &lt;BR /&gt;cynthia</description>
    <pubDate>Fri, 05 Feb 2016 01:27:26 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-02-05T01:27:26Z</dc:date>
    <item>
      <title>How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247017#M15188</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying following code but its not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc report data=BIUO1.WPK4QR,&amp;nbsp;&lt;BR /&gt;column&lt;BR /&gt;Final_Zone&lt;BR /&gt;Type data_month,(&lt;BR /&gt;leads&lt;BR /&gt;Appt&lt;BR /&gt;test)&lt;BR /&gt;;&lt;BR /&gt;define Final_Zone / group 'Zone';&lt;BR /&gt;define Type / group 'Type';&lt;BR /&gt;define data_month / across;&lt;BR /&gt;define leads/ noprint ;&lt;BR /&gt;define Appt / noprint;&lt;BR /&gt;define test / computed format=percent8.2 'Test';&lt;BR /&gt;compute test;&lt;BR /&gt;test=(Appt.sum / &amp;nbsp;leads.sum);&lt;BR /&gt;endcomp;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 05:22:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247017#M15188</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-01-30T05:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247018#M15189</link>
      <description>&lt;P&gt;Refer the following data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input final_zone $8. type $ Data_month$ leads appt;&lt;BR /&gt;cards;&lt;BR /&gt;Central Leads 201601 843 48&lt;BR /&gt;Central Walk-in 201601 388 381&lt;BR /&gt;EAST Leads 201601 3685 252&lt;BR /&gt;EAST Walk-in 201601 573 567&lt;BR /&gt;North1 Leads 201601 578 98&lt;BR /&gt;North1 Walk-in 201601 180 170&lt;BR /&gt;North2 Leads 201601 2452 202&lt;BR /&gt;North2 Walk-in 201601 509 493&lt;BR /&gt;South Leads 201601 992 195&lt;BR /&gt;South Walk-in 201601 190 183&lt;BR /&gt;West Leads 201601 1559 285&lt;BR /&gt;West Walk-in 201601 195 191&lt;BR /&gt;Central Leads 201512 9127 415&lt;BR /&gt;Central Walk-in 201512 430 409&lt;BR /&gt;EAST Leads 201512 33782 826&lt;BR /&gt;EAST Walk-in 201512 999 954&lt;BR /&gt;North1 Leads 201512 7815 831&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 05:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247018#M15189</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-01-30T05:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247024#M15190</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If any one knows the solution of this please replay.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 09:45:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247024#M15190</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-01-30T09:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247025#M15191</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc report data=have;
column Final_Zone Type data_month (leads appt test);
define Final_Zone / group 'Zone';
define Type / group 'Type';
define data_month / across;
define leads/ Analysis Sum  noprint;
define Appt / Analysis Sum noprint;
define test / computed format=percent8.2 'Test';
compute test;
	test = (Appt.SUM /  leads.SUM);
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jan 2016 11:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247025#M15191</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-30T11:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247030#M15192</link>
      <description>&lt;P&gt;Hi Mohamed,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;report&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;column&lt;/SPAN&gt; Final_Zone Type data_month, &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;leads appt test&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; Final_Zone &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Zone'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; Type &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Type'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; data_month &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; across&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; leads&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; Analysis &lt;SPAN class="token function"&gt;Sum&lt;/SPAN&gt;  noprint&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; Appt &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; Analysis &lt;SPAN class="token function"&gt;Sum&lt;/SPAN&gt; noprint&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;define&lt;/SPAN&gt; test &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; computed &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;percent8&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Test'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;compute&lt;/SPAN&gt; test&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	test &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Appt&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SUM&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;  leads&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SUM&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;endcomp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Your approach is wright but i want test column under the month.&lt;/P&gt;&lt;P&gt;Please pind the screen shot for reference.&lt;/P&gt;&lt;P&gt;When we use&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;column&lt;/SPAN&gt; Final_Zone Type data_month, &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;leads appt test&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this statement we need to add comma then it will show under the month.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12254iD2B10979452F3E93/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="output.jpg" title="output.jpg" /&gt;</description>
      <pubDate>Sat, 30 Jan 2016 11:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247030#M15192</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-01-30T11:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247034#M15193</link>
      <description>Hi:&lt;BR /&gt;  When you try to compute an item under an ACROSS variable on PROC REPORT, you cannot use the "simple" names such as APPT.SUM and LEADS.SUM or even TEST. That's because with ACROSS variables, PROC REPORT (in a pre-processing phase) assigns absolute column numbers to the items nested within the ACROSS variable. Please look at page 9 on this paper &lt;A href="http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;  The sample program on page 9 (the COMPUTE block for DIFF) has an example of absolute column numbers in a COMPUTE block.&lt;BR /&gt;&lt;BR /&gt;  So in your example, if Final_zone is _c1_ and type is _c2_, then the first variable under data_month for leads would be _c3_ and then apt would be _c4_ and then test would be _c5_. This essentially means you would have a "set" of 3 items under every value for date_month. So your compute block would be something like this:&lt;BR /&gt;compute test;&lt;BR /&gt;     _c5_ = _c4_/_c3_; /* first month */&lt;BR /&gt;    _c8_ = _c7_/_c6_; /* month 2 */&lt;BR /&gt;   _c11_=_c10_/_c9_; /* month 3 */&lt;BR /&gt;....repeat for each month with diff absolute numbers ...&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;  There have also been quite a few previous forum postings with this same question and the PROC REPORT documentation has a very good section on how PROC REPORT processes a report that describes how absolute column numbers work.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 30 Jan 2016 14:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247034#M15193</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-01-30T14:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247399#M15204</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;I am trying following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=biuo1.WPK4QR out=per_test;&lt;BR /&gt;column&lt;BR /&gt;Final_Zone&lt;BR /&gt;Type&lt;BR /&gt;Appt&lt;BR /&gt;Met&lt;BR /&gt;logins&lt;BR /&gt;Issued&lt;BR /&gt;WRP_login&lt;BR /&gt;WRP_Iss&lt;BR /&gt;Data_month,(&lt;BR /&gt;leads&lt;BR /&gt;Appt_Lead&lt;BR /&gt;Met_Appt&lt;BR /&gt;Login_Appt&lt;BR /&gt;Issued_Appt&lt;BR /&gt;Avg_Prem&lt;BR /&gt;);&lt;BR /&gt;define Final_Zone / group 'Zone';&lt;BR /&gt;define Type / group 'Type';&lt;BR /&gt;define Data_month / order=data across ;&lt;BR /&gt;/*Months*/&lt;BR /&gt;define Appt / sum noprint;&lt;BR /&gt;define Met / sum noprint;&lt;BR /&gt;define logins / sum noprint;&lt;BR /&gt;define Issued / sum noprint;&lt;BR /&gt;define WRP_login / sum noprint;&lt;BR /&gt;define WRP_Iss / sum noprint;&lt;BR /&gt;define leads / sum format=Comma10. 'Leads';&lt;BR /&gt;define Appt_Lead / computed 'Appt Per Lead(%)' format=percent8.2 ;&lt;BR /&gt;compute Appt_Lead;&lt;BR /&gt;Appt_Lead = _C3_ /_C9_;&lt;BR /&gt;if Type eq 'Walk-in' then Appt_Lead=.;&lt;BR /&gt;if Appt_Lead=0 then Appt_Lead=.;&lt;BR /&gt;endcomp;&lt;BR /&gt;define Met_Appt / computed 'Met Per Appt(%)' format=percent8.2;&lt;BR /&gt;compute Met_Appt;&lt;BR /&gt;Met_Appt = _C4_ / _C3_;&lt;BR /&gt;if Met_Appt=0 then Met_Appt=.;&lt;BR /&gt;endcomp;&lt;BR /&gt;define Login_Appt / computed 'Login Per Appt(%)' format=percent8.2 ;&lt;BR /&gt;compute Login_Appt;&lt;BR /&gt;Login_Appt = _C5_ / _C3_;&lt;BR /&gt;if Login_Appt=0 then Login_Appt=.;&lt;BR /&gt;endcomp;&lt;BR /&gt;define Issued_Appt / computed 'Issued Per Appt(%)' format=percent8.2 ;&lt;BR /&gt;compute Issued_Appt;&lt;BR /&gt;Issued_Appt = _C6_ / _C3_;&lt;BR /&gt;if Issued_Appt=0 then Issued_Appt=.;&lt;BR /&gt;endcomp;&lt;BR /&gt;define WRP_Iss / sum format=Comma10.1 'WRP-Iss';&lt;BR /&gt;define Avg_Prem / computed format= comma10. 'Avg Prem' ;&lt;BR /&gt;compute Avg_Prem;&lt;BR /&gt;Avg_Prem = ((_C8_/ _C6_)* (10**5));&lt;BR /&gt;if Avg_Prem=0 then Avg_Prem=.;&lt;BR /&gt;endcomp;&lt;BR /&gt;break after Final_Zone / summarize skip ol style=[background = BWH font_weight=bold color=black];&lt;BR /&gt;rbreak after / summarize ;&lt;BR /&gt;rbreak after / summarize;&lt;BR /&gt;compute final_zone;&lt;BR /&gt;if _break_ = '_RBREAK_' then&lt;BR /&gt;final_zone = 'Agency Total' ;&lt;BR /&gt;endcomp;&lt;BR /&gt;rbreak after / summarize style=[background = BWH font_weight=bold color=black];&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to across computed columns.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 10:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247399#M15204</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-02-02T10:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247550#M15205</link>
      <description>Hi:&lt;BR /&gt;  I really suggest you look at the PROC REPORT documentation. Consider this example I posted:&lt;BR /&gt;  &lt;BR /&gt;compute test;&lt;BR /&gt; _c5_ = _c4_/_c3_; /* first month */&lt;BR /&gt; _c8_ = _c7_/_c6_; /* month 2 */&lt;BR /&gt; _c11_=_c10_/_c9_; /* month 3 */&lt;BR /&gt;....repeat for each month with diff absolute numbers ...&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;It would be incorrect for me to have:&lt;BR /&gt;compute test;&lt;BR /&gt; test = _c4_/_c3_; /* first month */&lt;BR /&gt; endcomp;&lt;BR /&gt;&lt;BR /&gt;...and then no other assignment statements for the other months. You must repeat the assignment statement for every value of your ACROSS variable. How many values do you have for your DATA_MONTH variable??? The syntax you show, with only 1 assignment statement) implies that you only have 1 value for your data_month variable. &lt;BR /&gt;&lt;BR /&gt;This construction&lt;BR /&gt;data_month,(leads Appt_Lead Met_Appt Login_Appt Issued_Appt Avg_Prem ) implies that data_month will have a usage of ACROSS, which also implies more than 1 value for data_month. &lt;BR /&gt;&lt;BR /&gt;If you notice in my example, I show you that you need an assignment statement for every unique value of your ACROSS variable.&lt;BR /&gt;&lt;BR /&gt;Cynthia  &lt;BR /&gt; &lt;BR /&gt;cynthia&lt;BR /&gt;&lt;BR /&gt;Since you did not post data, no one can work with your code. However, the example I posted does show the correct reference syntax. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Feb 2016 17:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247550#M15205</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-02-02T17:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247638#M15210</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sorry, I saw that you did post some data and a simplified version of your program in an earlier post. You have not posted this more complicated data. So I went back to that simpler data and modified your original program to create the TEST column. Essentially, the COMPUTE block is the same as what I originally posted, with an addition IF statement added to make sure that there is never a divide by 0 in the assignment statement. Hopefully, this helps explain how the ACROSS works since it is your own example modified and the results are shown with the LEADS and APPTS columns visible and then using NOPRINT.&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&lt;IMG title="using_ACROSS_to_create_TEST_column.png" alt="using_ACROSS_to_create_TEST_column.png" src="https://communities.sas.com/t5/image/serverpage/image-id/1733i1AB9A80C1109A5BE/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 00:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247638#M15210</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-02-03T00:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247665#M15211</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Cynthia,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my data data_month field is incremental field. every month new month code will be add.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We need to automated all those things.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when new month value is added then it will show automatically computed fields for every month no need to add formula every time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 05:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247665#M15211</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-02-03T05:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247980#M15213</link>
      <description>Hi Cynthia,&lt;BR /&gt;Can we use across when we want to across the computed columns and Data_month is incremented field.&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2016 14:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/247980#M15213</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2016-02-04T14:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/248134#M15216</link>
      <description>Hi:&lt;BR /&gt;  Yes, you can do that kind of thing if you use SAS macro coding. That takes the program to another level of complexity. In this paper &lt;A href="http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf" target="_blank"&gt;http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf&lt;/A&gt; the example of the macro code starts at the bottom of page 12 and extends to the top of page 14. I would warn that you need to be very sure of the working code to start with before you "macroize" it. &lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Fri, 05 Feb 2016 01:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/248134#M15216</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-02-05T01:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399649#M19470</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason this would not work?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying this forever and even though I have the absolute columns referenced it only works on the first 2 calculated columns and then does not computer on any column after that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shown below is a simple data set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;DATE&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;TOTAL&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;DEFECTS&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;DOW&lt;/STRONG&gt;&lt;/TD&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;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17-Sep-17&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;88&lt;/TD&gt;&lt;TD&gt;Sun&lt;/TD&gt;&lt;TD&gt;Widget 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17-Sep-17&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Sun&lt;/TD&gt;&lt;TD&gt;Widget 4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17-Sep-17&lt;/TD&gt;&lt;TD&gt;31&lt;/TD&gt;&lt;TD&gt;193&lt;/TD&gt;&lt;TD&gt;Sun&lt;/TD&gt;&lt;TD&gt;Widget 5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I am trying to run the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc report data=TEST  split='^' 
	style(summary)=Header
	style(column)=[font_size=8pt] nowindows;

column 
		WIDGET 
		DATE,DOW, (TOTAL DEFECTS PERCENT)
;

define WIDGET            / group   ' ^Widgets^ ' style={just=left  cellwidth=130};

define DATE              / across  nozero ' ^Date^ ' style={just=center  cellwidth=80} 
							style(column)={tagattr='TYPE:DateTime format:mm/dd/yy;@'} FORMAT=MMDDYY10.;
define DOW            / across   '' style={just=center  cellwidth=130};

define TOTAL              /  sum  'TOTAL' F=COMMA7. STYLE={just=center cellwidth=40};
define DEFECTS              /  sum  'DEFECTS' F=COMMA7. STYLE={just=center cellwidth=40};
define PERCENT				/ computed 'PERCENT' f=PERCENT8.2 style={just=center cellwidth=30}  ;

compute PERCENT;
_c4_ = _c2_ / _c3_ ;
_c7_ = _c5_ / _c6_ ;
_c10_ = _c8_ / _c9_ ;
_c13_ = _c11_ / _c12_ ;
endcomp;

rbreak after / summarize;
quit;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What would cause this to only add the computed column on _c4_?&amp;nbsp; I've played around with adding more computed columns and sometimes it adds on _c7_, but never all of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help.&amp;nbsp; I am running 64 bit 9.4 SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 21:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399649#M19470</guid>
      <dc:creator>mikepage83</dc:creator>
      <dc:date>2017-09-28T21:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399787#M19471</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; Why do you have both Date and DOW in the ACROSS, wouldn't just one of them work?&lt;BR /&gt;&lt;BR /&gt; Can you post what you're getting now? Also, you didn't post ALL your code -- it appears that&amp;nbsp; you are trying to send this to Excel -- with the use of TAGATTR, but you don't show ODS statements to indicate whether you are using ODS EXCEL or ODS TAGSETS.EXCELXP.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 13:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399787#M19471</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-09-29T13:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399796#M19472</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End customer wants to see date and then the DOW below the date...maybe there is a different way to do it than how I am doing it in regards to the Across portion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies about the code, it is a rather large program and I was just trying to isolate the portion that I thought would be needed.&amp;nbsp; I've included the XP Tagsets portion for reference below.&amp;nbsp; Yes, sending to Excel with XP.&amp;nbsp; I've tried changing the out the compute block with various conditionals i.e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if not missing(_c11_) and not missing(_c12_) and _c11_ gt 0 and _c12_ gt 0 then _c13_ = (_c11_ / _c12_);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as I thought perhaps missing or 0 values were causing the problem, but nothing seems to work.&amp;nbsp; I would rather do it in a compute block, but if not I am going to just summarize the data outside of Proc Report (i.e. create a "Total" category) and do my calculations there instead without the need for the rbreak after / summarize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From every example I have seen online, I can't figure out why this is failing the way it is (i.e. only adding the computed variable&amp;nbsp;to the first column sometimes....sometimes the first 3 columns).&amp;nbsp; I can't see the original dataset I sent you right now in this window.&amp;nbsp; I've been playing with trying to bring in less dates or more dates...so if the below computed columns don't add up to the dataset I sent originally, just know that isn't the reason it is failing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options missing=0;

ods noresults;
ods listing close;

ods tagsets.ExcelXP file="&amp;amp;outfile" style=sasweb;

ods tagsets.ExcelXP options(
	embedded_titles='yes'
	embedded_footnotes='yes'
	frozen_headers='6'
	embed_titles_once='no'
	sheet_interval='bygroup'
	sheet_label=' '
	suppress_bylines='yes'
	row_repeat='yes'
	rowcolheadings='no'
	Pages_fitwidth='1'
	Font_Size='8pt'
	sheet_name="Data.Widgets"
	hidden_rows='5'
	autofit_height='yes'
	autofit_width='yes'
/*	absolute_column_width='100,100,90,90,90,200,75,30,30*/
	orientation='landscape'
/*	autofilter='all'*/
);
/*Options nonumber nodate nocenter;*/
options nocenter;

title1;
title2;
title3;

ods listing close;
options missing=' ';

Proc report data=TEST  split='^' 
	style(summary)=Header
	style(column)=[font_size=8pt] nowindows;

column 
		WIDGET 
		DATE,DOW, (TOTAL DEFECTS PERCENT)
;

define WIDGET            / group   ' ^Widgets^ ' style={just=left  cellwidth=130};

define DATE              / across  nozero ' ^Date^ ' style={just=center  cellwidth=80} 
							style(column)={tagattr='TYPE:DateTime format:mm/dd/yy;@'} FORMAT=MMDDYY10.;
define DOW            / across   '' style={just=center  cellwidth=130};

define TOTAL              /  sum  'TOTAL' F=COMMA7. STYLE={just=center cellwidth=40};
define DEFECTS              /  sum  'DEFECTS' F=COMMA7. STYLE={just=center cellwidth=40};
define PERCENT				/ computed 'PERCENT' f=PERCENT8.2 style={just=center cellwidth=30}  ;

compute PERCENT;
_c4_ = _c2_ / _c3_ ;
_c7_ = _c5_ / _c6_ ;
_c10_ = _c8_ / _c9_ ;
_c13_ = _c11_ / _c12_ ;
endcomp;

rbreak after / summarize;
quit;
Run;

ods tagsets.ExcelXP close;
ods results;

/*Set titles back to default*/
title The SAS System;
title2;
title3;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Sep 2017 14:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399796#M19472</guid>
      <dc:creator>mikepage83</dc:creator>
      <dc:date>2017-09-29T14:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute column in proc report with Across .</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399862#M19474</link>
      <description>&lt;P&gt;Hi, well, with nestings like that, PROC REPORT thinks you have the possibility of 48 total ACROSS columns 3 variables (total, defects,percent) times 4 possible values for DOW times 4 possible values for DATE -- so 3*4*4 = 48. You can prove this to yourself by getting rid of the NOZERO and something like this is what you see:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="behind_the_scenes.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15514iB771866126135DD2/image-size/large?v=v2&amp;amp;px=999" role="button" title="behind_the_scenes.png" alt="behind_the_scenes.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So unfortunately when you nest multiple variables in the ACROSS you are telling PROC REPORT to make absolute column numbers for all the POSSIBLE combinations - not all the ACTUAL combinations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is what you want:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="using_a_format.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15515iAFBF4D60298852BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="using_a_format.png" alt="using_a_format.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I did that with a user-defined format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
** need to use ^ as the split character in PROC REPORT step;
  
proc format;
  value dtdow '14sep17'd = '09/14/2017^Thu'
              '15sep17'd = '09/15/2017^Fri'
              '16sep17'd = '09/16/2017^Sat'
              '17sep17'd = '09/17/2017^Sun';
run;

Proc report data=TEST  split = '^'
	style(summary)=Header
	style(column)=[font_size=8pt] nowindows;
column WIDGET 
		DATE, (TOTAL DEFECTS PERCENT);

define WIDGET / group   '  Widgets  ' style(column)={just=left  };
define DATE   / across   '  Date  ' FORMAT=dtdow.
				style(column)={just=center  } 		;
 define TOTAL  /  sum  'TOTAL' F=COMMA7. 
               STYLE(column)={just=center };
define DEFECTS /  sum  'DEFECTS' F=COMMA7. 
                STYLE(column)={just=center };
define PERCENT/ computed 'PERCENT' f=PERCENT9.2 
                style(column)={just=center }  ;

compute PERCENT;
_c4_ = _c2_ / _c3_ ;
_c7_ = _c5_ / _c6_ ;
_c10_ = _c8_ / _c9_ ;
_c13_ = _c11_ / _c12_ ;
endcomp;

rbreak after / summarize;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did not bother using all of your cellwidths because I don't use cellwidths without a unit of measure and I did not use TAGSETS.EXCELXP because the column headers and nestings for ACROSS will be the same no matter what destination you use.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ps -- in the future, it's better to post a new topic and then refer to an older posting if it is relevant. That way, people don't have to read all the way through the previous posting to get to your question and answer.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 17:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-compute-column-in-proc-report-with-Across/m-p/399862#M19474</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-09-29T17:51:39Z</dc:date>
    </item>
  </channel>
</rss>

