Error in DSAttachJob to status other than "Finished&quo
Moderators: chulett, rschirm, roy
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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Don't use PRINT statements - you'll never find the output. You need to use WriteSeq to write lines to a file.
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
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.
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.
Mamu Kim
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???
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???
[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]
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]
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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?
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.
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.
Mamu Kim