BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am having problems with a SAS report showing data in it when there is none. It is an old SAS report that has data from 2/12/2009.

Sometimes a query I run will have a data and sometime it will not have any data after the uses change information, the time it does not have any data in the query the SAS report remembers the old report and includes this in the main report. Is there a way to show not data in the SAS Report if the query has no data, and not show the last SAS report.

I hope this makes sense...

Ryan
4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12
My guess is that SAS is not using the old data, but rather there is no output from the procedure and the report does not get replaced. There are two ways to check for this.

1) look at the time stamp in the footer. It shows when the table was created (the one in the header just shows today's date, so it is not of much use). [You may need to modify the titles tab to put the footnote back in.]
2) look at the task log. If it has errors, the ODS CLOSE statement is not run and the report is not replaced.

I'm not sure how to solve this, but here is a guess. Add some ODS code to the beginning of the task to open the output destination and then close it. Then open it again in the regular way. I've not tried it, but I suspect that it will create a null report (perhaps just titles) that is replaced with a successful report if the task completes.
deleted_user
Not applicable
I am not sure what ODS code is. Where could I find some information on this?

Thank,

Ryan
Cynthia_sas
SAS Super FREQ
Hi:
ODS stands for "Output Delivery System". If you look in your SAS log, you should see an ODS "sandwich" around your code -- put there by EG -- and it should look something like this:

ODS HTML .......<more stuff>

< code generated by EG >

ODS HTML CLOSE;

If you have closed and opened EG since you first had the problem, you don't have to worry, the ODS statements would be closed by closing EG. If, for example, you inserted some code into the "sandwich" -- into the statements generated by EG and -IF- the inserted code had an error, such an error might cause the "ODS HTML CLOSE"; to be unrecognized -- and thus, the file that ODS should have created would NEVER be replaced.

The best solution is to take a very close look at the SAS Log that runs. All you have to do is click 'Open' on the Log icon. Even if you don't understand everything in the Log, look for lines that have the word 'ERROR' or the word 'WARNING'. Some warnings are OK (like ones about VALIDVARNAME), but be on the lookout for any warnings about quoted strings being too long.

There is nothing about ODS that is terribly important at this point. ODS is merely catching the results from SAS and putting them in an HTML, RTF or PDF file for you. The important thing is that ANY error in the program will prevent ODS from writing over the previous report (not just errors in the code you create). So, for example if a file does not exist when you run your project, previous results might not be replaced.

It would really be better for you to examine the SAS log or post a bit of the log here. Or ask one of the more experienced SAS programmers to take a look at the Log to help you figure out the problem. You can also contact Tech Support and they will look at your entire LOG and help figure out what might be going wrong.

cynthia
Doc_Duke
Rhodochrosite | Level 12
SAS uses ODS to deliver the output to EGuide. EGuide builds some ODS statements into the code it sends to the SAS server. SAS has an entire book on ODS in the documentation at support.sas.com. It can get complex enough that there is also a SAS Discussion Forum devoted to it.

I'm no ODS expert (far from it), so I'd just try cut-n-paste on the code that EGuide generates to see if that will work reasonably before delving into the documentation too deeply.

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!

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