Page 1 of 1

DSMakeJobReport Code

Posted: Fri Dec 09, 2005 1:38 pm
by Titto
Hi,

Any idea where do i get the code for DSMakeJobReport.

Thanks

Posted: Fri Dec 09, 2005 2:01 pm
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")

Posted: Mon Dec 12, 2005 9:02 am
by Titto
Luciana,

Actually i am looking for DSMakeJobReport function code it self.

Posted: Mon Dec 12, 2005 9:15 am
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.

Posted: Mon Dec 12, 2005 12:54 pm
by Titto
Thanks! Arndw

Posted: Mon Dec 12, 2005 6:42 pm
by kduke
Lots of code posted which does the same. What do want to do with it?

Posted: Tue Dec 13, 2005 11:00 am
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 
************************************************************* 

Posted: Tue Dec 13, 2005 8:19 pm
by kduke

Posted: Wed Dec 14, 2005 12:59 pm
by Titto
Hi Duke,

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

Thanks

Posted: Wed Dec 14, 2005 6:10 pm
by kduke
I think I have. Search for it.