Author |
Message |
nibumathewbabu

Group memberships: Premium Members
Joined: 05 Jul 2012
Posts: 22
Location: Chennai
Points: 211
|
|
DataStage® Release: 11x |
Job Type: Parallel |
OS: Unix |
|
Hi All,
This is my requriement
I need to compare file source count with target table count and write the both counts in to an audit table with status Success(If count are equal) or Fail on the other case and I also need to fail the job if count mismatch is there.
The issue I face is,If we try to achieve above with a lookup stage and fail the job if count mismatches, the counts wont be written in target table as the job is aborting.
Kindly suggest a way out
|
_________________ Thanks
Nibu Mathew Babu |
|
|
 |
chulett
 since January 2006
Group memberships: Premium Members, Inner Circle, Server to Parallel Transition Group
Joined: 12 Nov 2002
Posts: 42878
Location: Denver, CO
Points: 221062
|
|
|
|
|
|
Can you not perform the check, write the results to the audit table and only
then
abort the job if required?
And there was no reason to post this twice, I removed the duplicate post.
|
_________________ -craig
The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
|
|
|
 |
PaulVL

Group memberships: Premium Members
Joined: 17 Dec 2010
Posts: 1266
Points: 8317
|
|
|
|
|
|
External source stage with a filter: wc -l /path/filename.txt output to column source_count
Connector stage SQL statement: select count(*) from table output to column table_count
now just use a transformer on that stuff and redirect output to success or failure if condition branch.
|
|
|
|
 |
nibumathewbabu

Group memberships: Premium Members
Joined: 05 Jul 2012
Posts: 22
Location: Chennai
Points: 211
|
|
|
|
|
|
Thank you for the response.But I need to write the table count to audit table and if count mismatches i need to fail the job also that is the req
|
_________________ Thanks
Nibu Mathew Babu |
|
|
 |
chulett
 since January 2006
Group memberships: Premium Members, Inner Circle, Server to Parallel Transition Group
Joined: 12 Nov 2002
Posts: 42878
Location: Denver, CO
Points: 221062
|
|
|
|
|
|
Okay then, how about chiming in on my response?
|
_________________ -craig
The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
|
|
|
 |
nibumathewbabu

Group memberships: Premium Members
Joined: 05 Jul 2012
Posts: 22
Location: Chennai
Points: 211
|
|
|
|
|
|
Thank you for the response. I am fine with first part you suggested.
"and only then abort the job if required"
Could you please specify how to implement above step?
|
_________________ Thanks
Nibu Mathew Babu |
|
|
 |
chulett
 since January 2006
Group memberships: Premium Members, Inner Circle, Server to Parallel Transition Group
Joined: 12 Nov 2002
Posts: 42878
Location: Denver, CO
Points: 221062
|
|
|
|
|
|
Well, here's what I was thinking.
First step would be to record the results in your audit table, so make sure when that happens that your transaction size is set to 1 for the record is not only ...
|
_________________ -craig
The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
|
|
|
 |
nibumathewbabu

Group memberships: Premium Members
Joined: 05 Jul 2012
Posts: 22
Location: Chennai
Points: 211
|
|
|
|
|
|
Thanks Craig.
As you suggested I have two links from transformer
Link1: Constraint source count=target count then to target table with update audit table with target count and status in table is success
Target DB stage Read committed,Record Count and Array size=1
Link 2
Constraint source count <> target count then to target table with update audit table with target count and abort after 1 row and status in table is failed
Target DB stage Read committed,Record Count and Array size=1
Please guide whether the above idea is what you had meant
|
_________________ Thanks
Nibu Mathew Babu |
|
|
 |
chulett
 since January 2006
Group memberships: Premium Members, Inner Circle, Server to Parallel Transition Group
Joined: 12 Nov 2002
Posts: 42878
Location: Denver, CO
Points: 221062
|
|
|
|
|
|
Not quite.
The suggestion was to use the first link to update the audit table
regardless
of success or failure. Meaning
always
do it, record the result and
commit
the transaction, ma ...
|
_________________ -craig
The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
|
|
|
 |
nibumathewbabu

Group memberships: Premium Members
Joined: 05 Jul 2012
Posts: 22
Location: Chennai
Points: 211
|
|
|
|
|
|
Thanks, I will try and let you know
|
_________________ Thanks
Nibu Mathew Babu |
|
|
 |
|