BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
js5
Pyrite | Level 9 js5
Pyrite | Level 9

Dear community,

 

I have used proc tabulate to generate a three-dimensional report. Is there a way to give each table a separate number? I tried writing to ods document but proc document list lists all 3 component tables as one table. Thank you for suggestions in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
It looks like you're using a custom denominator with TABULATE.

By group processing might change the percent calculates, since each BY group is treated as a whole entity rather than as a fraction of the whole data set. I also notice that your VAR1, VAR2 and VAR3 are analysis variables which means they are numeric, so BY group processing may not produce what you want, depending on the values for those variables (discrete or continuous).

Three TABLE statements might be the best way to do this.

Since you can't post data here and only post dummy code, you may want to open a track with Tech Support and send them the real data and the real code. If 3 TABLE statements gives you what you want in ODS Document, that seems the best way to go.

Cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
You need to post code and some sample data or use SASHELP datasets to mock up an example of what you're describing. You might try BY group processing with PROC TABULATE to get separate objects for each group. That would mean NOT using the PAGE dimension in your table, as shown below:

Cynthia
js5
Pyrite | Level 9 js5
Pyrite | Level 9

Hi @Cynthia_sas ,

 

thank you for responding! Please see the code in question with variable names replaced with placeholders below:

proc tabulate data=foo order=formatted;
	var var1 var2 var3 var4;
	class var5 var6;

	table var1 var2 var3, var5, var6 * (sum colpctsum<var4>) /style=[just=left];
		format var5 $var5fmt. var6 $var6fmt.;
quit;

While typing it here I realised that I could probably use 3 separate table statements with var1, var2 and var3 only each and get 3 objects at the cost of code triplication. Is there a cleaner solution?

Cynthia_sas
SAS Super FREQ
Hi:
It looks like you're using a custom denominator with TABULATE.

By group processing might change the percent calculates, since each BY group is treated as a whole entity rather than as a fraction of the whole data set. I also notice that your VAR1, VAR2 and VAR3 are analysis variables which means they are numeric, so BY group processing may not produce what you want, depending on the values for those variables (discrete or continuous).

Three TABLE statements might be the best way to do this.

Since you can't post data here and only post dummy code, you may want to open a track with Tech Support and send them the real data and the real code. If 3 TABLE statements gives you what you want in ODS Document, that seems the best way to go.

Cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 604 views
  • 0 likes
  • 2 in conversation