FatCaptain
Programmer
Hi,
I'm trying to generate a variable in SAS which shows whether the code has run without any errors.
The main body of the code is run on the server using an rsubmit command. The error variable needs to be available locally on my pc.
The code is very simple as it just backs up some SAS datasets e.g.
I've been playing around with &syserr and &_efierr_ to obtain an error flag and %sysrput to get the variable on the server to the local machine.
Once I have this error flag on the local machine, I would like to use it to alter the contents of an automated email as shown in this thread;
e.g.
Any help with this would be appreciated!
Cheers,
FatCaptain.
I'm trying to generate a variable in SAS which shows whether the code has run without any errors.
The main body of the code is run on the server using an rsubmit command. The error variable needs to be available locally on my pc.
The code is very simple as it just backs up some SAS datasets e.g.
Code:
rsubmit;
data dataset_backup ;
set dataset ;
run ;
data dataset2_backup ;
set dataset2 ;
run ;
endrsubmit;
I've been playing around with &syserr and &_efierr_ to obtain an error flag and %sysrput to get the variable on the server to the local machine.
Once I have this error flag on the local machine, I would like to use it to alter the contents of an automated email as shown in this thread;
e.g.
Code:
*If the code has no errors;
%if &localerrorvar = 0 %then %do;
put '.Subject = "Files backed up successfully"';
%end;
*If the code has fallen over or has errors;
%if &localerrorvar = 1 %then %do;
put '.Subject = "FILE BACKUP ERROR"';
%end;
Any help with this would be appreciated!
Cheers,
FatCaptain.