regarding uservariable activity

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

vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

regarding uservariable activity

Post by vijaykumar »

Hi gurus,
i want to use variables in sequence.
so used USER VARIABLE ACTIVITY.Actually i want to declare a variable called status and assign it value .
if status =1 then job1 else job2.
user variable activity---->jobactivity1---->jobactivity2.
is my design correct, plz help me and how can i declare this variable.
plz help me.

cheers;
vijay
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You dont need to define this extra variable 'status'.
You can make use of the return value of the UserStatus in your condition
Example
if JOBA.$UserStatus = 1 then job1 else job2
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You can use Nested contition Activity next to User Variable Activity and branch both the Job Activity stage based on different condition.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In case you still want to use a User Variables activity, be aware that it has the wierdest grid control - it's completely blank when opened (no grid). You have to right-click and choose Add New Row. :roll:

That's how you declare a variable in a User Variables activity. Fill in the variable name and its derivation expression once you've created the new row for it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

Hi Gurus,
thanks very much.iam only using nested condition.
iam going by this design.
nested condition--->jobactivity1---->jobactivity2.
in the nested condition i have choosen expression type as CUSTOM-(CONDITIONAL)
i have declared expression as if job1.$userstatus=1 then job1 else job2.
while validating expression iam getting error as EXPECTED EXPRESSION.
plz help me in validating expression and is my design correct am i going in the right way.

cheers;
vijay
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Use these in your expressions in the Nested Condition Activity

Code: Select all

- job1.$userstatus=1 (for jobactivity1)
- Otherwise (for jobactivity2)
You should be good.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Oh, Your need to change your job design. Use this (Check the expression values from my previous post)

Code: Select all

NestedConditionActivity------>jobactivity1
                    |
                    |
                    |-------->jobactivity2
Instead of using

Code: Select all

nested condition--->jobactivity1---->jobactivity2
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

HI GURUS,
THANKS VERY MUCH.
actually when i used 'job1.$userstatus=1' i could validate the expression, but when i see the director log, its simply running the job2, it checking job2 initially, its saying since the result status is 1 finished executing job.

is that the expected result, actually it should also run job1 and should check the status i think, plz help me if iam wrong.

cheers;
saama
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Are you checking the log for the Sequence or for the Job2? Is the log for the Job2 shows its running?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

HI GURUS,
i have given sequence a name like job4.
this is what iam able to view from the log of this job.
JOB4 -> (job2): Job run requested
Mode (row/warn limits) = 0/0
Job Parameters --->
DSJobController=JOB4.
this is what iam getting. why is it not checking JOB1, its simply starting job2.

cheers;
vijay
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

vijaykumar wrote:actually when i used 'job1.$userstatus=1' i could validate the expression, but when i see the director log, its simply running the job2, it checking job2 initially, its saying since the result status is 1 finished executing job.
There must be something wrong with how you are setting your UserStatus in your job.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Narasimha, what makes you think that UserStatus is involved in any of this? :?

All Vijay ever said was:
i want to use variables in sequence. so used USER VARIABLE ACTIVITY.Actually i want to declare a variable called status and assign it value .
User Variables stage. A variable called status. Then you sidetracked everything with an assumption of 'User Status'. At least it seems like you got the links properly separated, now we just need to know how this 'status' variable is getting set so the last of this can get straightened out as well.

Vijay, you need to explain a little more clearer where the value of this status variable is getting set... and how you want to use it to control the execution of these two jobs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Oops... My bad....Sorry about that Vijay.
Thanks for correcting me Craig.

If I understood it right this time, your new design could be.

Code: Select all

UserVariablesActivity------->NestedConditionActivity------>jobactivity1
                                  |
                                  |
                                  |----------------------->jobactivity2


Conditions in your NestedConditionActivity would be

Code: Select all

Expression Type           Expression
------------------       -------------
Custom - (Conditional)    UserVariablesActivity.Status=1
Otherwise                 N/A
As Craig said, you need a way to set the value for 'status'.
How do you want to set a value for this variable?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I wouldn't be at all surprised if the OP requires $JobStatus.
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 »

I was wondering the exact same thing, if all we were talking about was a normal 'OK (Conditional)' trigger...
-craig

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