How to obtain the starttimestamp of the parent-sequencer

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

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You should be able to adapt the following code to your requirements. It reports the name of the job itself if it has no controller.

Code: Select all

FUNCTION UltimateController(JobName)
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF

      Controller = ""
      TempJobName = JobName
      PrevController = JobName
      Loop
         hJob = DSAttachJob(TempJobName, DSJ.ERRNONE)
         Controller = DSGetJobInfo(hJob, DSJ.JOBCONTROLLER)
      While Len(Controller) > 0
         If Controller Matches "'-'1N0N"
         Then
            Ans = @NULL
            Call DSTransformError("Failed to attach job " : Quote(TempJobName),"UltimateParent")
            Exit
         End
         Else
            Call DSLogInfo(Quote(Controller), "UltimateParent")
            PrevController = Controller
            ErrCode = DSDetachJob(hJob)
            TempJobName = Controller
         End
      Repeat

      Ans = PrevController

RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply