SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

DI Studio Status Handling always returning Success - what am I missing?

Accepted Solution Solved
Reply
Contributor
Posts: 73
Accepted Solution

DI Studio Status Handling always returning Success - what am I missing?

I have a job created in SAS DI Studio.  I have setup two actions for the job under Status Handling (Send Email on Success; Send Email on Error).  The email is working fine.  However, I am ALWAYS getting the SUCCESS email...never getting an error.  I have intentionally introduced an error into my code for testing this...but I am still getting the SUCCESS email.  My DI Studio job is essentially a single "User Written" node that is ETL'ing data to LASRLIB.  As you can see from the sreenshot below, my job is actually ending in an Error.  However, in the example below, I still get a Success email.  I have double checked my Status Handling setup.  I even attempted to remove the Success email, leaving only the Error email...and in this case, I get NO email.  What am I missing here?  I am new to SAS, so I am guessing that it is something obvious Smiley Very Happy.

 

Capture.JPG

 

Thanks,

Ricky


Accepted Solutions
Solution
‎04-27-2017 01:49 PM
Contributor
Posts: 73

Re: DI Studio Status Handling always returning Success - what am I missing?

Well, I figured out what I am missing.  Essentially, since I am using User Written code, I must include the necessary code to set TRANS_RC (the actual macro code does not need to be included in the User Written code).  All that is needed is the necessary calls to set TRANS_RC.  This can be accomplished via the following calls (stratigically placed after certain statements within the code - the line that you use is also based on the statement that is being checked):

 

     %RCSET(&syserr);

     %RCSET(&syslibrc);

     %RCSET(&sqlrc);

 

Thanks,

Ricky

View solution in original post


All Replies
Contributor
Posts: 73

Re: DI Studio Status Handling always returning Success - what am I missing?

Just to add a little more detail to my original question.  I also attempt to move this Status Handling from the job level down to the tranformation level.  Since the User Written transformation does not have the tab for Status Handling, I added a "Return Code Check" to my diagram.  I removed the Status Handling at the job level and added an action for Success and Error on the Return Code Check transformation.  Unfortunately, I am still seeing the same results.  No matter what I try, I get the Success email.  I've got to be missing something here.

 

Thanks,

Ricky

Contributor
Posts: 73

Re: DI Studio Status Handling always returning Success - what am I missing?

OK...after doing some more research and testing, I see that my &trans_rc is always returning 0...thus, the reason that I am always getting Success.  So, if someone could, please tell me if I am on the right track here.  Since I am using User Written code, I am thinking that I need to take care of &trans_rc myself.  I can see in the default code that trans_rc is being set to 0...but then never set again.  So, I am thinking that I need to do something like the following:

 

%macro RCSET(error);
%if (&error gt &TRANS_RC) %then
%let TRANS_RC=&error;
%if (&error gt &JOB_RC) %then
%let JOB_RC=&error;
%mend RCSET;

 

and then call this macro after my differnt statements.  Am I on the right track here?

 

Thanks,

Ricky

Solution
‎04-27-2017 01:49 PM
Contributor
Posts: 73

Re: DI Studio Status Handling always returning Success - what am I missing?

Well, I figured out what I am missing.  Essentially, since I am using User Written code, I must include the necessary code to set TRANS_RC (the actual macro code does not need to be included in the User Written code).  All that is needed is the necessary calls to set TRANS_RC.  This can be accomplished via the following calls (stratigically placed after certain statements within the code - the line that you use is also based on the statement that is being checked):

 

     %RCSET(&syserr);

     %RCSET(&syslibrc);

     %RCSET(&sqlrc);

 

Thanks,

Ricky

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 212 views
  • 0 likes
  • 1 in conversation