I have a situation where I need to log Job information in the file. There are DS routines that I can use ? And is it anyways I can run them afterstage or afterjob ? I want the timestamp, row count, job name..all these write into flat file in same job.
And if someone can tell me in steps as to how to run this in afterjob or afterstage ?
Job Info
Moderators: chulett, rschirm, roy
You can write a routine to be called in the after-job routine or in a controlling job. The appropriate API's (DS*) are in your DS BASIC manual. The steps are to attach to a job, get its stage list, loop thru the stage list getting the link list and for each link the row count. You'll have to learn about opening a sequential file (OPENSEQ), writing data to a sequential file (WRITESEQ) and close it when finished (WEOFSEQ, CLOSESEQ). Have fun!
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Question your need. This information is already captured into the job's own log (which happens to be a table in the Repository). You can print, or print to file, from the Director client on those odd occasions you genuinely need to capture these data into a file.
Yes, you can do it all in code, but why re-invent the wheel?
Yes, you can do it all in code, but why re-invent the wheel?
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Yes, you can have a great deal of free time by requiring their specifications to be documented. For example:
Functions you need include DSGetJobInfo (for job name and job start time stamp) and DSGetLinkInfo (for row counts). In intermediate steps you will probably also need DSGetStageInfo (to get a list of the link names attached to an active stage).
As Ken suggested, the statements needed for manipulating the output file are OpenSeq, WriteSeq and CloseSeq (and possibly WeofSeq if you're going to truncate or Seek if you're going to append).
All of these functions and statements are in on-line help from Designer.
- Which row count? Row counts are different on different links (for example they are ideally zero on reject-handling links).
What is their business rule for "timestamp"? That is, which particular timestamp do they want? Job start, job finish, active stage start/finish, and so on.
What naming convention is required for the output file? Should it be overwritten or appended to. How is it to be further processed? (If you don't get an answer on this, don't do the time-wasting work.)
What is their business rule for capturing the invocation ID should you, the developer, elect for performance reasons to create multiple-instance jobs and run them in parallel? What are the implications then for the output file name?
Functions you need include DSGetJobInfo (for job name and job start time stamp) and DSGetLinkInfo (for row counts). In intermediate steps you will probably also need DSGetStageInfo (to get a list of the link names attached to an active stage).
As Ken suggested, the statements needed for manipulating the output file are OpenSeq, WriteSeq and CloseSeq (and possibly WeofSeq if you're going to truncate or Seek if you're going to append).
All of these functions and statements are in on-line help from Designer.
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.
There is a job on ADN you can download called DSJobReport.dsx. I modifed this to dump straight to 3 Oracle tables. One for job stats, one for row stats and one for parameter stats. I should post it back this week with my changes.
You need to job stats because not all jobs have row counts like sequences. The next you need history to show rows per second over time. Is this job getting slower. The last thing is parameter history because if a job fails it may be because the parameter had the wrong value.
You need to job stats because not all jobs have row counts like sequences. The next you need history to show rows per second over time. Is this job getting slower. The last thing is parameter history because if a job fails it may be because the parameter had the wrong value.
Mamu Kim
Hi All,
I have recently prepered a DSJob to get log that takes input as file name. this Input file contains list of job names for those log is required. After running this job. It creates a text file containinng jobname, stagename, no. of rows (in as well as out) and time elapsed. If you wish I wont mind to share it.
It would be great if kim, ray and other DS Guru review the code and fine tune that. I will try to upload this code in next few days.
Regards
Girish Oak
I have recently prepered a DSJob to get log that takes input as file name. this Input file contains list of job names for those log is required. After running this job. It creates a text file containinng jobname, stagename, no. of rows (in as well as out) and time elapsed. If you wish I wont mind to share it.
It would be great if kim, ray and other DS Guru review the code and fine tune that. I will try to upload this code in next few days.
Regards
Girish Oak