BookmarkSubscribeRSS Feed
SwagatPatil
Fluorite | Level 6
We are facing issue in proc sql below error in batch jobs.
Statements not executed due to NOEXEC option.
The SAS systems stopped processing this step because of errors.

Is there need to change options in sasbatch.sh or workspace.sh as we are currently migrated to SAS 9.3 to SAS 9.4
6 REPLIES 6
SuryaKiran
Meteorite | Level 14

I think this is something to do with the code and not any options or something else. Your SQL query might have syntax error or NOEXEC option is set in PROC SQL.

 

image.png

 

Remove NOEXEC if present.

proc sql noexec;
select * from sashelp.class
;
quit;

image.png

Thanks,
Suryakiran
Kurt_Bremser
Super User
Statements not executed due to NOEXEC option

is a typical consequence of an ERROR that has sent SAS into syntax check mode (the syntax is verified, but nothing is executed).

Read the log from top down and fix ERRORs/WARNINGs one by one.

SwagatPatil
Fluorite | Level 6
I need the second step need to execute if first proc has errors.
I have some control tables that should be update if any error occurs. But if error occurs then next procedures are not executed thats why my control table is not getting updated
SuryaKiran
Meteorite | Level 14

What is it your trying to achieve here, trying to run a query if errors exists is not a recommended way. Invoke your query based on the condition that fails the query. 

 

for example:

My below query fails to execute if macro variable values is not assigned.

 

proc sql ;
select * from sashelp.class
where Age=&Age
;
quit;

I can conditionally run this query 

 

%Macro run_Query();
proc sql ;
select * from sashelp.class
where Age=&Age
;
quit;
%Mend;

%macro isBlank();
 %IF   %sysevalf(%superq(Age)=,boolean) %then %return;
%else %run_Query();
%mend isBlank; 
%ISBLANK();

%symdel age/nowarn;
%ISBLANK();
Thanks,
Suryakiran
SwagatPatil
Fluorite | Level 6
I need to capture the error , then my control table should some values that indicates my job completed with errors. So it needs to be run below steps to update the control table.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 13192 views
  • 3 likes
  • 3 in conversation