Desktop productivity for business analysts and programmers

MACROS IN SEG

Accepted Solution Solved
Reply
Occasional Learner
Posts: 1
Accepted Solution

MACROS IN SEG

  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

 


Accepted Solutions
Solution
‎01-20-2016 02:10 PM
Community Manager
Posts: 2,692

Re: MACROS IN SEG

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.


View solution in original post


All Replies
Solution
‎01-20-2016 02:10 PM
Community Manager
Posts: 2,692

Re: MACROS IN SEG

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.


Grand Advisor
Posts: 17,325

Re: MACROS IN SEG

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 275 views
  • 0 likes
  • 3 in conversation