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!

tags: ron cody, sas, sas author, sas global forum, SAS Statistics by Example, sas user, Tables Statement

2 Comments

  1. umesh andotra
    Posted April 25, 2012 at 8:58 am | Permalink

    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.

  2. Shelly Goodin Shelly Goodin
    Posted April 26, 2012 at 11:48 am | Permalink

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

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <p> <pre lang="" line="" escaped=""> <q cite=""> <strike> <strong>