Page 1 of 1

If count exceeds Job should Abort

Posted: Mon Oct 08, 2007 1:35 am
by karthegx
Hi,

I have scenario in that a lookup stage is used for that I need to use two links one reject and other is stream link.

If the count in the reject link exceeds 100 records the Job should abort

Can anyone help me to do this


Thanks in Advance

Posted: Mon Oct 08, 2007 3:01 am
by prasad_chennai
mention abort after Rows=100 in the transformer At reject link.

Re: If count exceeds Job should Abort

Posted: Mon Oct 08, 2007 3:43 am
by sachin1
you use a stage variable where you declared initial value for it as 100 and use dslinkrowcount, which increments for each row processed. you then compare values and use SDK utitlity --->UtilityAbortToLog

Posted: Mon Oct 08, 2007 4:42 am
by ameyvaidya
The question is for the Lookup Stage and the Jobtype correctly mentions Parallel; However this query has been posted in the Server forum.

The lookup stage can be configured to push lookup failures down a reject link.

Option 1:

If the 100 rows is constant
A transformer( running in sequential mode) connected to the reject link that has the "abort after x rows" set to 100 in the constraints page with the output linked to a peek stage(Set the options so that only a few rows are written to the job log) will do the trick.


Option 2:

If the 100 rows is not constant and needs to be passed as a job parameter.

at the reject link of the lookup stage, connect a transformer (running in sequential mode, 2 outputs: RCP off).

the 2 output links should both be linked to a compare stage(also in sequential mode; abort on difference =true) the single output(RCP On if you do not want to figure out the output columns needed from the compare stage) of the compare stage to a peek stage.

The 2 links output from the transformer should have the following 2 columns(1 each)

OutLink1.Col1=@INROWNUM

OutLink2.Col1=If @INROWNUM<=<ErrRowLimitJobParameter> then @INROWNUM else <ErrRowLimitJobParameter>


Option 3: there is an undocumented ABORT operator that takes a number of rows as a parameter and aborts a PX job when the row limit is reached( To fins this , check the generated OSH for the View Data Command)

One can wrap a stage around this operator and get this to accept the Row Limit as a parameter.


Hope this helps.