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

  Macro _EG_CONDITIONAL_DROPDS

 

%_eg_conditional_dropds(WORK.QUERY_FOR_ELIGIBILITY);

 

what is the purpose of this macro?

why do we need to write this code at the beginning of your code?

 

thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager
Enterprise Guide uses this macro (and others that are similar) to avoid warnings when general PROC SQL code creates a table that might already exists. This macro drops (deletes) the table ahead of the next step, which creates an updated version.



It's not a practice that most developers have in their code, but since EG generates lots of code that can be chained together in a flow, statements like these can help avoid innocuous (but distracting) warnings.


Become an Explorer! Join SAS Analytics Explorers to learn and complete challenges that earn rewards!

View solution in original post

2 REPLIES 2
ChrisHemedinger
Community Manager
Enterprise Guide uses this macro (and others that are similar) to avoid warnings when general PROC SQL code creates a table that might already exists. This macro drops (deletes) the table ahead of the next step, which creates an updated version.



It's not a practice that most developers have in their code, but since EG generates lots of code that can be chained together in a flow, statements like these can help avoid innocuous (but distracting) warnings.


Become an Explorer! Join SAS Analytics Explorers to learn and complete challenges that earn rewards!
Reeza
Super User

It drops the data set if it exists. This is to maintain the process integrity, makes sure that the process doesn't continue with data left over from previous run. 

 

I don't think it has to be at the beginning of the code, but where makes sense from a programming perspective. If you clean up all at the beginning, that's not a bad thing either.

 

The code for the macro is here:

http://support.sas.com/kb/38/454.html

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 10138 views
  • 1 like
  • 3 in conversation