SAS likes to continue processing well after warnings and errors, so I often need to scroll back through pages in the log to find an issue. Is there a better way? I\'d like
One option is to replace run
with run &g_cancel
throughout, and proc sql;
with proc sql &g_noexec;
. Initially &g_cancel
and &g_noexec
are set to nothing so everything runs.
On hitting an error (either %sys_rc
, %sql_rc
or using referring to business logic) set &g_cancel
to cancel and &g_noexec
to noexec.
This should stop any subsequent steps from running - obviously the macro variables can be omitted for steps that have to run regardless (for instance a tidy up) or checked before performing steps purely in macro.
Note for Enterprise Guide users: The only warning note is that if you are running multiple code items in the same session you will need to reset the error terms at the start of each code item, lest unrelated errors stop anything working.