Job Logs in Universe table ?
Moderators: chulett, rschirm, roy
Job Logs in Universe table ?
Hi,
In which Universe table the Job log will be stored ? I want to write a routine to get the seq file with the job logs.
Yes, I can get the job logs via DSGetJobInfo and LinkRowCounts..etc. But I want to get it from Universe Tables.
Appreciated your help.
In which Universe table the Job log will be stored ? I want to write a routine to get the seq file with the job logs.
Yes, I can get the job logs via DSGetJobInfo and LinkRowCounts..etc. But I want to get it from Universe Tables.
Appreciated your help.
The reason I am asking for this, I already wrote a routine which scans thru the job to get the OCI or PxOracle Stages ( given a ServerJob, Px Job) and find out all the links for that OCI/PxStage. And find the Link Counts for Input and Reject/OutPut links (i.e LinkTypes of 1 , 3 ). writes in to Seq File.
But what happens when run routine for Server Job gives the error as 'Unknown Stagename in the <jobname>'
Here is my routine::
* Atatched the Job
LinkRowCount = -1
JobHndle = DSAttachJob(DS_JOB_NAME, DSJ.ERRFATAL)
If NOT(JobHndle) Then
Call DSLogFatal("Job Attach Failed->":DS_JOB_NAME, "JobControl")
Ans = 1
Return ( Ans )
End
* To get the Stages of Type
Call DSGetStagesOfType(TempJobStageList, DS_JOB_NAME, "PxOracle" )
If Trim(TempJobStageList) = '' Then
Call DSGetStagesOfType(TempJobStageList2, DS_JOB_NAME, "ORAOCI9")
JobStageList = TempJobStageList2
End
Else
JobStageList = TempJobStageList
End
Call DSLogInfo("Stages OF Type ":JobStageList ,DS_JOB_NAME)
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageList) , DSJ.LINKTYPES)
Call DSLogInfo("******************LinkTypes ":KnowLinkTypes,DS_JOB_NAME)
* Get Stage Counts from the Job
JobStageCount= Count(JobStageList,',') + 1
Call DSLogInfo("SatgeCount":JobStageCount,DS_JOB_NAME)
* Loop thru all the Stages
For StageLoop =1 To JobStageCount Step 1
JobStageName = Field(JobStageList,",",StageLoop)
Call DSLogInfo("Got the StageName->":JobStageName,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
Call DSLogInfo("Finding StageType before linkTypes->":MyStageType,DS_JOB_NAME)
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.LINKTYPES)
* Or KnowLinkTypes= or KnowLinkTypes = or KnowLinkTypes = or KnowLinkTypes =
If ( KnowLinkTypes = DSJE.BADHANDLE or KnowLinkTypes = DSJE.BADTYPE or KnowLinkTypes = DSJE.NOTINSTAGE or KnowLinkTypes = DSJE.BADSTAGE ) Then
Call DSLogInfo("Error in bad handle Finding StageName->":Trim(JobStageName),DS_JOB_NAME)
Goto MySubRoutineControl
End
JobLinkTypes = KnowLinkTypes
Call DSLogInfo("Know Link Types":KnowLinkTypes ,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
Call DSLogInfo("*******StageType ->":MyStageType ,DS_JOB_NAME)
* Get Link Lists from the Job
JobLinkList = DSGetStageInfo (JobHndle,Trim(JobStageName),DSJ.LINKLIST )
If Not(JobLinkList) Then
Call DSLogInfo("returning...>":Trim(JobStageName) ,DS_JOB_NAME)
Ans = 1
Return ( Ans )
End
Call DSLogInfo("**JobLinkList->":JobLinkList,DS_JOB_NAME)
StageLinkCount= Count(JobLinkList,',') + 1
Call DSLogInfo("****StageLinkCount ->":StageLinkCount ,DS_JOB_NAME)
For LinkLoop = 1 To StageLinkCount Step 1
LinkType = Field(JobLinkTypes,",",LinkLoop)
Call DSLogInfo("**LinkType ->":Trim(LinkType) ,DS_JOB_NAME)
If ( LinkType = 1 OR LinkType = 3 ) Then
JobLinkNames = Field(JobLinkList,",", LinkLoop )
Call DSLogInfo("****JobLinkNames ->":JobLinkNames ,DS_JOB_NAME)
Call DSLogInfo("****JobLinkNames ->":JobLinkNames ,DS_JOB_NAME)
LinkRowCount = DSGetLinkInfo(JobHndle,Trim(JobStageName), JobLinkNames ,DSJ.LINKROWCOUNT )
Call DSLogInfo("****Link Count->":LinkRowCount,DS_JOB_NAME)
txt = Trim(JobStageName):'|':JobLinkNames:'|':LinkRowCount
WRITESEQ txt TO FILE else
Call DSLogFatal("Could not write the file: ":FileName, DS_JOB_NAME)
Ans = 1
Return (Ans)
End
End
Next LinkLoop
* End
Call DSLogInfo("Next Loop ....!!!!!":Trim(JobStageName) ,DS_JOB_NAME)
MySubRoutineControl:
Continue
Next StageLoop
WEOFSEQ FILE ** This is already opened earlier of the Routine , due to spalce constraint, I did not put it here the create criteria.
Ans = 0
But what happens when run routine for Server Job gives the error as 'Unknown Stagename in the <jobname>'
Here is my routine::
* Atatched the Job
LinkRowCount = -1
JobHndle = DSAttachJob(DS_JOB_NAME, DSJ.ERRFATAL)
If NOT(JobHndle) Then
Call DSLogFatal("Job Attach Failed->":DS_JOB_NAME, "JobControl")
Ans = 1
Return ( Ans )
End
* To get the Stages of Type
Call DSGetStagesOfType(TempJobStageList, DS_JOB_NAME, "PxOracle" )
If Trim(TempJobStageList) = '' Then
Call DSGetStagesOfType(TempJobStageList2, DS_JOB_NAME, "ORAOCI9")
JobStageList = TempJobStageList2
End
Else
JobStageList = TempJobStageList
End
Call DSLogInfo("Stages OF Type ":JobStageList ,DS_JOB_NAME)
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageList) , DSJ.LINKTYPES)
Call DSLogInfo("******************LinkTypes ":KnowLinkTypes,DS_JOB_NAME)
* Get Stage Counts from the Job
JobStageCount= Count(JobStageList,',') + 1
Call DSLogInfo("SatgeCount":JobStageCount,DS_JOB_NAME)
* Loop thru all the Stages
For StageLoop =1 To JobStageCount Step 1
JobStageName = Field(JobStageList,",",StageLoop)
Call DSLogInfo("Got the StageName->":JobStageName,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
Call DSLogInfo("Finding StageType before linkTypes->":MyStageType,DS_JOB_NAME)
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.LINKTYPES)
* Or KnowLinkTypes= or KnowLinkTypes = or KnowLinkTypes = or KnowLinkTypes =
If ( KnowLinkTypes = DSJE.BADHANDLE or KnowLinkTypes = DSJE.BADTYPE or KnowLinkTypes = DSJE.NOTINSTAGE or KnowLinkTypes = DSJE.BADSTAGE ) Then
Call DSLogInfo("Error in bad handle Finding StageName->":Trim(JobStageName),DS_JOB_NAME)
Goto MySubRoutineControl
End
JobLinkTypes = KnowLinkTypes
Call DSLogInfo("Know Link Types":KnowLinkTypes ,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
Call DSLogInfo("*******StageType ->":MyStageType ,DS_JOB_NAME)
* Get Link Lists from the Job
JobLinkList = DSGetStageInfo (JobHndle,Trim(JobStageName),DSJ.LINKLIST )
If Not(JobLinkList) Then
Call DSLogInfo("returning...>":Trim(JobStageName) ,DS_JOB_NAME)
Ans = 1
Return ( Ans )
End
Call DSLogInfo("**JobLinkList->":JobLinkList,DS_JOB_NAME)
StageLinkCount= Count(JobLinkList,',') + 1
Call DSLogInfo("****StageLinkCount ->":StageLinkCount ,DS_JOB_NAME)
For LinkLoop = 1 To StageLinkCount Step 1
LinkType = Field(JobLinkTypes,",",LinkLoop)
Call DSLogInfo("**LinkType ->":Trim(LinkType) ,DS_JOB_NAME)
If ( LinkType = 1 OR LinkType = 3 ) Then
JobLinkNames = Field(JobLinkList,",", LinkLoop )
Call DSLogInfo("****JobLinkNames ->":JobLinkNames ,DS_JOB_NAME)
Call DSLogInfo("****JobLinkNames ->":JobLinkNames ,DS_JOB_NAME)
LinkRowCount = DSGetLinkInfo(JobHndle,Trim(JobStageName), JobLinkNames ,DSJ.LINKROWCOUNT )
Call DSLogInfo("****Link Count->":LinkRowCount,DS_JOB_NAME)
txt = Trim(JobStageName):'|':JobLinkNames:'|':LinkRowCount
WRITESEQ txt TO FILE else
Call DSLogFatal("Could not write the file: ":FileName, DS_JOB_NAME)
Ans = 1
Return (Ans)
End
End
Next LinkLoop
* End
Call DSLogInfo("Next Loop ....!!!!!":Trim(JobStageName) ,DS_JOB_NAME)
MySubRoutineControl:
Continue
Next StageLoop
WEOFSEQ FILE ** This is already opened earlier of the Routine , due to spalce constraint, I did not put it here the create criteria.
Ans = 0
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataStage job logs are not stored in UniVerse tables.
They are stored in DataStage tables.
In any case, the job logs will not give you the stage names in a job.
Before we will even look at your code, please encase it in Code tags so that the indenting is preserved. You can edit the previous post; you do not need to post again.
They are stored in DataStage tables.
In any case, the job logs will not give you the stage names in a job.
Before we will even look at your code, please encase it in Code tags so that the indenting is preserved. You can edit the previous post; you do not need to post again.
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.
Ok, now I'm lost... how is the second post related to your original question? You first ask how to get log information from a job's log. Then you post a routine that interogates a job itself for stages and link row counts.
What are you trying to accomplish here? Fix the routine or write a new one that gets and processes information from the logs? If the former, then go back to your post and edit it to add
What are you trying to accomplish here? Fix the routine or write a new one that gets and processes information from the logs? If the former, then go back to your post and edit it to add
Code: Select all
tags[/b] around the routine code to preserve the formating you have in there.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Code: Select all
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
* -------------------
* Open a Sequentila File and write the Info
Ans=0
TempDir=TEMPDIR
TempFile=LOAD_COUNTS_FILE
HdrString='JobStages|JobStageLinkNames|RecCounts'
ValidOpen = @FALSE
FileName = TempDir:'/':TempFile
If FileName Then
OPENSEQ FileName TO FILE Then
ValidOpen = @TRUE
End Else
CREATE FILE Then ValidOpen = @TRUE
End
End
If NOT(ValidOpen) Then
Call DSLogFatal("Could not create the file: ":FileName, FileName)
Ans = 1
Return ( Ans )
End
txt = HdrString
WRITESEQ txt TO FILE else
Call DSLogFatal("Could not write the file: ":FileName, FileName)
End
* Atatched the Job
LinkRowCount = -1
JobHndle = DSAttachJob(DS_JOB_NAME, DSJ.ERRFATAL)
If NOT(JobHndle) Then
Call DSLogFatal("Job Attach Failed->":DS_JOB_NAME, "JobControl")
Ans = 1
Return ( Ans )
End
* To get the Stages of Type
Call DSGetStagesOfType(TempJobStageList, DS_JOB_NAME, "PxOracle" )
If Trim(TempJobStageList) = '' Then
Call DSGetStagesOfType(TempJobStageList2, DS_JOB_NAME, "ORAOCI9")
JobStageList = TempJobStageList2
End
Else
JobStageList = TempJobStageList
End
Call DSLogInfo("Stages OF Type ":JobStageList ,DS_JOB_NAME)
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageList) , DSJ.LINKTYPES)
Call DSLogInfo("******************LinkTypes ":KnowLinkTypes,DS_JOB_NAME)
* Get Stage Counts from the Job
JobStageCount= Count(JobStageList,',') + 1
Call DSLogInfo("SatgeCount":JobStageCount,DS_JOB_NAME)
* Loop thru all the Stages
For StageLoop =1 To JobStageCount Step 1
JobStageName = Field(JobStageList,",",StageLoop)
Call DSLogInfo("Got the StageName->":JobStageName,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
Call DSLogInfo("Finding StageType before linkTypes->":MyStageType,DS_JOB_NAME)
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.LINKTYPES)
JobLinkTypes = KnowLinkTypes
Call DSLogInfo("Know Link Types":KnowLinkTypes ,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
Call DSLogInfo("*******StageType ->":MyStageType ,DS_JOB_NAME)
* Get Link Lists from the Job
JobLinkList = DSGetStageInfo (JobHndle,Trim(JobStageName),DSJ.LINKLIST )
If Not(JobLinkList) Then
Call DSLogInfo("returning...>":Trim(JobStageName) ,DS_JOB_NAME)
Ans = 1
Return ( Ans )
End
Call DSLogInfo("**JobLinkList->":JobLinkList,DS_JOB_NAME)
StageLinkCount= Count(JobLinkList,',') + 1
Call DSLogInfo("****StageLinkCount ->":StageLinkCount ,DS_JOB_NAME)
For LinkLoop = 1 To StageLinkCount Step 1
LinkType = Field(JobLinkTypes,",",LinkLoop)
Call DSLogInfo("**LinkType ->":Trim(LinkType) ,DS_JOB_NAME)
If ( LinkType = 1 OR LinkType = 3 ) Then
JobLinkNames = Field(JobLinkList,",", LinkLoop )
Call DSLogInfo("****JobLinkNames ->":JobLinkNames ,DS_JOB_NAME)
Call DSLogInfo("****JobLinkNames ->":JobLinkNames ,DS_JOB_NAME)
LinkRowCount = DSGetLinkInfo(JobHndle,Trim(JobStageName), JobLinkNames ,DSJ.LINKROWCOUNT )
Call DSLogInfo("****Link Count->":LinkRowCount,DS_JOB_NAME)
txt = Trim(JobStageName):'|':JobLinkNames:'|':LinkRowCount
WRITESEQ txt TO FILE else
Call DSLogFatal("Could not write the file: ":FileName, DS_JOB_NAME)
Ans = 1
Return (Ans)
End
End
Next LinkLoop
* End
Call DSLogInfo("Next Loop ....!!!!!":Trim(JobStageName) ,DS_JOB_NAME)
Next StageLoop
WEOFSEQ FILE
Ans = 0
The error happens at
Code: Select all
KnowLinkTypes = DSGetStageInfo (JobHndle,Trim(JobStageList) , DSJ.LINKTYPES)
Call DSLogInfo("******************LinkTypes ":KnowLinkTypes,DS_JOB_NAME)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DSGetStageInfo() does not take a list of stage names as its second argument. It needs a single stage name. So YOU need another loop. You probably also need a loop for the links within a stage.
Code: Select all
Message = "Link Row Counts"
StageList = Convert(",", @FM, DSGetJobInfo(hJob, DSJ.STAGELIST))
If Len(StageList) > 0
Then
Loop
Remove StageName From StageList Setting MoreStages
LinkList = Convert(",", @FM, DSGetStageInfo(hJob, StageName, DSJ.LINKLIST))
Loop
Remove LinkName From LinkList Setting MoreLinks
RowCount = DSGetLinkInfo(hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
Message<-1> = " Stage " : Quote(StageName) : ", Link " : Quote(LinkName) : ": row count = " : RowCount
While MoreLinks
Repeat
While MoreStages
Repeat
Call DSLogInfo(Message, "Run Statistics")
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.
Yes, I know. DSGetStageInfo() does not take a list of stage names as its second argument.
I dont think that I am doing so. When look into the code, I have a for loop which gets the stage name from the StageList ,comma seperated output in JobStageList variable by Field satement.
I dont think that I am doing so. When look into the code, I have a for loop which gets the stage name from the StageList ,comma seperated output in JobStageList variable by Field satement.
Code: Select all
* Loop thru all the Stages
For StageLoop =1 To JobStageCount Step 1
JobStageName = Field(JobStageList,",",StageLoop)
Call DSLogInfo("Got the StageName->":JobStageName,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
......
-
- Participant
- Posts: 3
- Joined: Mon May 29, 2006 1:24 pm
Ok you use a loop in this case, but not below.
this routine works fine if you respect argument used by the DSGetStageInfo Function.
DSGetStageInfo (<JobHandle>, <JobStageName> ,DSJ.STAGETYPE)
Change the delimiter "," by @FM
this routine works fine if you respect argument used by the DSGetStageInfo Function.
DSGetStageInfo (<JobHandle>, <JobStageName> ,DSJ.STAGETYPE)
Change the delimiter "," by @FM
Code: Select all
* Loop thru all the Stages
JobStageCount = dcount(JobStageList, @FM)
For StageLoop =1 To JobStageCount Step 1
JobStageName = Field(JobStageList,@FM,StageLoop)
Call DSLogInfo("Got the StageName->":JobStageName,DS_JOB_NAME)
MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE)
......
mujeebur wrote:Yes, I know. DSGetStageInfo() does not take a list of stage names as its second argument.
I dont think that I am doing so. When look into the code, I have a for loop which gets the stage name from the StageList ,comma seperated output in JobStageList variable by Field satement.
Code: Select all
* Loop thru all the Stages For StageLoop =1 To JobStageCount Step 1 JobStageName = Field(JobStageList,",",StageLoop) Call DSLogInfo("Got the StageName->":JobStageName,DS_JOB_NAME) MyStageType = DSGetStageInfo (JobHndle,Trim(JobStageName), DSJ.STAGETYPE) ......
Last edited by karmadasai on Fri Jan 05, 2007 4:29 pm, edited 1 time in total.
karmadasai.
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America