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

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1702 views
  • 0 likes
  • 4 in conversation