BookmarkSubscribeRSS Feed
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello,
Let us consider the following example, taken from SAS Help:
Example 14.6: Creating an Output Data Set from an ODS Table
data insure;
  input n c car$ age;
  ln = log(n);
 
datalines;
  
500   42  small  1
  
1200  37  medium 1
  
100    1  large  1
  
400  101  small  2
  
500   73  medium 2
  
300   14  large  2
   ;
run;
/* SAS Help: "The purpose of the following statements is to obtain the names of the output
tables produced in this PROC GENMOD run. The ODS TRACE statement lists the
trace record, and the SAS listing destination is closed so that no output
is displayed." */

/* Begin */;
ods trace on;
ods listing close;
proc genmod data=insure;
  class car age;
  model c = car age / dist   = poisson
   
link   = log
   
offset = ln
   
obstats;
run;
ods trace off;
/* End */;
ods output ObStats=myObStats
  (keep=car age pred
  rename=(pred=PredictedValue));
proc genmod data=insure;
  class car age;
  model c = car age / dist   = poisson
   
link   = log
   
offset = ln
   
obstats;
run;
It works without any errors on my EG 4.3 but does not react on ods listing close;.
I still getting normal output (SAS report) from the code section between /* Begin */; and /* End */;
Please help.
5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12

A SAS Report is not an ODS listing file.  When I submit the code, I get this line added

ODS tagsets.sasreport12(ID=EGSR) FILE=EGSR STYLE=Plateau

12       ! STYLESHEET=(URL="file:///C:/Program%20Files/SAS/EnterpriseGuide/4.3/Styles/Plateau.cs

12       ! s") NOGFOOTNOTE GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");

by EGuide.  I think that you need to close that to eliminate the SAS Report.

Doc Muhlbaier

Duke

SPR
Quartz | Level 8 SPR
Quartz | Level 8

Thanks for additional info. I also see "ODS tagsets.dsasreport12 etc." in my LOG.

You wrote "I think that you need to close that to eliminate the SAS Report". How to do that?

SPR

Doc_Duke
Rhodochrosite | Level 12

Didn't know, but since you asked, it is an easy google search:

ods tagset close site:sas.com

SPR
Quartz | Level 8 SPR
Quartz | Level 8


Hello Doc@Duke,

Using your suggestions I made some progress, namely

ODS _ALL_ Close;

closes all open destinations, which is good. However, I can not figure out how to open SASREPORT12 tagset again. Using

ODS markup tagset=sasreport12;

produces an error pointing to unsuficient authorization to access sasreport12.xml. This is expected because I

have no access to SAS server.

Any help?

SPR
Quartz | Level 8 SPR
Quartz | Level 8

Additional experimenting resulted in a solution (not very elegant I think):

data insure;
  input n c car$ age;
  ln = log(n);
  datalines;
   500   42  small  1
   1200  37  medium 1
   100    1  large  1
   400  101  small  2
   500   73  medium 2
   300   14  large  2
   ;
run;
ods _all_ close; /* Closes all output */
ods output ObStats=myObStats (keep=car age pred
  rename=(pred=PredictedValue)); /* Creates dataset MyObStats without displaying any output  */
proc genmod data=insure;
  class car age;
  model c = car age / dist   = poisson
    link   = log
    offset = ln
    obstats;
run;

proc print data=insure; /* Does not produce output  because output is closed */
run;

/*  Returns Sasreport back */
ODS tagsets.sasreport12(ID=EGSR) FILE=EGSR STYLE=Plateau
STYLESHEET=(URL="file:///C:/SAS92/EnterpriseGuide/4.3/Styles/Plateau.css")
NOGTITLE NOGFOOTNOTE GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");
proc print data=insure; /* Displays SASreport  */
run;

I guess that

ODS tagsets.sasreport12(ID=EGSR) FILE=EGSR STYLE=Plateau
STYLESHEET=(URL="file:///C:/SAS92/EnterpriseGuide/4.3/Styles/Plateau.css")
NOGTITLE NOGFOOTNOTE GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");


depends on specific SAS installation. This ODS statement is produced by EG 4.3 if one checks

TOOLS/Options/Results General/Show generated wrapper code in SAS log.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 5 replies
  • 1624 views
  • 6 likes
  • 2 in conversation