Desktop productivity for business analysts and programmers

proc report

Reply
N/A
Posts: 0

proc report

I searched the archives, but couldn't find this issue. I apologize if I overlooked a previous answer.

My PROC REPORT code in EG is producing too much output for my project. I have diverted the output to a file, but I it still shows up in my Project output. How should I do, so the output will not be show up in my project output.

This is my code:

ods listing close;
ods html file='c:\test.htm';
proc report data=sashelp.class out=procreportdata nowd;
run;
ods html close;

Pretend that sashelp.class had a billion records.

Thanks.
SAS Super FREQ
Posts: 8,720

Re: proc report

Hi:
It is unlikely that a detail listing report of a billion records would be very useful to anyone. I'm curious why you're creating an output data set (using OUT=) with PROC REPORT. Given your current code, you're reading a billion records, creating a report file of a billion record and then creating an output dataset of that same billion records. It doesn't seem necessary to me.

On the other hand, if you were to create a SUMMARY report, it might consolidate some of the report rows. For example, if you submitted the following code:
[pre]
ods listing close;
ods html file='c:\test.htm';
proc report data=sashelp.class nowd;
title 'Summary Report';
column age n,sex;
define age / group;
define sex / across 'Gender';
define n / 'Count';
run;
ods html close;
[/pre]


Instead of seeing the 19 report rows (one for each person in SASHELP.CLASS, you would see only 6 report rows, a summary report -- one row for each unique value of AGE in SASHELP.CLASS.

You might get some other ideas about how to use PROC REPORT by referring to this guide on using PROC REPORT in non-interactive mode:
http://support.sas.com/documentation/onlinedoc/v82/techreport_p258.pdf

Perhaps if you could explain what your goal or desired report is, others might have some alternate task, wizard or procedure suggestions.

cynthia
N/A
Posts: 0

Re: proc report

Hi, Thank you for the help.

The reason I am asking proc report, I have a code was from someone else. I am maintaining this codeand don't want do many changes. The guy used 'proc report' to create output dataset all the time. Proc report normally insert a html to project. I am looking for a way (such options) to prohibt html output.
Any suggion?

Cathy
SAS Super FREQ
Posts: 8,720

Re: proc report

Hi:
Well, EG adds ODS HTML code around your project code automatically. So one thing you can do is something like this:
[pre]

ods _all_ close;

proc report data=sashelp.class nowd
out=procreportdata;
run;
[/pre]

What's going to happen is that EG will put the opening HTML statement and then your ODS _ALL_ CLOSE statement will immediately CLOSE all the open destinations, including the LISTING destination.

Then, proc report will run and create your output dataset (which you should then see in your project. Note that I did NOT put any extra ODS HTML statements around my PROC REPORT. In this instance, I am merely using PROC REPORT to make me an OUTPUT dataset using the OUT= option. If you did want to direct your output to another destination, then your code would look like this:

[pre]

ods _all_ close; /* Close EG HTML file */

ods html file='c:\temp\onlymine.html' style=sasweb; /* create separate HTML file */
proc report data=sashelp.class nowd
out=procreportdata;
run;
ods html close;
[/pre]

cynthia
N/A
Posts: 0

Re: proc report

Great! Thank you.
Ask a Question
Discussion stats
  • 4 replies
  • 140 views
  • 0 likes
  • 2 in conversation