Search notes:

SAS programming - macro statement: %abort

Assert

The macro tq84_assertHost asserts we're running on a specific (expected) server.
If not, the macro aborts.
%macro tq84_assertHost(host);

  %if &syshostname ne &host %then %do;
    %put ERROR: Assertion failed, not running on &host but on &syshostname;
    %abort;
  %end;

  %put INFO: OK: Running on &syshostname;

%mend tq84_assertHost;

/* Assert we're running on host with name tq84 */
%tq84_assertHost(tq84);
Github repository about-SAS, path: /macro-processor/statements/abort/assertHost.sas

See also

macro statements, abort
error handling

Index