Call DSLogInfo to file??
Moderators: chulett, rschirm, roy
Call DSLogInfo to file??
We've been tinkering with ideas for compiling metrics for datastage. One idea has been to use the DSJ.JOBSTATUS, throwing it into a variable. But i'm not sure where to go from here. What the overall goal is to write the job name to a text file, format then load it into our data warehouse. Any ideas? Thanks ahead of time!
Re: Call DSLogInfo to file??
If all you want is the job name, use the DS Macro DSJobNamejshurak wrote:What the overall goal is to write the job name to a text file, format then load it into our data warehouse.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
For jobnames you can use
You can use it inside the Universe Stage.
Code: Select all
SELECT NAME FROM DS_JOBS WHERE NAME NOT LIKE '\\%'
Success consists of getting up just one more time than you fall.
thanks for the replies.
I made a mistake in the original post.
I've never used the universe stage, but it sounds like it might be what i'm looking for. Is DS_JOBS a standard datastage table?
I made a mistake in the original post.
What i meant was job status.What the overall goal is to write the job name to a text file, format then load it into our data warehouse.
I've never used the universe stage, but it sounds like it might be what i'm looking for. Is DS_JOBS a standard datastage table?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DS_JOBS is a standard DataStage table, but does not contain job status. The DS_JOBS table records the job's type and category, and an internal number that DataStage uses to refer to the job in all other aspects.
However, you get a job handle via a call to DSAttachJob(), you do not need to be aware that DS_JOBS exists.
Warning: if you execute this code from a running job, the job status will always be "running".
However, you get a job handle via a call to DSAttachJob(), you do not need to be aware that DS_JOBS exists.
Code: Select all
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
hJob = DSAttachJob("MyJobName", DSJ.ERRNONE)
JobStatus = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
* 0 = running, 1 = finished, 2 = warnings, 3 = aborted, etc.
* Negative values such as DSJE.BADHANDLE are errors.
If JobStatus >= 0
Then
Ans = JobStatus
ErrCode = DSDetachJob(hJob)
End
Else
Ans = JobStatus
Call DSLogWarning("Job could not be attached.", "GetJobStatus")
End
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.