Regarding the residense of log files in datastage.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 9
- Joined: Mon Mar 03, 2008 1:30 am
- Location: India
Regarding the residense of log files in datastage.
Hi,
Any one know where the log entries of a job when it has been run in datastage will be stored?
If we could able to find where these entries resided then, we can send mails if those entries contains warnings.
If this works more clensing part can be skipped from the datastage jobs so that when ever a mail comes that warning is there in the job then we can go back and set that warning.This makes clensing job easy.
Thanks in advance...
Any one know where the log entries of a job when it has been run in datastage will be stored?
If we could able to find where these entries resided then, we can send mails if those entries contains warnings.
If this works more clensing part can be skipped from the datastage jobs so that when ever a mail comes that warning is there in the job then we can go back and set that warning.This makes clensing job easy.
Thanks in advance...
swathivineela
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 9
- Joined: Mon Mar 03, 2008 1:30 am
- Location: India
hi Rayray.wurlod wrote:Welcome aboard.
Yes, lots of us know. And a simple search of the forum would let you know also. ...
Thanks alot
I have searched regarding log files in the forums and i got a simple and straight forward answer for my question that
"The log records are in a database table within the Repository. The name of the table is RT_LOGnnnn, where nnnn is the job number associated with the job. You can search the forum or use LIST DICT ..."
And if my understanding is correct..
All we need to do is to get details(data) from the RT_LOG table and then insert into a flat file.
I dont have access to Administrator.
How would i get access to that RT_LOG table?
And in which schema this table exists?
Could you please help me out with this?
Thanks and Regards,
SwathiVineela
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
As per my understanding....you will not get any detail in RT_LOGxxx directory.Inorder to get the log information you have to use following functions:
1.DSFindFirstLogEntry :Retrieves entries in a log that meet the specified criteria.
2. DSFindNextLogEntry:Finds the next log entry that meets the criteria specified in DSFindFirstLogEntry.
3.DSGetLogEntry :Retrieves the specified log entry.
4.DSGetNewest LogId :Retrieves the newest entry in the log.
Datasatge uses Universe Database to store all the informations.You can search in this forum to get more details regarding the UV database.
1.DSFindFirstLogEntry :Retrieves entries in a log that meet the specified criteria.
2. DSFindNextLogEntry:Finds the next log entry that meets the criteria specified in DSFindFirstLogEntry.
3.DSGetLogEntry :Retrieves the specified log entry.
4.DSGetNewest LogId :Retrieves the newest entry in the log.
Datasatge uses Universe Database to store all the informations.You can search in this forum to get more details regarding the UV database.
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Oops! I thought that log files are the values stored in the one of the column of DS_JOBOBJECT table...sorry for that..chulett wrote:Equivalents of those same functions exist as part of 'dsjob' so you could do the same from the command line. And the 'log file' is a hashed file, not part of the 'UV database'. ...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A further search will reveal the column names in RT_LOGnnn tables. You can use a Hashed File stage or a UV stage to extract records from the log tables in a regular DataStage job and dump them to a text file by that means. There is also a Print option in the Project menu in Director that allows you to print to file - this may be easier to use.
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.
Question - you posted in PX but stated you are using Server jobs. Which is it? The answers are different in each product.
The RT_LOGnnnn hashed file IS a table. It does not reside in a schema on an SQL database as you assume, though. The DDL is not published officially, but as Ray has already pointed out in this thread, it can be found.
I seriously doubt that get the details on the DDL of this table will solve your problems. You should use the official API or the dsjob options instead of going straight to the table.
The RT_LOGnnnn hashed file IS a table. It does not reside in a schema on an SQL database as you assume, though. The DDL is not published officially, but as Ray has already pointed out in this thread, it can be found.
I seriously doubt that get the details on the DDL of this table will solve your problems. You should use the official API or the dsjob options instead of going straight to the table.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I disagree with Arnd. There is almost complete metadata for job logs in the file dictionary of RT_LOG. I have posted the same on DSXchange in the past. The problem is that you are blocked from importing it into the Repository (though you can work around even that).
Last edited by ray.wurlod on Wed Mar 12, 2008 5:21 pm, edited 1 time in total.
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: 9
- Joined: Mon Mar 03, 2008 1:30 am
- Location: India
Hi all,
I have tried using a routine to bring log entries and to write into a flat file.
Following is the routine:
**** Routine Name : GetJobLog ****
**** Usage : Give the directory as the Input Value ****
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrorCode = 0
Arg1=STAGE_DIR
DirName = STAGE_DIR
Suffix = ".txt"
JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
JobStarted = convert(" :-","_",DSGetJobInfo(DSJ.ME,DSJ.JOBSTARTTIMESTAMP))
FileName = JobName:"_":JobStarted:Suffix
StartTimeStamp = DSGetJobInfo (DSJ.ME, DSJ.JOBSTARTTIMESTAMP)
EndTimeStamp = DSGetJobInfo (DSJ.ME, DSJ.JOBLASTTIMESTAMP)
GetLogSum = DSGetLogSummary(DSJ.ME,DSJ.LOGANY,StartTimeStamp,EndTimeStamp,0)
OpenSeq FileName to FileVar then
write GetLogSum to FileVar,FileName else
call DSLogWarn("Failed to write file ":FileName:" to directory ":DirName, "GetJobLog")
end
end
else
call DSLogWarn("Failed to open directory ":DirName, "GetJobLog")
end
Ans=FileName
close FileVar
*************************************
but nothing was writen to the flat file .
could any one go through the code and tell what was the problem?
Please help me with this.
Thank you in advance...
Regards,
Swathi Vineela
I have tried using a routine to bring log entries and to write into a flat file.
Following is the routine:
**** Routine Name : GetJobLog ****
**** Usage : Give the directory as the Input Value ****
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrorCode = 0
Arg1=STAGE_DIR
DirName = STAGE_DIR
Suffix = ".txt"
JobName = DSGetJobInfo(DSJ.ME,DSJ.JOBNAME)
JobStarted = convert(" :-","_",DSGetJobInfo(DSJ.ME,DSJ.JOBSTARTTIMESTAMP))
FileName = JobName:"_":JobStarted:Suffix
StartTimeStamp = DSGetJobInfo (DSJ.ME, DSJ.JOBSTARTTIMESTAMP)
EndTimeStamp = DSGetJobInfo (DSJ.ME, DSJ.JOBLASTTIMESTAMP)
GetLogSum = DSGetLogSummary(DSJ.ME,DSJ.LOGANY,StartTimeStamp,EndTimeStamp,0)
OpenSeq FileName to FileVar then
write GetLogSum to FileVar,FileName else
call DSLogWarn("Failed to write file ":FileName:" to directory ":DirName, "GetJobLog")
end
end
else
call DSLogWarn("Failed to open directory ":DirName, "GetJobLog")
end
Ans=FileName
close FileVar
*************************************
but nothing was writen to the flat file .
could any one go through the code and tell what was the problem?
Please help me with this.
Thank you in advance...
Regards,
Swathi Vineela
Please surround your program with code tags to make it legible. You are calling this as an after-job subroutine from the job itself, so I doubt that the end timestamp contians a value. Put calls to "DSLogInfo()" in your program in order to debug which path it takes and why nothing appears in your output.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's no WriteSeq statement that would write anything to the flat file.
If opened with OpenSeq, the statement to write a line is WriteSeq, not Write.
If you want to use Write, open the parent directory with OpenPath, rather than opening the file itself with OpenSeq.
Also, if opened with OpenSeq, you need to close with CloseSeq, not Close. This releases a lock taken by OpenSeq.
If opened with OpenSeq, the statement to write a line is WriteSeq, not Write.
If you want to use Write, open the parent directory with OpenPath, rather than opening the file itself with OpenSeq.
Also, if opened with OpenSeq, you need to close with CloseSeq, not Close. This releases a lock taken by OpenSeq.
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: 9
- Joined: Mon Mar 03, 2008 1:30 am
- Location: India
Thank you very much for all,ray.wurlod wrote:There's no WriteSeq statement that would write anything to the flat file.
If opened with OpenSeq, the statement to write a line is WriteSeq, not Write.
If you want to use Write, open the parent di ...
with your support I was able to do that using a routine.
Thank you once again
swathivineela
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: