BookmarkSubscribeRSS Feed
dunga
Obsidian | Level 7

 

/*Hi Forum,

I have this dataset.

*/

data have;

input product income;

cards;

1 1000 15000

1 5000 25000

2 590 1000

3 777 500

3 777 800

3 243 987

;

run;

 

/*And I summarized it using proc sql code below.*/

 

proc sql;

create table smry as

select product

,count(*) as acct_ct

,sum(income) as spot_income format = dollar20.

from have

group by 1;

quit;

 

/*SQL generates the below small SAS data resutls table. I have over 80 such summarized tables. I do not want to export them to Excel

and present.*/

productacct_ctspot_income
12$6,000
21$590
33$1,797

 

/*Q: Is there any method to display the above SAS data resutls table just like proc tablulate, proc freq etc. display. Any help is appreciated. Proc tabulate alternative would not be the answer, I want to display the SAS tables

*/

 

3 REPLIES 3
Reeza
Super User
It's really unclear what you're asking here. You don't want to export them to Excel? You want a proc to display the results like tabulate/freq? What about PROC PRINT or REPORT?
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Sorry, not understanding what the quesiton is?  If you don't want output files (e.g. Excel) then you would view datasets by opening them in the datasets view?

ballardw
Super User

If you don't use a create table statement in that code the results of the select go directly to the open ODS destination.

By default that would be the SAS results viewer but an ODS destination could write to an RTF or PDF or other file type as desired.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1080 views
  • 0 likes
  • 4 in conversation