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.


It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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.


It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 7750 views
  • 1 like
  • 3 in conversation