DSSetUserStatus - Does the Ans has to be zero

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
Galt
Premium Member
Premium Member
Posts: 14
Joined: Tue Jan 09, 2007 3:54 pm

DSSetUserStatus - Does the Ans has to be zero

Post by Galt »

Folks,
I have the following server routine to pass a value from seq1 to seq2.

The value I pass is a string "non_zero_row_count" or "zero_row_count".

Call DSSetUserStatus(Arg1)
CALL DSLogInfo('User Status set to : ' : Arg1,'SetUserStatus')
Ans=0

It only works if Ans=0.
If I set Ans=Arg1 it gives the following error.

Seq_Row_Count.si_001_Company.JobControl (@user_status_non_zero_count): Routine DSU.SetUserStatus did not finish OK, return code = 'non_zero_row_count'
Seq_Row_Count.si_001_Company.JobControl (@user_status_non_zero_count): Controller problem: Unhandled failure (non_zero_row_count) encountered calling routine DSU.SetUserStatus


What is it that I am doing wrong.
All the posts regarding DSSetUserStatus does Ans=Arg1

Regards,
Galt
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you do an exact search for "Controller problem: Unhandled failure" all will be revealed.

You'll also note that all the posts regarding this are examples of how to use it in the Transformer of a Server job, not the Routine Activity stage of a Sequence job. What exactly are you trying to accomplish here? All you would normally need to "pass a value from seq1 to seq2" is a Job Parameter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Galt
Premium Member
Premium Member
Posts: 14
Joined: Tue Jan 09, 2007 3:54 pm

Post by Galt »

Hi,
I have a common generic Sequencer, which reads a table and if the row count is zero/non-zero passes a string "zero_row_count" or "non_zero_row_count" to the called sequencer.

Only a table_name needs to be passed to this Sequencer.

The layout of this Seq. is as follow.

1. Job(read Table row-count and place the count in a file)
2. cat the file
3. In "Nested Condition" check the row-count
4. Call the appropriate Routine_Activity SetUserStatus - which sets the
userstatus to either "zero_row_count" or "non_zero_row_count"


The caller (seq) then loads the target table only if the source table has rows in it.

Are you suggesting that if the SetUserStatus is invoked in a Routine_Activity it takes the Ans as the return-code and hence it should
always be zero.

Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Short answer? Yes. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Why dont you cat the file, check for the row count and set the user status in the job? Why do you want to set the user status in the routine?
Arun
Post Reply