Hello All, it would be nice if someone can help me out on this.
I have a process set up in SAS EG, it needs macro to iteratively run over few specific steps. One of the data steps has a temporary dataset that keeps getting overwritten. I need to disable this so i can export the whole list to an excel
any suggestions ?
I am not sure I understand your question exactly.. You have some data set that you do not want to be overwritten, is that it?
Perhaps use the REPLACE= Data Set Option
Hello there ..thanks for the reply..
to your question - yes.. there is a temporary dataset thats part of a series of steps that get called iteratively by macro.
I have the options (repempty=no replace=yes); setup .. however it still does not retain the data it had from the first run. It just has the data from final macro run.
A date step or a create table in sql will always overwrite the existing. Why don't you use proc append?
And what does your macro do? I ask because in 90% of macro questions here on the communities, the solution is to not use a macro.
Hi Kurt,
the macro basically calls and reruns the logistic regression post removing some insignificant variables (so the dataset in question is capturing all removed variables) the logistic reruns after removal of variables and then it overwrites the earlier removed variables in the dataset with the ones that have been removed at last.
hope im making sense here ..
Then you should initialize an empty dataset before the iteration starts and append the temporary data in each iteration.
Or quesiton why your doing an interative process in the first place. Likely due to use of macro code, splitting data up or something like that. Put all your data together then use by groups, its far simpler, easier to code, and you don't end up with a macro mess. Hard to say without test data and what code you have written.
@spynish29 wrote:
Hi Kurt,
the macro basically calls and reruns the logistic regression post removing some insignificant variables (so the dataset in question is capturing all removed variables) the logistic reruns after removal of variables and then it overwrites the earlier removed variables in the dataset with the ones that have been removed at last.
hope im making sense here ..
Perhaps you might want to examine the options in Proc Logistic (or most of the regression procs) about variable SELECTION option and related options such as DETAILS on the model statement that provides output about the steps of the selection process and effects.
Spend some time working with just the proc logistic code before delving into macro code to duplicate what the programmers at SAS have likely already implemented.
This may require actually writing code as I am not sure that every single option combination is available in a point and click task.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.