Detect restart

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
boxtoby
Premium Member
Premium Member
Posts: 138
Joined: Mon Mar 13, 2006 5:11 pm
Location: UK

Detect restart

Post by boxtoby »

Hi,

Does anyone know how to detect if a sequence has been restarted?

I would like to redirect the processing in such an event.

Many thanks,
Bob.
Bob Oxtoby
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I for one would like a little more detail before diving into this. Can you clarify what you mean by "restarted"? I'm guessing you mean one with checkpointing that has aborted and then is restarted from the point of failure but would like that confirmed.

I'd also be curious what "redirect the processing" would mean, something you have no control over if you are using checkpoints.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The log will tell you.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... after the fact. I think this is a "during the fact" question.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, you can detect whether a given run of a checkpointed sequence is happening after a restart. There are 2 DS routines which can be called to set and retrieve checkpoint information, I've used them in the past; unfortunately I'm now away from a DS installation where I can check what they are called. If you create a small sequence with just one stage and make it restartable and look at the generated source code (in the Designer job control) you can easily find the call that checks for existence of a checkpoint and build that into your sequence manually.
boxtoby
Premium Member
Premium Member
Posts: 138
Joined: Mon Mar 13, 2006 5:11 pm
Location: UK

Post by boxtoby »

Hi,

Thanks for the suggestion of looking in the Sequence code in the job header. I found the routine "DSCheckPointExists" and created the routine below.

However, the routine when called from the sequence always returns "START" whether running from normal or restart. As far as I can tell the function is always returning zero.

Can you see what I am doing wrong?

Code: Select all

$include DSINCLUDE DSJ_XFUNCS.H

      If DSCheckPointExists(DSJ.ME, cp$dtm) Then
         Ans = "RESTART"
      End
      Else
         Ans = "START"
      End
Many thanks,
Bob.
Bob Oxtoby
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You would need to supply a value for cp$dtm otherwise it will always take the false path. It is looking for the existence of a specific "checkpoint datetime" to validate.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply