BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

Disaster                    State                 Investor           Dollars         Number

Hurricane One            TX                    XXX                1000               50

Hurrican One              TX                    XYZ                 1000              50

Hurricane Two              AL                    XYZ                    50               50

 

If I have a proc print such as
proc print data = disaster noobs

grandtotal_label = 'Total';

title 'My Title';

by Disaster  State;

sum Dollars Number;

run;

 

I get this in a results area

Disaster = Hurricane One = TX
Investor   Dollars   Number
XXX         1000         50
XYZ         1000         50
State        2000      100

Disaster = Hurricane Two = Al
Investor        Dollars        Number
XYZ                50                 50

State              50                 50

Grand Tot   2050             150

 

Is there a way to get this into separate datasets to mirror the above proc print.   I need to show these separately in a proc report in ODS.  Proc print separates them as shown and I need to display them in a proc report separately by disaster and state

 

 

    

 

3 REPLIES 3
Tom
Super User Tom
Super User

Do you need a report or datasets?  If datasets why?

 

Are you just look for the PAGEBY statement for PROC PRINT?

 

Are you using ODS to write your report into Excel worksheet(s)?  There are ODS options to produce separate sheets per BY group.

Q1983
Lapis Lazuli | Level 10

 Report only in ODS is what I seek. My question, is there a way to send the  exact format results from proc print to an ODS output without having to create a separate dataset for each.  I just want to present this in separate proc report statements

ballardw
Super User

@Q1983 wrote:

 

Is there a way to get this into separate datasets to mirror the above proc print.   I need to show these separately in a proc report in ODS.  Proc print separates them as shown and I need to display them in a proc report separately by disaster and state

  

 


Please define "separately in a proc report".

It is not clear if want things on a separate page in a report document, in a separate file or what destination.

 

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
  • 682 views
  • 0 likes
  • 3 in conversation