<?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/22860#M3734</link>
    <description>&amp;gt; Hi:&lt;BR /&gt;
&amp;gt;   You could try:&lt;BR /&gt;
&amp;gt; re]&lt;BR /&gt;
&amp;gt;   COLUMN year, product, scripts;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;   COLUMN scripts, year, product;&lt;BR /&gt;
&amp;gt; pre]&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; AND, in the DEFINE statements, both YEAR and PRODUCT&lt;BR /&gt;
&amp;gt; would be ACROSS variables and SCRIPTS would be a SUM&lt;BR /&gt;
&amp;gt; variable.&lt;BR /&gt;
&amp;gt;  &lt;BR /&gt;
&amp;gt; ynthia&lt;BR /&gt;
&lt;BR /&gt;
Hi Cyhthia I tried this:&lt;BR /&gt;
&lt;BR /&gt;
  Physician    product  year      scripts&lt;BR /&gt;
    Mark	   Novo	 2007	3000&lt;BR /&gt;
    Mark	   Novo	 2007	2000&lt;BR /&gt;
    Mark	   Feib        2007	2500&lt;BR /&gt;
    Mark	   Novo	 2008	2500&lt;BR /&gt;
    Twain       Novo	 2007	2000&lt;BR /&gt;
    Twain       Novo	 2008	3000&lt;BR /&gt;
    Twain       Novo	 2008	4000&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA = novo_fieba NOWINDOWS HEADLINE;&lt;BR /&gt;
COLUMN physician,year,  product, scripts;&lt;BR /&gt;
define physician/display;&lt;BR /&gt;
DEFINE year / across;&lt;BR /&gt;
DEFINE product/ across;&lt;BR /&gt;
define scripts/sum;&lt;BR /&gt;
run;&lt;BR /&gt;
 	   &lt;BR /&gt;
The idea is to display physician's name and in each year how much scripts  for each product:&lt;BR /&gt;
&lt;BR /&gt;
                               2007                 2008&lt;BR /&gt;
  Physician           Novo    Feib           Novo      Feib&lt;BR /&gt;
      Mark              3000   2500          2500        -&lt;BR /&gt;
     Twain               2000    -             7000         -</description>
    <pubDate>Thu, 23 Apr 2009 19:14:35 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2009-04-23T19:14:35Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22858#M3732</link>
      <description>Physician    product  year    scripts&lt;BR /&gt;
    Mark            Novo     2007  3000&lt;BR /&gt;
    Mark            Novo     2007  4000&lt;BR /&gt;
    Mark            Feib     2007  2500&lt;BR /&gt;
    Mark           Novo     2008   2500&lt;BR /&gt;
    Twain          Novo     2007  2000&lt;BR /&gt;
    Twain          Novo     2008  3000&lt;BR /&gt;
    Twain          Novo     2008  6000&lt;BR /&gt;
&lt;BR /&gt;
How to generate the above data to following way ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                      2007                    2008&lt;BR /&gt;
 Physician     Novo   Feib           Novo   Feib&lt;BR /&gt;
  Mark         7000   2500           2500      -&lt;BR /&gt;
  Twain        2000     -                9000      -  &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The above can be achived using proc report.But I'm not able to get the prdoucts under year!</description>
      <pubDate>Thu, 23 Apr 2009 18:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22858#M3732</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-04-23T18:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22859#M3733</link>
      <description>Hi:&lt;BR /&gt;
  You could try:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  COLUMN year, product, scripts;&lt;BR /&gt;
or&lt;BR /&gt;
  COLUMN scripts, year, product;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
AND, in the DEFINE statements, both YEAR and PRODUCT would be ACROSS variables and SCRIPTS would be a SUM variable.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 23 Apr 2009 18:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22859#M3733</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-04-23T18:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22860#M3734</link>
      <description>&amp;gt; Hi:&lt;BR /&gt;
&amp;gt;   You could try:&lt;BR /&gt;
&amp;gt; re]&lt;BR /&gt;
&amp;gt;   COLUMN year, product, scripts;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;   COLUMN scripts, year, product;&lt;BR /&gt;
&amp;gt; pre]&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; AND, in the DEFINE statements, both YEAR and PRODUCT&lt;BR /&gt;
&amp;gt; would be ACROSS variables and SCRIPTS would be a SUM&lt;BR /&gt;
&amp;gt; variable.&lt;BR /&gt;
&amp;gt;  &lt;BR /&gt;
&amp;gt; ynthia&lt;BR /&gt;
&lt;BR /&gt;
Hi Cyhthia I tried this:&lt;BR /&gt;
&lt;BR /&gt;
  Physician    product  year      scripts&lt;BR /&gt;
    Mark	   Novo	 2007	3000&lt;BR /&gt;
    Mark	   Novo	 2007	2000&lt;BR /&gt;
    Mark	   Feib        2007	2500&lt;BR /&gt;
    Mark	   Novo	 2008	2500&lt;BR /&gt;
    Twain       Novo	 2007	2000&lt;BR /&gt;
    Twain       Novo	 2008	3000&lt;BR /&gt;
    Twain       Novo	 2008	4000&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA = novo_fieba NOWINDOWS HEADLINE;&lt;BR /&gt;
COLUMN physician,year,  product, scripts;&lt;BR /&gt;
define physician/display;&lt;BR /&gt;
DEFINE year / across;&lt;BR /&gt;
DEFINE product/ across;&lt;BR /&gt;
define scripts/sum;&lt;BR /&gt;
run;&lt;BR /&gt;
 	   &lt;BR /&gt;
The idea is to display physician's name and in each year how much scripts  for each product:&lt;BR /&gt;
&lt;BR /&gt;
                               2007                 2008&lt;BR /&gt;
  Physician           Novo    Feib           Novo      Feib&lt;BR /&gt;
      Mark              3000   2500          2500        -&lt;BR /&gt;
     Twain               2000    -             7000         -</description>
      <pubDate>Thu, 23 Apr 2009 19:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22860#M3734</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-04-23T19:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22861#M3735</link>
      <description>Hi:&lt;BR /&gt;
  No comma after physician:&lt;BR /&gt;
[pre]&lt;BR /&gt;
 COLUMN physician year, product, scripts;&lt;BR /&gt;
or  &lt;BR /&gt;
  COLUMN physician scripts, year, product;&lt;BR /&gt;
                                                                 &lt;BR /&gt;
DEFINE physician / group;&lt;BR /&gt;
DEFINE year / across;&lt;BR /&gt;
DEFINE product / across;&lt;BR /&gt;
DEFINE scripts / sum;&lt;BR /&gt;
[/pre] &lt;BR /&gt;
    &lt;BR /&gt;
Sorry, my bad. I left physician out of the COLUMN statement.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 23 Apr 2009 23:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report/m-p/22861#M3735</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-04-23T23:23:05Z</dc:date>
    </item>
  </channel>
</rss>

