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
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.
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
@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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.