Statement not executed due to NOEXEC option. in SAS

246 Views Asked by At

I have a small problem with the automatic execution of a SAS program. For example, if an error is detected in a part of the code, there is an option that will be activated to cancel the execution of the whole code (the codes are not linked) **"NOTE Statement not executed due to NOEXEC option. "**how can i disable this option throughout the program?

MPRINT(INSERTION)   proc sql; 
 NOTE PROC SQL set option NOEXEC and will continue to check the syntax of statements. 
 MPRINT(INSERTION)   select Evaluation_Maj into Evaluation from ASGARDD.Controle_MajTableSAS where Nom_Table="CONTRAT" and  
 Annee_Execution=year(today()) and Mois_Execution=month(today()) and ( Jour_Execution=day(today())-1 or (  
 Jour_Execution=day(today())-2 and not exists ( select 1 from ASGARDD.Controle_MajTableSAS where Nom_Table="CONTRAT" and  
Annee_Execution=year(today()) and Mois_Execution=month(today()) and Jour_Execution=day(today())-1 ) ) ); 
 NOTE Statement not executed due to NOEXEC option. 
 MPRINT(INSERTION)   quit;  ```
1

There are 1 best solutions below

0
Jay Corbett On

It's hard without knowing your whole program, but if a portion of the program created an error such that NOEXEC is turned on it is important to deal with that error. You could try sectioning your program into macros so that you can test that required elements are available prior to executing the portion of the program that is creating the error. You may be able to avoid the error by not running the earlier code. Happy to expand this answer with more info.