<?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 - Listing in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17611#M3373</link>
    <description>Hi:&lt;BR /&gt;
  What does your data look like???? For example, this output was created for 3 months of sales information from SASHELP.PRDSALE. Note the use of ACROSS as the usage for the MONTH variable. Also note the use of CALL DEFINE to alter the format used for the ACTUAL variable based on the value of DIVISION. Your data may or may not be in a similar structure in order for ACROSS to work for you. SASHELP.PRDSALE has one observation for every month and DIVISION has 2 possible values.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods html file='c:\temp\prdsale3.html' style=sasweb;&lt;BR /&gt;
                               &lt;BR /&gt;
proc report data=sashelp.prdsale nowd;&lt;BR /&gt;
  where quarter = 1 and year = 1994;&lt;BR /&gt;
  column division actual,month;&lt;BR /&gt;
  define division / group;&lt;BR /&gt;
  define month / across order=internal;&lt;BR /&gt;
  define actual / sum;&lt;BR /&gt;
  compute actual;&lt;BR /&gt;
     if division = 'CONSUMER' then&lt;BR /&gt;
        call define(_COL_,'format','dollar15.2');&lt;BR /&gt;
     else if division = 'EDUCATION' then&lt;BR /&gt;
        call define(_COL_,'format','comma15.0');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Fri, 15 Oct 2010 15:09:59 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-10-15T15:09:59Z</dc:date>
    <item>
      <title>Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17610#M3372</link>
      <description>I am trying to write a report that has the dates across the top. I want the variables to be listed down the left, with the data going across. For example...&lt;BR /&gt;
&lt;BR /&gt;
                                        Jan    Feb      March     April&lt;BR /&gt;
Trans Amount                   $40     $65     $76.50    $45.30&lt;BR /&gt;
Average Percent                60%    35%    37%      $76.20&lt;BR /&gt;
Numer of Trans                  16        45       66           54&lt;BR /&gt;
&lt;BR /&gt;
I have tried several ways using proc report, and I am at a loss. Any suggestions would be much appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
-Alana-</description>
      <pubDate>Fri, 15 Oct 2010 12:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17610#M3372</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-15T12:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17611#M3373</link>
      <description>Hi:&lt;BR /&gt;
  What does your data look like???? For example, this output was created for 3 months of sales information from SASHELP.PRDSALE. Note the use of ACROSS as the usage for the MONTH variable. Also note the use of CALL DEFINE to alter the format used for the ACTUAL variable based on the value of DIVISION. Your data may or may not be in a similar structure in order for ACROSS to work for you. SASHELP.PRDSALE has one observation for every month and DIVISION has 2 possible values.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods html file='c:\temp\prdsale3.html' style=sasweb;&lt;BR /&gt;
                               &lt;BR /&gt;
proc report data=sashelp.prdsale nowd;&lt;BR /&gt;
  where quarter = 1 and year = 1994;&lt;BR /&gt;
  column division actual,month;&lt;BR /&gt;
  define division / group;&lt;BR /&gt;
  define month / across order=internal;&lt;BR /&gt;
  define actual / sum;&lt;BR /&gt;
  compute actual;&lt;BR /&gt;
     if division = 'CONSUMER' then&lt;BR /&gt;
        call define(_COL_,'format','dollar15.2');&lt;BR /&gt;
     else if division = 'EDUCATION' then&lt;BR /&gt;
        call define(_COL_,'format','comma15.0');&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 15 Oct 2010 15:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17611#M3373</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-15T15:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17612#M3374</link>
      <description>Heh, I tried to type out how I wanted the data formatted, but once posted, it didn't work. Hope the below looks better. I added the dots to keep it looking the way I want:&lt;BR /&gt;
&lt;BR /&gt;
Basically, I want the date (rolling 13 months) going across.Then I would want the variable listed like this on the left with the data for them going across:&lt;BR /&gt;
&lt;BR /&gt;
.................................................Jan.........Feb........Mar........Apr&lt;BR /&gt;
Dollars Spent..............................$56........$77........$34.......$900&lt;BR /&gt;
Months active..............................10..........01...........99..........56&lt;BR /&gt;
Number of transactions..................4..........44...........67..........89&lt;BR /&gt;
&lt;BR /&gt;
I have been trying proc report, but if there is something better to use, I am open to it!&lt;BR /&gt;
&lt;BR /&gt;
I hope this makes more sense than the previous post.&lt;BR /&gt;
&lt;BR /&gt;
-Alana-</description>
      <pubDate>Mon, 18 Oct 2010 15:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17612#M3374</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-18T15:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17613#M3375</link>
      <description>Hi:&lt;BR /&gt;
  In order to preserve indenting in forum postings, you need to use the [pre] and [/pre] tags around your code and output in order to maintain indenting and spacing, as described in this forum posting:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
Understanding what you want to produce is only half of the equation. The other half of the equation is what your starting point looks like. For example, do you have variables named Jan, Feb and March or do you have a MONTH variable -- similar to what I posted for SASHELP.PRDSALE. What do your input observations look like??? Are DOLLARS SPENT, MONTHS ACTIVE and NUMBER OF TRANSACTION on 1 observation or on multiple observations? It could be that you could use PROC TABULATE for this report, but again, it's hard to say without seeing your INPUT data and a sample of variables from your INPUT data.&lt;BR /&gt;
&lt;BR /&gt;
Since the SASHELP files are available on every installation, however, you should be able to compare the structure of SASHELP.PRDSALE with the structure of your INPUT data. Did you look at the PROC REPORT code that's been posted? Is there a reason a similar program won't work for your data???&lt;BR /&gt;
&lt;BR /&gt;
Without knowing what your starting point (your input data) looks like, it is impossible to say whether your data needs to undergo any transformations before you pass it to PROC REPORT. Or whether PROC TABULATE might be a better choice.&lt;BR /&gt;
&lt;BR /&gt;
But since you haven't posted what your INPUT data looks like, it's very hard to make further comments. (Just curious...what happened to the Average Percent row that you originally posted??)&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 18 Oct 2010 16:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17613#M3375</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-18T16:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17614#M3376</link>
      <description>I start by pulling data using Proc Sql from an oracle table:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
Proc Sql&lt;BR /&gt;
CREATE TABLE sasuser.Balance as &lt;BR /&gt;
 SELECT&lt;BR /&gt;
  MONTH, &lt;BR /&gt;
  MONTHS ACTIVE,&lt;BR /&gt;
  NUMBERS OF TRANSACTION ,&lt;BR /&gt;
  DOLLARS SPENT,&lt;BR /&gt;
  AVERAGE PERCENT&lt;BR /&gt;
FROM&lt;BR /&gt;
  pvt.table&lt;BR /&gt;
quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
From there I do a proc summary: &lt;BR /&gt;
[pre]&lt;BR /&gt;
proc summary data=sasuser.Balance;&lt;BR /&gt;
 var MONTH  MONTHS_ACTIVE   NUMBERS_OF_TRANSACTION&lt;BR /&gt;
     DOLLARS_SPENT  AVERAGE_PERCENT;&lt;BR /&gt;
 class  Dte;&lt;BR /&gt;
 output out=DMYM.Sum_balanace  sum=;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Once the data is summarized, I was thinking of doing a proc transpose, so that the data goes left to right. That works, but getting the above format has proven difficult. &lt;BR /&gt;
&lt;BR /&gt;
I hope this is more detailed for you.</description>
      <pubDate>Mon, 18 Oct 2010 18:38:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17614#M3376</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-18T18:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17615#M3377</link>
      <description>Hi:&lt;BR /&gt;
  If you used PROC TABULATE, you might not need PROC SUMMARY at all. If you were going to use PROC REPORT, again, you might not need PROC SUMMARY at all, but you might need to restructure your data so that you have a structure something like this for PROC REPORT:&lt;BR /&gt;
[pre]&lt;BR /&gt;
MONTH       DESCRIP             VALUE&lt;BR /&gt;
01/01/2010  Dollars Spent          56&lt;BR /&gt;
02/01/2010  Dollars Spent          77&lt;BR /&gt;
03/01/2010  Dollars Spent          34&lt;BR /&gt;
04/01/2010  Dollars Spent         900&lt;BR /&gt;
01/01/2010  Months Active          10&lt;BR /&gt;
02/01/2010  Months Active          01&lt;BR /&gt;
03/01/2010  Months Active          99&lt;BR /&gt;
04/01/2010  Months Active          56&lt;BR /&gt;
01/01/2010  Number of Transactions  4&lt;BR /&gt;
02/01/2010  Number of Transactions 44&lt;BR /&gt;
03/01/2010  Number of Transactions 67&lt;BR /&gt;
04/01/2010  Number of Transactions 89&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
It really depends on how or whether you want to structure your dataset -- whether it will work for TABULATE or REPORT better. The advantage of either TABULATE or REPORT is that the MONTH variable should be able to go across the columns easily either using MONTH in the COL dimension in PROC TABULATE or using MONTH as an ACROSS variable in PROC REPORT.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 18 Oct 2010 21:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17615#M3377</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-18T21:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report - Listing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17616#M3378</link>
      <description>probably too late, but this a good example/opportunity to show off tabulate versatility[pre]data sasuser.balance ;&lt;BR /&gt;
input month MONTHS_ACTIVE  NUMBERS_OF_TRANSACTION DOLLARS_SPENT AVERAGE_PERCENT ;&lt;BR /&gt;
attrib month informat= yymmn6. format=yymmn6. &lt;BR /&gt;
AVERAGE_PERCENT format= percent10.2 informat= percent10. ;&lt;BR /&gt;
list;cards;&lt;BR /&gt;
200908 12 123 1234 8.1%&lt;BR /&gt;
200909 13 123 2234 7.7%&lt;BR /&gt;
200910 14 113 1334 6.6%&lt;BR /&gt;
200911 15 123 1244 5.5%&lt;BR /&gt;
200912 16 133 1235 8.4%&lt;BR /&gt;
201001 17 143 6234 3.3%&lt;BR /&gt;
201002 18 123 7234 8.2%&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc tabulate data= sasuser.balance missing ;&lt;BR /&gt;
 class  month ; &lt;BR /&gt;
 format month monName3. ;* hoping access to oracle delivers a date value ;&lt;BR /&gt;
 var    MONTHS_ACTIVE  NUMBERS_OF_TRANSACTION DOLLARS_SPENT AVERAGE_PERCENT ;&lt;BR /&gt;
 table  ( &lt;BR /&gt;
         DOLLARS_SPENT='Dollars Spent'         *f= dollar10.  *sum=' '&lt;BR /&gt;
         MONTHS_ACTIVE='Months active'         *f= comma10.   *sum=' '&lt;BR /&gt;
NUMBERS_OF_TRANSACTION='Numbers of Transaction'*f= comma10.   *sum=' '&lt;BR /&gt;
       AVERAGE_PERCENT='Average Percent'       *f= percent10.1*mean=' ' ;&lt;BR /&gt;
         ) , month = ' ' / row= float   ;&lt;BR /&gt;
run ;[/pre]&lt;BR /&gt;
and that provides sas monospace font which does not render well here, so here is the ansi box chars that detract somewhat[pre]&lt;BR /&gt;
----------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
|                                 |   Aug    |   Sep    |   Oct    |   Nov    |   Dec    |   Jan    |   Feb    |&lt;BR /&gt;
|---------------------------------+----------+----------+----------+----------+----------+----------+----------|&lt;BR /&gt;
|Dollars Spent                    |    $1,234|    $2,234|    $1,334|    $1,244|    $1,235|    $6,234|    $7,234|&lt;BR /&gt;
|---------------------------------+----------+----------+----------+----------+----------+----------+----------|&lt;BR /&gt;
|Months active                    |        12|        13|        14|        15|        16|        17|        18|&lt;BR /&gt;
|---------------------------------+----------+----------+----------+----------+----------+----------+----------|&lt;BR /&gt;
|Numbers of Transaction           |       123|       123|       113|       123|       133|       143|       123|&lt;BR /&gt;
|---------------------------------+----------+----------+----------+----------+----------+----------+----------|&lt;BR /&gt;
|Average Percent                  |     8.1% |     7.7% |     6.6% |     5.5% |     8.4% |     3.3% |     8.2% |&lt;BR /&gt;
----------------------------------------------------------------------------------------------------------------[/pre]&lt;BR /&gt;
hope it still shows the required result&lt;BR /&gt;
 &lt;BR /&gt;
peterC&lt;BR /&gt;
p.s.&lt;BR /&gt;
weighting the "average_percentage" data would be possible, too&lt;BR /&gt;
If you are that interested, &lt;B&gt;look it up&lt;/B&gt;</description>
      <pubDate>Wed, 03 Nov 2010 18:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Listing/m-p/17616#M3378</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-11-03T18:42:42Z</dc:date>
    </item>
  </channel>
</rss>

