Add a Third Dimension

Because the two-dimensional table here looks correct, we will go on to adding the third dimension. Just like when we converted a one-dimensional table to a two-dimensional table, we add a new dimension with a comma operator in the TABLE statement. We add the new variable SECTOR to the existing TABLE statement with a comma to separate it from the row and column definitions.
You might think that the following code is the correct way to add the third dimension to the TABLE statement. However, what this would generate is a table with GENDER as the rows, SECTOR as the columns, and OCCUP as the pages!
To add the third dimension to a table correctly, you add it at the beginning

Get PROC TABULATE by Example, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.