INROWNUM doesn't work if no incoming records

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
getsatish_gk
Participant
Posts: 104
Joined: Sat Dec 24, 2005 1:26 am
Location: Bengaluru

INROWNUM doesn't work if no incoming records

Post by getsatish_gk »

Hi all,

I have a reject link after loading data into DB2 table using DB2 connect stage.
the requirement is to check if there any rejects. i.e, if no records reject then hardcord as "Success" Else "Failed"

using @INROWNUM in the transformer stage
If @INROWNUM=0 then "Success" Else "Failed"

source--->DB2 connector stage --> peek (to collect rejects)-->Transforme-->dataset (or peek stage)

It work only if there is some rejects, but not when no rejects.

any suggestions? --to have other function? i am thinking of adding col generator stage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No rows is no rows, there's no such thing as a row number zero. And it should successfully process zero records, why would you need to "hard code" it?
-craig

"You can never have too many knives" -- Logan Nine Fingers
getsatish_gk
Participant
Posts: 104
Joined: Sat Dec 24, 2005 1:26 am
Location: Bengaluru

Post by getsatish_gk »

Because, it needs to pass next stage as "Success" if no rows coming in.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What "next stage"? You can't detect zero records in the same job that is processing them but you can "after job". I've seen people union a dummy record to their source so they always get it regardless and then either filter it out or trigger something if that's the only record. I suppose you could do that. Or a row generator.
-craig

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