Hi All,
I have the below requirement to be done in datastage PX.
1) If source file is empty, the job and main sequence to be aborted
2) If a non-nullable source column receives Null values in the source file,
then we need to stop the loading and abort the job
Can anyone please suggest me on how to proceed on this.
Aborting Job after validation
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I disagree with the design. I design job sequences that never abort. On that basis, my design would be to run one job to count the rows, check the count, and decide whether or not - on that basis - to proceed with the next job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Aborting Job after validation
Hi,adityavarma wrote:Hi All,
I have the below requirement to be done in datastage PX.
1) If source file is empty, the job and main sequence to be aborted
2) If a non-nullable source column receives Null values in the source file,
then we need to stop the loading and abort the job
Can anyone please suggest me on how to proceed on this.
its tricky but possible, in the DS job where you are reading file: In sequential file stage, Set following ::
1. Reject Mode as :: Fail
2. Add Filter in Options and write "grep ^"
In Sequencer's Properties check the check button saying "Automatic Handle Activity that fails"
Please Note :: The job will only abort where non nullable column does not have datatype as VarChar, because for Varchar column DS reads value as "" instead of NULL.
Regards,
Sunny Sharma.
Sunny Sharma.
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada
In that case, you have to do NULL handling in Transformer... check if source column is "" in stage variable and assign some value, and in take a Dummy Link Out from Transformer with Constraint on stage variable = "NULL" and in transformer, Abort After Rows as 1adityavarma wrote:to my luck , all the source coulmns are varchar fileds
e.g. take stage variable svCheckNULL as varchar 10
If Source_Column='' then 'NULL' else 'NotNull'
Constraint in transformer as svCheckNULL='NULL' with abort after 1 row
Regards,
Sunny Sharma.
Sunny Sharma.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 104
- Joined: Thu Jul 12, 2007 11:32 pm
- Location: Canada