BookmarkSubscribeRSS Feed
Pinky9
Calcite | Level 5

Hi ALL

Could some one explain what does "table" keyword do in "PROC TABULATE".

6 REPLIES 6
data_null__
Jade | Level 19

From the online doc. "Describes a table to be printed.".

Pinky9
Calcite | Level 5

Hi

Thanks for the information....

reneeharper
SAS Employee

Here's a link to the Base SAS(R) 9.4 Procedures Guide of the Language and Reference Guide.  You might also find the Syntax Index a useful tool.  To use the Syntax Index, just start typing in the language element for which you want more information.

Good luck!

Pinky9
Calcite | Level 5

Hi

Thanks for exhaustive information .

Could you u help me on understanding "classdata" option in proc tabulate , preferably with an executed example.

Thanks for help.

Cynthia_sas
Diamond | Level 26


Hi,

  I would suggest that you look at the PROC TABULATE documentation or for user group papers like this one: http://www.lexjansen.com/pharmasug/2010/hw/hw03.pdf . Using the CLASSDATA option is one way to limit or filter the number of rows that get passed to PROC TABULATE for building a report table.

cynthia

  

ods listing close;

** these are the ONLY product/year rows we want in the TABULATE;

data wantdata;

  length PRODUCT $10 year 8;

  infile datalines;

  input PRODUCT $ YEAR;

  format product $char10. year 4.;

return;

datalines;

SOFA 1993

SOFA 1994

TABLE 1994

CHAIR 1993

BED 1993

DESK 1994

;

run;

    

options missing=0;

ods html file='c:\temp\example_ClassData.html' style=sasweb;

    

** See all years, all products in sashelp.prdsale;

proc freq data=sashelp.prdsale;

  title 'Values in SASHELP.PRDSALE';

  tables Product Year;

run;

    

** what is in wantdata?;

proc print data=work.wantdata;

  title 'Values in Work.wantdata';

run;

    

** Use WANTDATA dataset with SASHELP.PRDSALE to limit analysis to ONLY;

** the rows in the WANTDATA dataset. Note that the variables must have the SAME;

** type and format in the WANTDATA dataset as in the SASHELP.PRDSALE dataset.;

proc tabulate data=sashelp.prdsale f=comma8.

     classdata=work.wantdata exclusive;

  title 'ClassData and Exclusive for Data Subset';

  class  product year;

  var actual;

      

  table product,

        (year)*actual*(n sum mean)

     /box="ClassData and Exclusive";

      

  label Year = 'Year'

        Product = 'Product';

run;

     

ods html close;

ods listing;

Pinky9
Calcite | Level 5

Hi Cynthia,

This is great and helpful.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1744 views
  • 0 likes
  • 4 in conversation