From: Eli Y. Kling on 7 Jan 2010 04:43 Hi Lorne, Please forgive me if I insult your intelligence. However, I read you question as I would like to use proc tabulate or proc report but I do not know how to get the output into HTML. As it happened these procedures are the most adapted to the ODS engine. Youll have to do some reading. There are loads of good examples on and White papers on just this subject. Googleing sas ods tabulate will give you all you want but I would suggest that you start with the examples in the sas help manual and on their web-site: http://support.sas.com/rnd/base/ods/templateFAQ/index.html. Again, apologies if I got the level of the response incorrect if I did, please sharpen the question.
From: Lorne Klassen on 7 Jan 2010 19:09 On Thu, 7 Jan 2010 01:43:27 -0800, Eli Y. Kling <eli.kling(a)GMAIL.COM> wrote: >Hi Lorne, > >Please forgive me if I insult your intelligence. However, I read you >question as I would like to use proc tabulate or proc report but I do >not know how to get the output into HTML. As it happened these >procedures are the most adapted to the ODS engine. You�ll have to do >some reading. There are loads of good examples on and White papers on >just this subject. Googleing �sas ods tabulate� will give you all you >want but I would suggest that you start with the examples in the sas >help manual and on their web-site: http://support.sas.com/rnd/base/ods/templateFAQ/index.html. > >Again, apologies if I got the level of the response incorrect � if I >did, please sharpen the question. Hi Eli, No apology required but yes, you misinterpreted the question. I know how to use ODS to get results into HTML. That's not the problem. The dataset I showed is my starting point (my input from the client). I need to know how to get the data from that dataset into a report which has a format that is more presentable than a proc print of the dataset. Proc print presents all the correct information but it's not easily readable. It doesn't matter if it goes to the Output window or to HTML. I can handle the ODS part.
From: Francois van der Walt on 7 Jan 2010 21:13 Hi Lorne, If this was the result you envisage: ***************************************************************************************** * * year * * ****************************************************************** * * 95 * 96 * 97 * 98 * 99 * * ****************************************************************** * * count * count * count * count * count * * ****************************************************************** * * Sum * Sum * Sum * Sum * Sum * ***************************************************************************************** *car * * * * * * ************************ * * * * * *Ferrari * 0.00* 0.00* 0.00* 0.00* 0.00* ***************************************************************************************** *Honda * 5.00* 15.00* 5.00* 0.00* 0.00* ***************************************************************************************** *Mercedes * 5.00* 0.00* 0.00* 0.00* 5.00* ***************************************************************************************** *Toyota * 0.00* 0.00* 5.00* 5.00* 5.00* ***************************************************************************************** Here is the code: data cars; input @1 car $10. @11 year 5. @19 count 5.; datalines; 50 95 10 96 15 97 10 98 5 99 10 Ferrari 0 Ferrari 95 0 Ferrari 96 0 Ferrari 97 0 Ferrari 98 0 Ferrari 99 0 Honda 25 Honda 95 5 Honda 96 15 Honda 97 5 Honda 98 0 Honda 99 0 Mercedes 10 Mercedes 95 5 Mercedes 96 0 Mercedes 97 0 Mercedes 98 0 Mercedes 99 5 Toyota 15 Toyota 95 0 Toyota 96 0 Toyota 97 5 Toyota 98 5 Toyota 99 5 ; * The formchar was just to use to create table for the SAS-L forum. proc tabulate data=cars /* formchar(1,2,3,4,5,6,7,8,9,10,11) ='***********'*/; class car year; var count; table car,year*count*sum; run; On Wed, 6 Jan 2010 20:19:19 -0500, Lorne Klassen <lk1(a)ROGERS.COM> wrote: >I need to generate an easy to read report from a dataset that has anywhere >from 1-5 class variables and a count variable. The count totals to be put >in the report are also included in this dataset. I've been told that THESE >TOTALS MUST BE PRESENTED AS THEY ARE IN THE DATASET. TOTALS CANNOT BE RE- >CALCULATED BY A SAS PROC (since they may not always be the same as the >totals in the dataset which have been tinkered with previously by a >rounding algorithm). > >Below is an example of a dataset. This dataset has 2 class variables (i.e. >2 dimensions) Car and Year. There could be as many as 5 class variables. >Where a variable is missing, this represents "ALL" or the total for that >variable. > >The report doesn't have to have any particular layout style. But it has to >be more presentable than what a simple PROC PRINT would produce. >Preferably, it would have a crosstab layout like FREQ or TABULATE would >produce. I can easily get PROC PRINT to generate a report but it looks just >like the dataset. Something more readable is required. > >Is there a way to do this with PROC REPORT ? PROC FREQ ? PROC TABULATE ? A Hi >DATA _NULL_ step ? The output will be to an HTML file. > >Thanks > > >Car Year Count >--- ---- ----- > 50 > 95 10 > 96 15 > 97 10 > 98 5 > 99 10 >Ferrari 0 >Ferrari 95 0 >Ferrari 96 0 >Ferrari 97 0 >Ferrari 98 0 >Ferrari 99 0 >Honda 25 >Honda 95 5 >Honda 96 15 >Honda 97 5 >Honda 98 0 >Honda 99 0 >Mercedes 10 >Mercedes 95 5 >Mercedes 96 0 >Mercedes 97 0 >Mercedes 98 0 >Mercedes 99 5 >Toyota 15 >Toyota 95 0 >Toyota 96 0 >Toyota 97 5 >Toyota 98 5 >Toyota 99 5
From: Francois van der Walt on 7 Jan 2010 21:32 On Thu, 7 Jan 2010 21:13:47 -0500, Francois van der Walt <francoisw(a)GJI.COM.AU> wrote: Hi Lorne, by changing the table statement you can have: -------------------------------------------------------------- | | car | | |---------------------------------------------------| | | Ferrari | Honda | Mercedes | Toyota | | |------------+------------+------------+------------| | | count | count | count | count | | |------------+------------+------------+------------| | | Sum | Sum | Sum | Sum | |--------+------------+------------+------------+------------| |year | | | | | |--------| | | | | |95 | 0.00| 5.00| 5.00| 0.00| |--------+------------+------------+------------+------------| |96 | 0.00| 15.00| 0.00| 0.00| |--------+------------+------------+------------+------------| |97 | 0.00| 5.00| 0.00| 5.00| |--------+------------+------------+------------+------------| |98 | 0.00| 0.00| 0.00| 5.00| |--------+------------+------------+------------+------------| |99 | 0.00| 0.00| 5.00| 5.00| -------------------------------------------------------------- Full code: data cars; input @1 car $10. @11 year 5. @19 count 5.; datalines; 50 95 10 96 15 97 10 98 5 99 10 Ferrari 0 Ferrari 95 0 Ferrari 96 0 Ferrari 97 0 Ferrari 98 0 Ferrari 99 0 Honda 25 Honda 95 5 Honda 96 15 Honda 97 5 Honda 98 0 Honda 99 0 Mercedes 10 Mercedes 95 5 Mercedes 96 0 Mercedes 97 0 Mercedes 98 0 Mercedes 99 5 Toyota 15 Toyota 95 0 Toyota 96 0 Toyota 97 5 Toyota 98 5 Toyota 99 5 ; * remove formchar part for the html output; proc tabulate data=cars formchar(1,2,3,4,5,6,7,8,9,10,11) ='|----|+|---'; class car year; var count; table year,car*count*sum/rtspace=10; run;
From: Lorne Klassen on 11 Jan 2010 20:31
On Thu, 7 Jan 2010 21:32:24 -0500, Francois van der Walt <francoisw(a)GJI.COM.AU> wrote: >On Thu, 7 Jan 2010 21:13:47 -0500, Francois van der Walt ><francoisw(a)GJI.COM.AU> wrote: > >Hi Lorne, > >by changing the table statement you can have: >-------------------------------------------------------------- >| | car | >| |---------------------------------------------------| >| | Ferrari | Honda | Mercedes | Toyota | >| |------------+------------+------------+------------| >| | count | count | count | count | >| |------------+------------+------------+------------| >| | Sum | Sum | Sum | Sum | >|--------+------------+------------+------------+------------| >|year | | | | | >|--------| | | | | >|95 | 0.00| 5.00| 5.00| 0.00| >|--------+------------+------------+------------+------------| >|96 | 0.00| 15.00| 0.00| 0.00| >|--------+------------+------------+------------+------------| >|97 | 0.00| 5.00| 0.00| 5.00| >|--------+------------+------------+------------+------------| >|98 | 0.00| 0.00| 0.00| 5.00| >|--------+------------+------------+------------+------------| >|99 | 0.00| 0.00| 5.00| 5.00| >-------------------------------------------------------------- > >Full code: > >data cars; > input @1 car $10. @11 year 5. @19 count 5.; >datalines; > 50 > 95 10 > 96 15 > 97 10 > 98 5 > 99 10 >Ferrari 0 >Ferrari 95 0 >Ferrari 96 0 >Ferrari 97 0 >Ferrari 98 0 >Ferrari 99 0 >Honda 25 >Honda 95 5 >Honda 96 15 >Honda 97 5 >Honda 98 0 >Honda 99 0 >Mercedes 10 >Mercedes 95 5 >Mercedes 96 0 >Mercedes 97 0 >Mercedes 98 0 >Mercedes 99 5 >Toyota 15 >Toyota 95 0 >Toyota 96 0 >Toyota 97 5 >Toyota 98 5 >Toyota 99 5 >; >* remove formchar part for the html output; >proc tabulate data=cars formchar(1,2,3,4,5,6,7,8,9,10,11) > ='|----|+|---'; > class car year; > var count; > table year,car*count*sum/rtspace=10; >run; Francois, That's close to what I want but is there any way to get the totals from my input data set into that report? The totals I'm referring to are in the records where Car and/or Year are blank. I have to use these totals instead of totals that Proc Tabulate might calculate. Thanks |