To start, you are working with the SAS macro language. So you will need to consider coding a SAS macro with %IF %THEN %DO %END (possibly) and use the %ABORT statement. Or as was mentioned, conditionally execute a SAS DATA step to generate a more meaningful output message to the SAS log and then execute an ABORT ABEND statement.
Also, in addition to the recommended DOC reading below, you may find additional info in the SAS companion guide for your Operating System, where ABORT is further discussed for your OS.
Scott Barry
SBBWorks, Inc.
SAS Macro Language - %ABORT Statement
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002475061.htm
SAS Language Dictionary - ABORT statement
http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000230210.htm
... View more