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.


SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

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.


SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 9088 views
  • 1 like
  • 3 in conversation