DSMakeJobReport Code

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

DSMakeJobReport Code

Post by Titto »

Hi,

Any idea where do i get the code for DSMakeJobReport.

Thanks
Luciana
Participant
Posts: 60
Joined: Fri Jun 10, 2005 7:22 am
Location: Brasil

Post by Luciana »

Hi

The code for DSMakeJobReport can be acquired in Server Job Developer's Guide

Sample:

Code: Select all

$include DSINCLUDE JOBCONTROL.H
JobHandle = DSAttachJob (JobName, DSJ.ERRFATAL)
      If NOT(JobHandle ) Then
         Call DSLogFatal("Job not exists!", "JobControl")
         Abort
      End
Ans = DSMakeJobReport(JobHandle,Type,"LF")
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

Luciana,

Actually i am looking for DSMakeJobReport function code it self.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It is an internal routine that is supplied only as object code without any source, so we are out of luck on that one.
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

Thanks! Arndw
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Lots of code posted which does the same. What do want to do with it?
Mamu Kim
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

I am trying to get the job stats like when it is started, ended, input link counts and outut link count...
I tried using DSGobLogSummary fucntion but the code i got it in message board is returning the same as in Director but i need the output in detail.
Like if you click the director log it will pop up a window and gives all the details - that is what i am looking
any help is appreciated!!!
I used the following code - this one is giving latest job log same as director but not giving inner details

Code: Select all

*************************************************************
* Attaching the job handle of the job, whose log has to be written - 
* I.JobName and I.LogFile are parameters 
************************************************************* 

hJob1 = DSAttachJob(JobName, DSJ.ERRFATAL) 
If NOT(hJob1) Then 
Call DSLogFatal("Job Attach Failed":JobName, "JobControl") 
Abort 
End 

************************************************SRI*****************
*LatestLogId = DSGetNewestLogId(hJob1,DSJ.LOGANY)
*LatestEventString = DSGetLogEntry(hJob1,LatestLogId)

*************************************************************
* Calculating the job start time and the current time - the window for 
* getting the log and the invocation id of the job 
************************************************************* 

JobStartTime = DSGetJobInfo (hJob1, DSJ.JOBSTARTTIMESTAMP) 
CurrentTime = Oconv(Date(),"D-YMD[4,2,2]"):' ':Field(TimeDate(), " ", 1, 1) 
JobInvocationId = DSGetJobInfo (hJob1, DSJ.JOBINVOCATIONID) 

Call DSLogInfo("Job Start time":JobStartTime,"JobControl") 
Call DSLogInfo("Current time":CurrentTime,"JobControl") 
Call DSLogInfo("Current job Invocation id" : JobInvocationId, "JobControl")


*************************************************************
* Fetching the job log info using DSGetLogSummary in to the dynamic 
* array LOGANY - Indicates all sort of log info 
* 0 indicates unlimited records of log 
************************************************************* 

SummaryArray = DSGetLogSummary(hJob1,DSJ.LOGANY,JobStartTime,CurrentTime,0) 


************************************************************* 
* Computing the number of lines of log, filtering the log based on 
* invocation id and writting into the log file 
************************************************************* 

ArrayLines = DCOUNT(SummaryArray,@FM) ;** count number of lines 

OpenSeq LogFile To SeqOutFilePtr Then 
WeofSeq SeqOutFilePtr ;* write end-of-file mark immediately 
End 

FOR Counter = 1 TO ArrayLines 
TempLine = FIELD(SummaryArray,@FM,Counter) 
If FIELD(TempLine,'\',4) = JobInvocationId 
 Then 

  WriteSeq TempLine To SeqOutFilePtr 
  On Error 
  Call DSLogFatal("Error from status=":Status(),"JobControl") 
 End 
Else 
 Call DSLogInfo ("Unable to Write to ","JobControl") 
End 

End 
NEXT Counter 

CloseSeq SeqOutFilePtr 

************************************************************* 
*End 
************************************************************* 
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Mamu Kim
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

Hi Duke,

Can you please post the total code what you are mentioning.

Thanks
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I think I have. Search for it.
Mamu Kim
Post Reply