BookmarkSubscribeRSS Feed
Shantaram
Calcite | Level 5

Hi,

How to track error count in DI job from log. Its possible or not ??. 

5 REPLIES 5
LinusH
Tourmaline | Level 20

Can you please specify what you mean by Error, every time an Error: message appears, when the rc is set to an error code. What about user (problematically) error conditions.

And how do you want to track it, store the result in log tables, in a report...?

Data never sleeps
Shantaram
Calcite | Level 5

Hi,

 

Any type of error like connection problem or coding related issue. acctually we need to create bakup of particular job in precode after successful execution we need to delete bakup in postcode but in execution process we get any error that time we don't wan't execute postcode .

 %if &cnt_error ^gt o
%then %do;
proc sql;
drop table biuo1.test_bkp1;
quit;
%END; 

but its not working.

LinusH
Tourmaline | Level 20

Ok, I see.

If you encounter a "hard" error situation like out of resources, lock not available etc, SAS will default enter syntax check mode, so in these situations your "not executing post code" will be no problem.

 

DI Studio jobs automatically updates the &job_rc macro variable throughout the job, and keeps the highest value. Perhaps you could use that one for a simple NE condition in your post code macro logic?

 

http://support.sas.com/documentation/cdl/en/etlug/67323/HTML/default/viewer.htm#p0p2c5hzlgy6acn18ql0...

 

Data never sleeps
ad123123
Fluorite | Level 6

Hi Friend,

 

I am assuming that your problem statement is like this:-

 

You have taken back up for one table and you ran one job. If your job is succesful then only you have to delete back up other wise you do not have to delete this.

 

There are 2 probable solution for this:-

 

Solution 1:- You can use available transformation in DI studio called as "Return code check".

Go to "Transformations" tab-->Control--> Return code check.

 

PLease use the link below to get details how to use this transformation:-

 

http://support.sas.com/documentation/cdl/en/etlug/65016/HTML/default/viewer.htm#n13t3zm3lp6u7dn15a8k...

 

 

Solution 2:- You can manually check value of rc in your ETL job post code and send entry in a dataset depending on success or failure. If job is successful then create a dataset having entry "Successful". This you can do it by clicking on properties on ETL job. Go to status handlling. Click on " New" and then set the condition acording to your requirement.

 

I hope this will help.

Shantaram
Calcite | Level 5

Hi

 

We get the solution of that problem.

in precode create the bakup of account_bal table and write the following code in postcode. 


%macro etls_jobRCChk;
%if (&job_rc le 5) %then
%do;
proc sql;
drop table ACCOUNT_BAL_bkp;
quit;
%end;
%mend etls_jobRCChk;
%etls_jobRCChk;

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2742 views
  • 0 likes
  • 3 in conversation