<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269926#M53537</link>
    <description>&lt;P&gt;So where 5 is coming from ? Isn't it 6 ? as ballardw said it is not good for proc report .&lt;/P&gt;
&lt;P&gt;Why not use a macro variable hold it and assign it by hard code, as you showed ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input type $ color $ counter;
cards;
aaa purple 1
aaa orange 1
bbb purple 2
ccc orange 2
;
run;
proc report data=test nowd ;
columns type  color,counter dummy;
define type/group;
define color/across;
define dummy/computed noprint;
compute before;
sum1=_c2_;
sum2=_c3_;
endcomp;
compute dummy;
_c2_=sum(sum1,sum2,_c2_);
_c3_=sum(sum1,sum2,_c3_);
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 01:36:38 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-05-12T01:36:38Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269853#M53510</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help on my question!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how the data looks like now (Now), and how I need to change it (Required)&amp;nbsp;only using proc report&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&l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/P&gt;&lt;P&gt;run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;If possible I would like to use proc report, however I can't use the method below, by hardcoding the colums (in the real case the exact position of the coulmn varies)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;proc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Arial"&gt;&lt;FONT color="#000080" face="Arial"&gt;report&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;nowd&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;data&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt;=test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;missing&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;COLUMN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;type color, (counter counter=num);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;define&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt; type / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;group&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Arial"&gt;&lt;FONT color="#800080" face="Arial"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;define&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;color / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;across&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Arial"&gt;&lt;FONT color="#800080" face="Arial"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;define&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;counter /&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;sum&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Arial"&gt;&lt;FONT color="#800080" face="Arial"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;noprint&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;define&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;num / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;sum&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Arial"&gt;&lt;FONT color="#800080" face="Arial"&gt;' '&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Arial"&gt;&lt;FONT color="#0000ff" face="Arial"&gt;nozero&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;compute&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;num;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;_C3_ = _C2_+&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Arial"&gt;&lt;FONT color="#008080" face="Arial"&gt;5&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;_C5_ = _C4_+&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Arial"&gt;&lt;FONT color="#008080" face="Arial"&gt;5&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;endcomp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Arial"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 19:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269853#M53510</guid>
      <dc:creator>cb</dc:creator>
      <dc:date>2016-05-11T19:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269870#M53514</link>
      <description>&lt;P&gt;Since Proc Report doesn't do well with relative columns I would say your best bet would be to fix the data not the report and possibly change Option missing='.' to Option missing='5'; but the logic of problem is some what obscure. You might want to expand on the example data a bit to make the logic of the manipulation clearer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code doesn't work either, you would need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   compute num;
      _C3_ = sum(_C2_,5);
      _C5_ = sum(_C4_,5);
   endcomp;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to add 5 to the missing and get 5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 20:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269870#M53514</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-11T20:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269926#M53537</link>
      <description>&lt;P&gt;So where 5 is coming from ? Isn't it 6 ? as ballardw said it is not good for proc report .&lt;/P&gt;
&lt;P&gt;Why not use a macro variable hold it and assign it by hard code, as you showed ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input type $ color $ counter;
cards;
aaa purple 1
aaa orange 1
bbb purple 2
ccc orange 2
;
run;
proc report data=test nowd ;
columns type  color,counter dummy;
define type/group;
define color/across;
define dummy/computed noprint;
compute before;
sum1=_c2_;
sum2=_c3_;
endcomp;
compute dummy;
_c2_=sum(sum1,sum2,_c2_);
_c3_=sum(sum1,sum2,_c3_);
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 01:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/269926#M53537</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-05-12T01:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/270116#M53622</link>
      <description>&lt;P&gt;Thank you ballardw!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just made up an&amp;nbsp;e.g. (but I forgot about having entered missing values, thank you for drawing me he attention)&lt;/P&gt;&lt;P&gt;All I wanted to find out was,&amp;nbsp;a way to write&amp;nbsp;the proc report, where the values that are going to be displayed across, in this case the 'counter'&amp;nbsp;, could be altered (changed based on any algorithm, in this case increased by 5).&lt;/P&gt;&lt;P&gt;If this will be possible in proc report, then I would not have to 'fix' the data, as the data is created in a macro. (this macro creates many different datasets, except for one where additional manipulation is needed; I was trying to avoid having to add this additional data step and use proc report for this purpose)&lt;/P&gt;&lt;P&gt;Thanks again for your advice!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 17:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/270116#M53622</guid>
      <dc:creator>cb</dc:creator>
      <dc:date>2016-05-12T17:52:31Z</dc:date>
    </item>
  </channel>
</rss>

