BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lopa2016
Fluorite | Level 6

Hi,

 

I am trying to write ods output while using proc surveyselect 

options mprint mlogic symbolgen;
%macro LogitBoot(data = , dv = , iv = ,class=, n = );
proc sql noprint;
create table logit_result
(iv char(10), prob num format = 6.4,
sig1 num format = 4., sig2 num format = 4.,
sig3 num format = 4., sig4 num format = 4.);
select count(*) into :sample from &data;
quit;
%do i = 1 %to &n;
proc surveyselect data = training method = urs out = &data._tmp n = &sample
noprint;
run;
ods output type3 = model_tmp;
%end;
%mend LogitBoot;

 

But I keep getting the following warning :

 

WARNING: Output 'type3' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify
that the appropriate procedure options are used to produce the requested output object. For example, verify that the
NOPRINT option is not used.

 

Can someone help?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Here is an article about how to "Find the ODS table names produced by any SAS procedure"

There are (at least) three things wrong with your program.

1. When you use the NOPRINT option, no ODS output is created.

2. The SURVEYSELECT procedure does not create a table named 'Type3';

3. Any ODS statement needs to go before or inside a procedue.

 

There is a bigger problem, however. it appears that you are trying to do bootstrapping by using a macro loop. This is a bad idea. Please read the following article, which describes a better way to bootstrap in SAS:

- "Compute a bootstrap confidence interval in SAS"

 

 

View solution in original post

9 REPLIES 9
Reeza
Super User

The ODS statement needs to come before the proc, not after. 

RUN is a step boundary, nothing after RUN will affect the PROC before. 

Lopa2016
Fluorite | Level 6
Sorry doesn't work !!
Reeza
Super User

What does the log say then?

Try getting it working without a macro first and then you can convert your code to macro logic. 

Reeza
Super User

Proc surveyselect will not generate any model so using table name type3 makes no sense. What are you trying to do in the ODS statement? 

Rick_SAS
SAS Super FREQ

Here is an article about how to "Find the ODS table names produced by any SAS procedure"

There are (at least) three things wrong with your program.

1. When you use the NOPRINT option, no ODS output is created.

2. The SURVEYSELECT procedure does not create a table named 'Type3';

3. Any ODS statement needs to go before or inside a procedue.

 

There is a bigger problem, however. it appears that you are trying to do bootstrapping by using a macro loop. This is a bad idea. Please read the following article, which describes a better way to bootstrap in SAS:

- "Compute a bootstrap confidence interval in SAS"

 

 
Lopa2016
Fluorite | Level 6

I even tried to do the following :

 

proc logistic data = training_tmp desc;
freq numberhits;
class &class1;
model CancelInd = &new_var;
ODS OUTPUT oddsratios=odds1 type3=type1 fitstatistics =fit1;
run;

But it generates everything else apart from the type3

Reeza
Super User

What does the log say in this case?

Lopa2016
Fluorite | Level 6

The issue resolves if a ref statement is specified in the class statement

Reeza
Super User

@Lopa2016 wrote:

The issue resolves if a ref statement is specified in the class statement


This is incorrect, you must have had some other error. Did you include a CLASS variable, that is required?

 

proc logistic data=sashelp.heart;
class BP_status;
model status = bp_status height weight;
ods output type3=want;
run;

Log - note the message that the table name has changed and this may not work in the future:

 

60
61 proc logistic data=sashelp.heart;
62 class BP_status;
63 model status = bp_status height weight;
64 ods output type3=want;
65 run;
 
NOTE: PROC LOGISTIC is modeling the probability that Status='Alive'. One way to change this to model the probability that
Status='Dead' is to specify the response variable option EVENT='Dead'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
WARNING: The Logistic output formerly named Type3 is now named ModelANOVA. Please use the new output name in the future; the old syntax might not work in the next release.
 
NOTE: The data set WORK.WANT has 3 observations and 4 variables.
 
NOTE: There were 5209 observations read from the data set SASHELP.HEART.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.14 seconds
cpu time 0.15 seconds

 

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 2096 views
  • 3 likes
  • 3 in conversation