BookmarkSubscribeRSS Feed
rkumar23
Calcite | Level 5

On MVS while attaching file it's too large and get above error now what I like to do is fetch this error and notify via email...i tried with SYSERR however that doesn't seems to work out..anybody else got any other thoughts?

2 REPLIES 2
Patrick
Opal | Level 21

Looks like a Warning and not an Error to me.

 

Not sure if this will work but you could try to check for a return code of "warning" and if there is one also check the content of automatic macro variable "&SYSWARNINGTEXT" (=does it contain the expected warning). Send an email if both conditions are satisfied.

I hope this little program helps:

 

/*if the commented set statement is used instead of the
uncommented set statement in the second data step below,
the value of &syscc will be non-zero for the program, and
the value of &syserr will be non-zero for the step. You can
see in the log that the value of &syserr will change for each
step and the value of &syscc will not.
*/
options mprint symbolgen;
%macro conditionally;
data test;
x=4;
run;
data foo;
set test;
/*set nolib.nodata;*/
if x=2 then delete;
run;
%put &syscc;/*this macro value returns a non-zero for the program
if there is any message other than a NOTE*/
%put &syserr;/*this macro value returns a non-zero for the step
of the program*/
%if &syserr ne 0 %then %do;
%put 'ERROR in DATA Step';
%end;
%else %do;
proc print;
run;
%end;
data one;x=0;run;
%put &syserr;
%put &syscc;
%mend;

%conditionally;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2302 views
  • 0 likes
  • 3 in conversation