In our application job is coded presently such that a control job clears RT_LOG file for a job J1 and then runs the job J1 . After J1 is run successfully the control job copies the log in RT_LOG_nnnn file of job J1 to a xxx.log file for monitoring/archive purpose.
Due to new requirements we are needed to make job J1 as a multi-instance job. But we still want to follow the process of clearing and copying log for each separate instance , before and after the successful run of each instance of job J1 respectively.
Problem is I am not able to identify separate RT_LOG file for the instances (say J1.026 and J1.027) of the job J1 as the Job number available in DS_JOBS is only for J1 and not for its instances. Your comments please !!
Also ,can someone throw light on the following issues:
1.0] If I want to clear the log for J1.026 when J1.027 is running , how it can be done.
2.0] Also If I want to copy the log of instance J1.026 and J1.027 separately, how it can be done ?
Thanks
Mukund
Getting log info for multi-instance job
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 103
- Joined: Tue Oct 14, 2003 4:07 am
-
- Premium Member
- Posts: 103
- Joined: Tue Oct 14, 2003 4:07 am
-
- Premium Member
- Posts: 103
- Joined: Tue Oct 14, 2003 4:07 am
Please see below the code that gets RT log and copies it to a unix log file
I want to know how do I change the read loop so as to pick up instance Id was log details of a job:
********************************************************************************
* open DS log file
********************************************************************************
L.DSLogFile = "RT_LOG":L.JobNo
Open L.DSLogFile To F.DSLogFile Else
L.Msg = "Could not open DS log file ":Quote(L.DSLogFile)
L.Dummy = srLogMsg("F",L.Msg)
End
********************************************************************************
* dump DS log file to archive file
********************************************************************************
L.Cmd = "SELECT ":L.DSLogFile:" WITH TIMESTAMP > 0 BY TIMESTAMP"
Execute L.Cmd Capturing L.Output Returning L.RC
L.NewLine = Char(10)
Loop
ReadNext L.ID Else Exit
Read L.Record From F.DSLogFile, L.ID Then
L.Temp = DSRMessage(L.ID, L.Record<10>, Raise(L.Record<5>))
If L.Temp Matches "LinkReport(0X)" Then
; * do nothing - skip these horrid records
End Else
L.Msg = L.Record<3>:','
L.Msg := Field("Info,Warning,Fatal,Reject,Started,Reset,Error,Debug",",",L.Record<1>):L.NewLine:L.NewLine
L.Msg := Convert(@AM:@VM, L.NewLine:L.NewLine, L.Temp):L.NewLine
L.Msg := "============================================================"
WriteSeq L.Msg To F.LogFile Else
L.Msg = "Could not write to log file ":Quote(I.LogFile)
L.Dummy = srLogMsg("F",L.Msg)
End
End
End
Repeat
I want to know how do I change the read loop so as to pick up instance Id was log details of a job:
********************************************************************************
* open DS log file
********************************************************************************
L.DSLogFile = "RT_LOG":L.JobNo
Open L.DSLogFile To F.DSLogFile Else
L.Msg = "Could not open DS log file ":Quote(L.DSLogFile)
L.Dummy = srLogMsg("F",L.Msg)
End
********************************************************************************
* dump DS log file to archive file
********************************************************************************
L.Cmd = "SELECT ":L.DSLogFile:" WITH TIMESTAMP > 0 BY TIMESTAMP"
Execute L.Cmd Capturing L.Output Returning L.RC
L.NewLine = Char(10)
Loop
ReadNext L.ID Else Exit
Read L.Record From F.DSLogFile, L.ID Then
L.Temp = DSRMessage(L.ID, L.Record<10>, Raise(L.Record<5>))
If L.Temp Matches "LinkReport(0X)" Then
; * do nothing - skip these horrid records
End Else
L.Msg = L.Record<3>:','
L.Msg := Field("Info,Warning,Fatal,Reject,Started,Reset,Error,Debug",",",L.Record<1>):L.NewLine:L.NewLine
L.Msg := Convert(@AM:@VM, L.NewLine:L.NewLine, L.Temp):L.NewLine
L.Msg := "============================================================"
WriteSeq L.Msg To F.LogFile Else
L.Msg = "Could not write to log file ":Quote(I.LogFile)
L.Dummy = srLogMsg("F",L.Msg)
End
End
End
Repeat
Please do Alt-C around your code to save formating. You will need to add the EVAL to your WITH clause.
Here is the SQL:
Here is the SQL:
Code: Select all
select
@ID,
TIMESTAMP,
SEVERITY,
EVAL "@RECORD<7>" AS INSTANCE_NAME,
FULL.TEXT
from
RT_LOG657
where
EVAL "@ID" NOT LIKE '//%'
AND INSTANCE_NAME = 'Load1TelecastDimStg'
order by
TIMESTAMP
;
Mamu Kim