User Variable Getting refreshed in Seq 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
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

User Variable Getting refreshed in Seq restart

Post by Maximus_Jack »

Hi

Please assume below is the structure of my sequencer

Code: Select all

JobActivity_1--->UserVariable_1---->JobActivity_2---->UserVariable_2--->JobActivity_3----->JobActivity_4
Checkpoint is enabled in the sequencer

I'm assigning DSMacro "pCurrenttime=DsJobStarttime" and defining some other variables in UserVariable_1 and using it in Job Activity_3, When the sequencer aborts for reason at JobActivity_3, The variable pCurrenttime is also getting refreshed, instead of starting at JobActivity_3 with the old "pCurrenttime" value. How can i avoid this?

Thanks
MJ
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

That was an interesting question. If you go into the "Job Control" of your job sequence you will see the actual BASIC program that is generated. It is (intentionally, I believe) quite difficult to read but you can see that when running in checkpointed mode it still goes through each stage but has code that skips execution on restart. But the User-Variable stages are executed regardless of state - the previous run's values for these variables are not stored so need to be recomputed each re-run.

Thus there's no solution to your problem using the built-in checkpointing mechanism, unfortunately.
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

Post by Maximus_Jack »

I had a look at the job control basic code, I'm seeing all the variables are getting assigned first, but I don't understand why the user variables are getting refreshed when i enabled the checkpoint?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

They are getting refreshed because their state/values from the previous run aren't being stored in checkpoint information.
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

Post by Maximus_Jack »

why is it like this, Is there any way to avoid it?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No, there is no way to avoid it; it is coded that way and won't be changed (because "fixing" this would change existing job behaviour).

You will need to think of another way of doing this. Using a BASIC routine is an option, since you can query the status at runtime to determine whether you are doing a checkpointed run and depending upon that either use the current time (and save it) or restore a saved time.
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

As mentioned above there is no fix for this issue. For similar situation, we have implemented a work around, by parking values of variables (in this example from UserVariable_1) in a parameter set value file and utilizing it in subsequent stages. Also see this blog.
Post Reply