Page 1 of 1

Posted: Fri Aug 25, 2006 4:18 pm
by kduke
You should put code tags around your job listing so we can see the formatted code. This job gets the job status. It does nothing with the job log.

Why do you need this? What are you going to do with the sequential file?

Posted: Fri Aug 25, 2006 5:20 pm
by DSguru2B
Need more info. What exactly do you want. Do you need the log files of all the jobs in a particular project, or you need particular info from log files for all the jobs? Plus you sure you want to collect the log files of all the jobs in a single sequential file. That file is going to be huge if you have 100 plus jobs.

Posted: Fri Aug 25, 2006 11:20 pm
by ray.wurlod
You need to test explicitly for failure to attach jobs (clearly a job that has not been compiled will not have any run status) and bypass them. Any error in DSAttachJob returns an error code which is an integer less than zero.

Code: Select all

hJob = DSAttachJob(JobName, DSJ.ERRNONE)
JobName = DSGetJobInfo(hJob, DSJ.JOBNAME)
If JobName Matches "'-'1N0N"
Then
   * Failed to attach job
End
Else
   * Job attached OK
   * Process desired job information
   * Don't forget to detach job
   ErrCode = DSDetachJob(hJob)
End
Don't use PRINT statements - you'll never find the output. You need to use WriteSeq to write lines to a file.

Posted: Mon Aug 28, 2006 10:06 am
by wahil
I need list the log files of all the jobs in a particular project to a sequential file. This routine get job status and logs information too. This will be used to generate statistics about performance of jobs.

Posted: Mon Aug 28, 2006 12:56 pm
by kduke
Just download EtlStats from the links below my signature. That is what it is designed to do. It updates several tables. Just change it to update a sequential file. You need to modify the job GenHtmlJobLog to get the log file records. The job DSJobReportDbDriver runs the job DSJobReportDb which is the one you need to modify. DSJobReportDbDriver can be run for "all" jobs. Modify a couple jobs and you are done.

Posted: Wed Sep 06, 2006 12:15 pm
by wahil
Hi Kim,

I download EtlStats and its very good but in my company the environment is much "closed". We don't can use send mail, generate html routines, by example.
By this, i did create other jobs and use some routines yours.

The problem now is, who list jobs of other project in job control...

Any idea???

Posted: Wed Sep 06, 2006 4:18 pm
by kduke
EtlStats will not work across projects. So you need to install it in the other project.

dsjob can list all jobs in any project.

Posted: Mon Sep 11, 2006 12:43 pm
by wahil
[quote]EtlStats will not work across projects. So you need to install it in the other project.

dsjob can list all jobs in any project. [/quote]

Kim, ok to dsjobs. I'm tried to change function "GetLastRunLog" routine to work across projects, but the problem is in DSAttachJob function. This fine only to project logged...

The isJobMultipleInstance and GetJobCategory routines i am change and its run fine. I am add + one parameter(ProjName) and put the commands below in the top of the program.

[code]
Cmd = ''
Cmd := 'LOGTO ':aProjName
execute Cmd capturing output returning RtnCode
[/code]

Posted: Mon Sep 11, 2006 1:42 pm
by kduke
Did that work?

Posted: Mon Sep 11, 2006 4:08 pm
by ray.wurlod
LOGTO within programs is fraught with danger. For example, once you arrive in the new account (this works OK), which VOC file do you have open - that of the new account or that of the account from which you departed?

Posted: Tue Sep 12, 2006 8:10 am
by wahil
Ok Ray.

I will create all jobs and routines in all the projects(+/- 20) :cry: .

Don't be very beautiful, but...

Ray and Kim, thanks a lot.

Posted: Tue Sep 12, 2006 12:34 pm
by kduke
You should pull out the jobs you do not need and just use the ones you do need. There are lots of jobs that are just to show you how to create metadata from system tables or from the DataStage repository. EtlStats has several jobs which are not used to get row counts. The same is true for the routines.