Please see the following code:
ods output
ParameterEstimates = sas_1.ParameterEstimates ;
In Proc Logistic, selection = stepwise, (and in perhaps other procedures), more than one ParameterEstimates files (datasets) are generated. (Discovered via ods trace on.)
With each subsequent creation, SAS overwrites the existing ParameterEstimates file, if one exists. So, what one ends up with (apparently) is the 'final' version. (Please correct if I am mistaken here.)
With the generation of graphs, SAS auto-numbers incrementing new graphs with appended numbers.
Can we do similarly with the ods output to datasets?
If you wanted to catch each and every dataset output generated, how would you achieve this? (Say, for instance, to compare the first with the final...)
Thanks!
Nicholas Kormanik
If I am reading the manual right it should be putting them all into the same dataset, not overwriting it.
If you want it to make separate datasets you should use the MATCH_ALL option.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p0oxrbinw6fjuwn1x23qam6dntyd.htm
Prepare a SAS data set to be created.The ODS OUTPUT statement opens the OUTPUT destination. By default, the list for the OUTPUT destination is EXCLUDE ALL. This ODS OUTPUT statement puts SelectionSummary in the selection list for the destination. The MATCH_ALL option produces a SAS data set for each instance of SelectionSummary. The name of the first data set is Summary, and the name of the second data set is Summary1. ODS stores a list of these names in the macro variable list. This variable is used later in the example to combine the data sets.ods output SelectionSummary(match_all=list) = summary; title1 'Using the MATCH_ALL Option Produces Two Data Sets With Different Columns';
Since you have already done this, show us the ODS TRACE for your PROC LOGISTIC. Please paste the ODS TRACE output into the window that appears when you click on the </> icon so as to preserve the formatting.
Output Added: ------------- Name: ParameterEstimates Label: Parameter Estimates Template: Stat.Logistic.ParameterEstimates Path: Logistic.Step0.ParameterEstimates Label Path: 'The Logistic Procedure'.'Step 0'.'Parameter Estimates' ------------- Output Added: ------------- Name: ParameterEstimates Label: Parameter Estimates Template: Stat.Logistic.ParameterEstimates Path: Logistic.Step1.ParameterEstimates Label Path: 'The Logistic Procedure'.'Step 1'.'Parameter Estimates' ------------- Output Added: ------------- Name: ParameterEstimates Label: Parameter Estimates Template: Stat.Logistic.ParameterEstimates Path: Logistic.Step2.ParameterEstimates Label Path: 'The Logistic Procedure'.'Step 2'.'Parameter Estimates' -------------
If I am reading the manual right it should be putting them all into the same dataset, not overwriting it.
If you want it to make separate datasets you should use the MATCH_ALL option.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p0oxrbinw6fjuwn1x23qam6dntyd.htm
Prepare a SAS data set to be created.The ODS OUTPUT statement opens the OUTPUT destination. By default, the list for the OUTPUT destination is EXCLUDE ALL. This ODS OUTPUT statement puts SelectionSummary in the selection list for the destination. The MATCH_ALL option produces a SAS data set for each instance of SelectionSummary. The name of the first data set is Summary, and the name of the second data set is Summary1. ODS stores a list of these names in the macro variable list. This variable is used later in the example to combine the data sets.ods output SelectionSummary(match_all=list) = summary; title1 'Using the MATCH_ALL Option Produces Two Data Sets With Different Columns';
Bingo, @Tom . That did it. Not the best wording for such an option, in my opinion.
ods output
FitStatistics (MATCH_ALL) = sas_1.FitStatistics ;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.