Nested Condition

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Nested Condition

Post by samsuf2002 »

In one of the sequencer I see we are using nested condition stage with condition $ServId1='' then execute echo command in execute command stage(to write into a log file that $ServId1 doesn't exist) otherwise run the following job.

My question is $ServId1 is an environment variable with a default value and for no reason it will be empty then what does the condition $ServId1=''implies.

Is there anyway we can overwrite the default value for the environment variable during the sequence run?

Any suggestions will be appreciated.

thanks
hi sam here
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, environment variables can be overridden or 'unset', so seems like someone felt it might be prudent to check. Perhaps it catches problems in new projects or first time environments?
-craig

"You can never have too many knives" -- Logan Nine Fingers
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

Thanks for the reply Craig.

But the issue is I coudn't find where exactly its getting overridden and it is also set as $PROJDEF in job properties. Is there any function or option to unset the value for the env variable ?
hi sam here
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I wasn't saying that it *was* being overridden, just that the possibility exists that it *could* be or may not even been set and it looks like someone is trying to check for that possibility, even if it is remote.

For a Project variable, you can use $UNSET in the job (rather than $PROJDEF) to unset it in the job's runtime. Heck, you could even use it at the Project level if it was set on the server and you didn't want it set for any job by default.
-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 »

And it might be set to "" or even unset in the project's own environment (via the Administrator client perhaps).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

Thanks to both for your valuable suggestion.

Let me elaborate my sequence design.

I have 2 jobs to run simultaneously in the seq, each job updates the same table for different database instance ($ServId1 & $ServerId2).
Before running these jobs we have a nested condition stage to check whether server id exists or not (as mentioned in my post above).

Both Server ids have been set as an environment variable with $PROJDEF in job properties and has provided default value through administrator.
When I see the log for the previous run of the sequencer in production,I found it is showing one or the other Server Id doesn't exist. Means sometime its getting $ServId1 or $ServerId2 as empty ('').

:?
hi sam here
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... the fact that both environment variables have been setup in the Administrator for the project with "default values" should mean they are set to those values in every job's environment in that project unless overridden. Have you checked what's in the second log entry for the job, the one that lists all of the environment variables in effect at the time the job ran? Are they both listed there? Or do they match up with your Nested Condition check, truly not existing when the check fails? :?

Also, the "default values" in the Administrator for these variables, are they hard-coded values or something else?
-craig

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