hi,
I have one reuirement that
I have one Table which contains information about all job LOGS.
Jobnam, Status, startdate, enddate
I want to develop reusable component in such a way that,
In the starting of the job I will call that shared container. It will insert one row for that Job like:- Job1,Started,2013-09-18,Null
And at the end of the job again I will call that Shared container it will just update that records with status and end date:-
Job1,Completed,2013-09-08 01:00:00,2013-09-18 10:00:00 like this.
Please suggest any feasible way to develop this?
Shared Container
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
You can design a job with multiple instance which will insert the job log.
Design a sequence and call this job with some instance before your main job starts and call it again with another instance after main job finishes.
Design a sequence and call this job with some instance before your main job starts and call it again with another instance after main job finishes.
Thanks
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
While using a shared container is feasible, I would use either the Job-Sequence approach mentioned earlier or, as I usually do, use the Before-Job and After-Job subroutine calls to perform this logging directly using BASIC-Code or to use the BASIC-Code to start up a background PX job which will do the logging.
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Thats interesting,can you please share a basic code to trigger a job.ArndW wrote: as I usually do, use the Before-Job and After-Job subroutine calls to perform this logging directly using BASIC-Code or to use the BASIC-Code to start up a background PX job which will do the logging.
Thanks
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
It is trivial code, you create your Before-Job or After-Job routine, and within the routine do something like:
Code: Select all
JobHandle = DSAttachJob('MyJob',DSJ.ERRFATAL)
IF NOT(JobHandle)
THEN
CALL DSLogWarn('Oops, unable to open Job MyJob.', "JobControl")
END
ELSE
************************************************
** If the job isn't running yet then start it **
************************************************
JobStatus = DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
IF JobStatus # DSJS.RUNNING
THEN
JobHandle = DSPrepareJob(JobHandle)
ErrCode = DSSetParam(JobHandle,"$Param1", "$PROJDEF")
ErrCode = DSSetParam(JobHandle,"$Param2", "$PROJDEF")
ErrCode = DSSetParam(JobHandle,"$Param3", "$PROJDEF")
ErrCode = DSSetParam(JobHandle,"$Param4", "$PROJDEF")
ErrCode = DSSetDisableProjectHandler(JobHandle, @FALSE)
ErrCode = DSSetDisableJobHandler(JobHandle, @FALSE)
ErrCode = DSRunJob(JobHandle, DSJ.RUNNORMAL)
ErrCode = DSDetachJob(JobHandle)
END ;** of IF-THEN-ELSE Job is already running
Dummy = DSDetachJob(JobHandle)
END ;** of IF-THEN-ELSE Job couldn't be attached to
-
- Participant
- Posts: 11
- Joined: Wed Aug 28, 2013 6:38 am
Can you please elaborate it more
ArndW wrote:It is trivial code, you create your Before-Job or After-Job routine, and within the routine do something like:
Code: Select all
JobHandle = DSAttachJob('MyJob',DSJ.ERRFATAL) IF NOT(JobHan ...[/quote]