05-10-2017 07:45 AM
First, let me start by saying that I am new to the SAS world. So, it is possible that I am overlooking the obvious. :-)
Essentially, I have a DI Studio job that includes 2 controls: User Written; Return Code Check. Everything is working as expected. On the Return Code Check, I am checking the status of my job, and sending emails on "Error" and "Successful". I have 2 environments: DEV; PROD. My jobs are setup and running in both environments. Thus, when I get the emails, it is hard to determine which environment the email is from. So, I would like to include the HOSTNAME in the email (I could use Outlook rules to key on this and do things for Errors). Obviously, I can hardcode the host into the email, which is exactly what I am current doing. My email for "Error" currently looks something like this:
SASPROD -> Error: &etls_jobName (&jobID); TRANS_RD = &trans_rc
This becomes a problem when I promote a new (or updated) job from DEV to PROD, as I always have to remember to modify the Status Handling on each job...updating the HOSTNAME. I have attempted to use &HOSTNAME, but that throws an error. I would like to automatically include the HOSTNAME, server name, or something, that will automatically indicate which environment the message is from.
Thanks for your time and help,
05-10-2017 07:59 AM
05-10-2017 07:59 AM
05-10-2017 08:42 AM
THANK YOU!!! That is exactly what I was looking for. I tried searching for everything and could not find this. So, is there a list of these automatic macro variables that you can point me to? Also, in User Written code, is there a preference as to whether you use these automatic macros variables v.s. global environment variables?
Again, thanks for your help,
05-10-2017 08:46 AM
When you issue
you get a listing of all currently defined macro variables; this is handy when you're looking for something.
Automatic macro variables are more or less platform-independent, while using %sysget() to utilize OS environment variables might give you additional information that SAS doesn't/can't provide.
Need further help from the community? Please ask a new question.