Abort the job based on the condition
Moderators: chulett, rschirm, roy
Abort the job based on the condition
Hi All,
One of my source file column name is Item where records are like below
100
200
300
100
100
If any records come other than 100 in Item column, I need to abort the job.
Any help is really apprecidated.
One of my source file column name is Item where records are like below
100
200
300
100
100
If any records come other than 100 in Item column, I need to abort the job.
Any help is really apprecidated.
prabakaran.v
You could also use a lookup for Item-Value 100 and set the condition for Lookup-Failure to "Fail" (Default).
The job will abort when a row comes along with a different value for column Item. If so needed, You can also provide additional lookup-values later without necessarily having to change your job (use a file or DB-table as input).
The job will abort when a row comes along with a different value for column Item. If so needed, You can also provide additional lookup-values later without necessarily having to change your job (use a file or DB-table as input).
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon
Thanks for your reply chulett. right now I am not infront of datastage. But I am going to write a derivation like I mentioned below.
StgVar:
If Inlink.Item<>"100" Then 'Y' Else 'N'
Constraint:
StageVar='Y' Abort After rows=1
Hope this logic will abort my job.
Please let me know, If do anything wrong in the derivation
.
StgVar:
If Inlink.Item<>"100" Then 'Y' Else 'N'
Constraint:
StageVar='Y' Abort After rows=1
Hope this logic will abort my job.
Please let me know, If do anything wrong in the derivation
![Confused :?](./images/smilies/icon_confused.gif)
prabakaran.v
I personally don't do the Y/N thing, preferring to treat the stage variable as a Boolean since the expression will automatically resolve to true or false. I'd also suggest you always use meaningful names for your stage variables.
Of course, the bad row output link could just be marked as a 'Reject' link and not need a derivation.
Code: Select all
Stage Variable
svItemIs100: Inlink.Item = 100
Constraint
Good row: svItemIs100
Bad row: Not(svItemIs100)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 26
- Joined: Fri Feb 19, 2010 2:08 am
This will workpraburaj wrote:Thanks for your reply chulett. right now I am not infront of datastage. But I am going to write a derivation like I mentioned below.
StgVar:
If Inlink.Item<>"100" Then 'Y' Else 'N'
Constraint:
StageVar='Y' Abort After rows=1
Hope this logic will abort my job.
Please let me know, If do anything wrong in the derivation.
_____________________________________
-Kish
-Kish