The SAS Output Delivery System and reporting techniques

Proc print to datastep and proc report

Reply
Regular Contributor
Posts: 178

Proc print to datastep and proc report

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

 

 

    

 

Super User
Super User
Posts: 7,844

Re: Proc print to datastep and proc report

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.

Regular Contributor
Posts: 178

Re: Proc print to datastep and proc report

 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

Super User
Posts: 12,994

Re: Proc print to datastep and proc report


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.

 

Ask a Question
Discussion stats
  • 3 replies
  • 144 views
  • 0 likes
  • 3 in conversation