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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 753 views
  • 0 likes
  • 4 in conversation