cancel
Showing results for 
Search instead for 
Did you mean: 

if we run this function it should say job is running/not running/error etc in BODS

0 Kudos

Hi Experts,

How can we create functions in BODS for Job status tracking like success, failure etc.

Thanks

Naresh P

Accepted Solutions (1)

Accepted Solutions (1)

former_member442248
Active Participant
0 Kudos

Hi.

There are 2 ways of doing this.

  1. Use the repo metadata AL_HISTORY table. You can query it using the DS function based on several attributes present in the table. A word of caution using the repo metadata tables is never a recommended approach
  2. Create a custom logging table specifically for your project / business unit / enterprise. Log the job status at multiple stages of execution like initializing, In Progress, Success or Failed and query these statuses before triggering the next instance.

Hope this helps.

Regards. S

Answers (1)

Answers (1)

0 Kudos

Hi Shazin,

Thanks for your update.

I tried 2nd option, but I am unable to print job_name(). Screen shot attached, I have created Job_status table in hana and I am trying capure the status in this table.

Thanks

Naresh P

job.pngjob-name-print.png

former_member442248
Active Participant
0 Kudos

Hi.

Syntax is wrong. It should be as below:

Regards. S

0 Kudos

Hi Shazin,

Thanks for your update.

I have modified my code but still, I am not able to print job name.

Code:

$GV_Cnt = sql('DFP_NEW','SELECT COUNT(*) FROM JOB_STATUS');

if ($GV_Cnt < 0)

$GV_JobName = job_name( );

print('job_name : '|| $GV_JobName);

$GV_Date = sysdate( );

sql('DFP_NEW','insert into JOB_STATUS values({$GV_JobName},1,{$GV_Date})');

print('the job_name is successfully executed :[$GV_JobName]');

Thanks

Naresh P