<?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 Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8087#M301</link>
    <description>Yes - look at using the ACROSS option with a SAS DATE variable and an output FORMAT such as WORDDATE3. possibly.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
proc report example across site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
proc report documentation across site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
format worddate site:sas.com</description>
    <pubDate>Tue, 28 Sep 2010 10:51:04 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-09-28T10:51:04Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8086#M300</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I need to produce the below report..Can this be done using proc report...&lt;BR /&gt;
&lt;BR /&gt;
Type---Transaction----Month&lt;BR /&gt;
-----------------------------Jan-Feb-mar-apr-may=till Dec&lt;BR /&gt;
x---------a &lt;BR /&gt;
----------b &lt;BR /&gt;
y---------c&lt;BR /&gt;
----------d &lt;BR /&gt;
z---------e&lt;BR /&gt;
----------f  &lt;BR /&gt;
&lt;BR /&gt;
Here Type Transaction and Month are headers...&lt;BR /&gt;
&lt;BR /&gt;
All the remaining are Column names.&lt;BR /&gt;
&lt;BR /&gt;
X, Y and Z should be grouped under Type header.&lt;BR /&gt;
a,b,c,d,e,f should be grouped under transaction header.&lt;BR /&gt;
&lt;BR /&gt;
Can the report be put in such complex group structure..&lt;BR /&gt;
&lt;BR /&gt;
Please help&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: vishal_p&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: vishal_p&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: vishal_p&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: vishal_p

Message was edited by: vishal_p</description>
      <pubDate>Tue, 28 Sep 2010 05:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8086#M300</guid>
      <dc:creator>vishal_p</dc:creator>
      <dc:date>2010-09-28T05:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8087#M301</link>
      <description>Yes - look at using the ACROSS option with a SAS DATE variable and an output FORMAT such as WORDDATE3. possibly.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
proc report example across site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
proc report documentation across site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
format worddate site:sas.com</description>
      <pubDate>Tue, 28 Sep 2010 10:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8087#M301</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-28T10:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8088#M302</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Scott that generally, you would do this type of report with ACROSS usage for your MONTH variable. However something about your statement is confusing. You said:&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
Here Type Transaction and Month are headers...All the remaining are Column names.&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
             &lt;BR /&gt;
Are you really saying that X, Y and Z are column &lt;U&gt;NAMES&lt;/U&gt; -- or are they VALUES for TYPE?????? Are JAN, FEB, MAR, etc column NAMES or are they &lt;U&gt;VALUES&lt;/U&gt; for MONTH -- so that every unique value for MONTH is a separate column on the report????&lt;BR /&gt;
 &lt;BR /&gt;
Just checking.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 28 Sep 2010 17:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8088#M302</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-28T17:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8089#M303</link>
      <description>En.proc report could do it.&lt;BR /&gt;
But your data structure is obscure.&lt;BR /&gt;
So giving some example about your original data would be very help to generate the result you need.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 29 Sep 2010 01:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8089#M303</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-09-29T01:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8090#M304</link>
      <description>Hi:&lt;BR /&gt;
  Here's a concrete example. SASHELP.PRDSALE has 2 years of data for 1993 and 1994. There is a variable called MONTH that is a SAS date variable formatted with the MONNAME3. format. Other variables or columns are COUNTRY (with 3 possible values -- U.S.A., CANADA and GERMANY), REGION (with 2 possible values (EAST and WEST) and DIVISION (with 2 possible values CONSUMER and EDUCATION).&lt;BR /&gt;
&lt;BR /&gt;
  Every observation in the file represents information on ACTUAL and PREDICTED sales for one COUNTRY/REGION/DIVISION/YEAR/MONTH, as shown below (only 10 obs are shown and MONTH is formatted with DATE9 for this list of observations):&lt;BR /&gt;
[pre]&lt;BR /&gt;
COUNTRY       REGION        DIVISION      YEAR        MONTH          ACTUAL         PREDICT&lt;BR /&gt;
                  &lt;BR /&gt;
CANADA        EAST          EDUCATION     1994    01JAN1994         $107.00         $190.00&lt;BR /&gt;
CANADA        EAST          EDUCATION     1994    01JAN1994         $267.00         $410.00&lt;BR /&gt;
CANADA        EAST          EDUCATION     1994    01JAN1994         $355.00         $497.00&lt;BR /&gt;
CANADA        EAST          EDUCATION     1994    01JAN1994         $877.00         $795.00&lt;BR /&gt;
CANADA        EAST          EDUCATION     1994    01JAN1994         $942.00         $672.00&lt;BR /&gt;
CANADA        EAST          CONSUMER      1994    01JAN1994         $944.00         $965.00&lt;BR /&gt;
CANADA        EAST          CONSUMER      1994    01JAN1994         $312.00         $919.00&lt;BR /&gt;
CANADA        EAST          CONSUMER      1994    01JAN1994         $585.00          $12.00&lt;BR /&gt;
CANADA        EAST          CONSUMER      1994    01JAN1994         $641.00         $425.00&lt;BR /&gt;
CANADA        EAST          CONSUMER      1994    01JAN1994         $689.00         $523.00&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
If you want to create a report with the months for 1994 going across the top of the report -- so there is a unique column for every month, then the following code will accomplish that task -- shows the ACTUAL sales total for every month.&lt;BR /&gt;
 &lt;BR /&gt;
[pre]&lt;BR /&gt;
** make a subset for 1994 only;&lt;BR /&gt;
proc sort data=sashelp.prdsale out=prdsale;&lt;BR /&gt;
  by year month;&lt;BR /&gt;
  where year = 1994;&lt;BR /&gt;
run;&lt;BR /&gt;
                              &lt;BR /&gt;
** create a report with ACROSS usage for MONTH variable;&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\show_across.html' style=sasweb;&lt;BR /&gt;
proc report data=prdsale nowd;&lt;BR /&gt;
  title 'Actual Sales by Month in 1994';&lt;BR /&gt;
  column country region division actual,month;&lt;BR /&gt;
  define country / group;&lt;BR /&gt;
  define region / group;&lt;BR /&gt;
  define division / group;&lt;BR /&gt;
  define month / across order=internal f=monname3.;&lt;BR /&gt;
  define actual / sum ' ';&lt;BR /&gt;
  rbreak after / summarize;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                               &lt;BR /&gt;
The syntax construction ACTUAL,MONTH tells PROC REPORT to use the value of the ACTUAL variable for each month's numbers. If you wanted to get a count of observations for each month, then you would only need to remove the DEFINE statement for ACTUAL from the PROC REPORT code and change the COLUMN statement to:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  column country region division month;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Whether you show the values for ACTUAL or get just a COUNT (the N statistic), listing these variables from left to right: COUNTRY REGION DIVISION and giving them all a usage of GROUP tells PROC REPORT that COUNTRY will be the left-most column and unique values for REGION will be nested inside each value of COUNTRY and unique values for DIVISION will be nested inside REGION. A usage of GROUP also "collapses" or summarizes observations. So each report row will represent the summary numbers for CANADA, EAST, CONSUMER and then CANADA, EAST, EDUCATION, etc -- so that even if there were 1000 observations for the unique combination of COUNTRY=CANADA, REGION=EAST, and DIVISION=CONSUMER, those 1000 observations would get summarized down to one report row. (and the same would be true for every unique combination of COUTNRY, REGION and DIVISION).&lt;BR /&gt;
 &lt;BR /&gt;
Perhaps this will give you an idea of how PROC REPORT can create a summary report with every value for a variable being to create a report column.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 29 Sep 2010 02:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8090#M304</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-29T02:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8091#M305</link>
      <description>Thanks a lot for ur help..</description>
      <pubDate>Fri, 01 Oct 2010 06:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report/m-p/8091#M305</guid>
      <dc:creator>vishal_p</dc:creator>
      <dc:date>2010-10-01T06:31:35Z</dc:date>
    </item>
  </channel>
</rss>

