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
If count exceeds Job should Abort
Moderators: chulett, rschirm, roy
If count exceeds Job should Abort
kartheek
-
- Participant
- Posts: 38
- Joined: Wed Jul 18, 2007 12:23 am
- Location: Chennai
Re: If count exceeds Job should Abort
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
-
- Charter Member
- Posts: 166
- Joined: Wed Mar 16, 2005 6:52 am
- Location: Mumbai, India
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.
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.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>