BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
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
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
Great! Thank you.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 688 views
  • 0 likes
  • 2 in conversation