Multi instance job logs

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

dhiraj
Participant
Posts: 68
Joined: Sat Dec 06, 2003 7:03 am

Post by dhiraj »

Hello,
I have the same requirement and is clearing of the status file a safe option to do. Is there some thing that i should be aware of. Also should we clear the status file? can i not delete it?

Chris,
How much did the enhancement from ascential cost you? just curious?

Thanks
Dhiraj
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

Enhancement requests to Ascential do not cost anything! But maybe I'm wrong and that's why my enhancement requests never get included :wink:

C.
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

This is a batch job. Not a routine. You will need to disconnect Director from the project to refresh the list of jobs. I in NO way recommend doing this.

USE AT YOUR OWN RISK:

Code: Select all

* ------------------------------------------------------------ 
* EtlClearInstanceIDs 
* Decription: 
* This will clear instance IDs. 
* USE AT YOUR OWN RISK 
* ------------------------------------------------------------ 
* Parameters: 
*  1. JobName 
* ------------------------------------------------------------ 
* Created       : 2005-10-05 Kim Greggory Duke 
* Last Modified : 
* ------------------------------------------------------------ 
* $INCLUDE DSINCLUDE JOBCONTROL.H 
* ------------------------------------------------------------ 
      Ans = "" 
      open 'DS_JOBS' to DsJobs else 
         ErrMsg = "Error: Unable to open DS_JOBS" 
         gosub ErrRtn 
         goto TheEnd 
      end 
      read JobRec from DsJobs, JobName then 
         JobNo = JobRec<5> 
      end else 
         ErrMsg = "Error: Unable to open DS_JOBS" 
         gosub ErrRtn 
         goto TheEnd 
      end 
      RtLogFile = 'RT_LOG': JobNo 
      open RtLogFile to RtLog else 
         ErrMsg = "Error: Unable to open ": RtLogFile 
         gosub ErrRtn 
         goto TheEnd 
      end 
* ---------------------------------------------------------------------- 
* initialize variables 
* ---------------------------------------------------------------------- 
      ThisJobName = 'EtlClearInstanceIDs' 
      ThisDay = convert('-','',oconv(@DATE, "D4-YMD[4,2,2]")) 
      ThisTime = convert('-','',oconv(@TIME, "MTHS")) 
* ------------------------------------------------------------ 
      Cmd  = '' 
      Cmd := 'Delete from ' 
      Cmd := '   RT_STATUS': JobNo :' ' 
      Cmd := 'where '
      Cmd := '   EVAL "@RECORD<1>" = ':"'INVOCATION'" 
      Cmd := ';' 
      Call DSLogInfo("Execute: " : Cmd, ThisJobName) 
      execute Cmd capturing output returning RtnCode 
      Call DSLogInfo("Command Results: " : output, JobName) 
* ------------------------------------------------------------ 
      Cmd  = '' 
      Cmd := 'Delete from ' 
      Cmd := '   RT_STATUS': JobNo :' ' 
      Cmd := 'where '
      Cmd := '   EVAL "@RECORD<1>" = ':"'JOB'" 
      Cmd := ';' 
      Call DSLogInfo("Execute: " : Cmd, ThisJobName) 
      execute Cmd capturing output returning RtnCode 
      Call DSLogInfo("Command Results: " : output, JobName) 
* ------------------------------------------------------------ 
      Cmd  = '' 
      Cmd := 'Delete from ' 
      Cmd := '   RT_STATUS': JobNo :' ' 
      Cmd := 'where '
      Cmd := '   EVAL "@RECORD<1>" = ':"'STAGE'" 
      Cmd := ';' 
      Call DSLogInfo("Execute: " : Cmd, ThisJobName) 
      execute Cmd capturing output returning RtnCode 
      Call DSLogInfo("Command Results: " : output, JobName) 
* ------------------------------------------------------------ 
      goto TheEnd 
* ------------------------------------------------------------ 
ErrRtn: 
      Call DSLogInfo(ErrMsg , "JobControl") 
      * Call DSLogFatal(ErrMsg, "JobControl") 
      * abort 
      return 
* ------------------------------------------------------------ 
TheEnd: 
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I fixed this code. It does work but still I do not recommend it. I would change it to delete only old records if I was going to use this.
Mamu Kim
Post Reply