SAS author's tip: a short-cut for requesting multiple tables


Ron Cody is the author of several bestselling SAS books, including his latest SAS Statistics by Example. He's also one of the most highly regarded SAS experts anywhere. One could even make the case that Ron has achieved somewhat of a cult status within the SAS user community.

Whether you've gotten a chance to meet Ron or attend one of his many conference presentations (he's actually presenting at SAS Global Forum in Orlando this week), his vast knowledge and approachable communication style are readily apparent in any of his books. After viewing this week's tip from SAS Statistics by Example, I'd encourage you to read a free chapter from the book as well as visit Ron's author page to learn more about him.

The following excerpt is from SAS author Ron Cody and his book "SAS Statistics by Example" Copyright © 2011, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED. (please note that results may vary depending on your version of SAS software)

A Short-Cut Method for Requesting Multiple Tables

There is a convenient way to request multiple tables using the TABLES statement. The statement:

tables A * B;
creates a single table of variable A (rows) by variable B (columns).

The statement:

tables A * (B C D);
creates three tables—A by B, A by C, and A by D.

The statement:

tables (A B) * (C D);
creates four tables—A by C, A by D, B by C and B by D (in other words, every variable in the first list by every variable in the second list).

You can also request three-way tables (page by row by column) with the statement:

tables A * B * C;
This statement creates tables of B by C for each separate value of A. Each one of the tables will be on a separate page.

If you're attending SAS Global Forum this week, look for Ron Cody and visit our onsite Bookstore to see his many available titles!


About Author

Shelly Goodin

Social Media Specialist, SAS Publications

Shelly Goodin is SAS Publications' social media marketer and the editor of "SAS Publishing News". She’s worked in the publishing industry for over thirteen years, including seven years at SAS, and enjoys creating opportunities for fans of SAS and JMP software to get to know SAS Publications' many offerings and authors.

Related Posts


  1. Shelly Goodin
    Shelly Goodin on

    Hi Umesh, thank you for reading our post. I'd suggest contacting Technical Support for assistance with your question. You can email them at or call for immediate assistance: 919-677-8008. Best of luck!

  2. umesh andotra on

    I am wondering what does the box does in SAS which is at the extreme top left corner of the SAS Window , below the menu options( File Edit View Tools Run Solutions Window Help) It has a Check mark on its left side and its says "SAS Command -----------Results" . It is this used for .I mean what is the application of this box . When i Enter any value in this box then i can see the same value in the dropdown of this box.

Back to Top