BookmarkSubscribeRSS Feed
spynish29
Calcite | Level 5

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 ?

 

7 REPLIES 7
PeterClemmensen
Tourmaline | Level 20

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

spynish29
Calcite | Level 5

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.

 

Kurt_Bremser
Super User

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.

spynish29
Calcite | Level 5

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 ..

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

ballardw
Super User

@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.

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!

How to Concatenate Values

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.

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
  • 7 replies
  • 3072 views
  • 0 likes
  • 5 in conversation