To start with,
various return and status codes for SAS are available through predefined macro variables:
SYSERR, SYSFILRC, SYSLIBRC, SYSRC, SYSCC
SYSERR = "Contains a return code status set by some SAS procedures and the DATA step"
Check your SAS Macro Language Reference documentation for detailed descriptions.
Email is more involved, but can be done, I believe via the ODS system. I believe it requires an email account, password, access/knowledge of the email server. But, once set up , it is easy to compose and send an email from within SAS.
Message was edited by: Chuck