how to implement Reject logic
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
how to implement Reject logic
SUK |ECS |EC goods imported into UK |0 |31/12/20|28/01/98|
SUK |OTS |Outside The Scope 0% |0 |31/12/20|04/02/98|
SUK |PRO |Irrecoverable VAT pro-forma |17500 |31/12/20|01/01/06|
SUK |RVC |Reverse Charge-Int'l Service |0 |31/12/20|01/04/91|
SUK |UKB |Tax 17.5% |17500 |31/12/09|01/12/08|
SUK |UKB |Tax 15.0% |15000 |31/12/20|01/01/10|
SUK |UKN |UK Non Recoverable 0% |0 |31/12/20|04/02/98|
SUK |UKR |Reduced rate VAT 5% |5000 |31/12/20|01/01/97|
Above is the sample file format.
I need to reject row if the coumn does not have | before column that
record should be rejected.
I kept a reject link in transformer stage but how to give a condition I am
not able to do?
can any one can share their ideas??
SUK |OTS |Outside The Scope 0% |0 |31/12/20|04/02/98|
SUK |PRO |Irrecoverable VAT pro-forma |17500 |31/12/20|01/01/06|
SUK |RVC |Reverse Charge-Int'l Service |0 |31/12/20|01/04/91|
SUK |UKB |Tax 17.5% |17500 |31/12/09|01/12/08|
SUK |UKB |Tax 15.0% |15000 |31/12/20|01/01/10|
SUK |UKN |UK Non Recoverable 0% |0 |31/12/20|04/02/98|
SUK |UKR |Reduced rate VAT 5% |5000 |31/12/20|01/01/97|
Above is the sample file format.
I need to reject row if the coumn does not have | before column that
record should be rejected.
I kept a reject link in transformer stage but how to give a condition I am
not able to do?
can any one can share their ideas??
Thanks,
M
M
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a reject link from the Sequential File stage that reads this file. Rows will be rejected if they don't contain the correct number of field delimiter characters.
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.
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
i kept a reject link from source seq_file stage
and Reject mode= output
than also it is not rejecting the records to reject link
it should reject in the below scenario mentioned if the coulmn does not have |before it reject it..
SHARPUK |ECS |EC goods imported into UK |0 |31/12/20|28/01/98|
SHARPUK |OTS |Outside The Scope 0% |0 |31/12/20|04/02/98|
SHARPUK |PRO |Irrecoverable VAT pro-forma |17500 |31/12/20|01/01/06|
SHARPUK |RVC Reverse Charge-Int'l Service |0 |31/12/20|01/04/91|
SHARPUK |UKB |Tax 17.5% |17500 |31/12/09|01/12/08|
SHARPUK |UKB |Tax 15.0% |15000 |31/12/20|01/01/10|
SHARPUK |UKN |UK Non Recoverable 0% |0 |31/12/20|04/02/98|
SHARPUK |UKR |Reduced rate VAT 5% |5000 |31/12/20|01/01/97|
SHARPUK |UKS |Tax Rate 17.5% 17500 |30/11/08|01/01/94|
SHARPUK |UKS Tax Rate 15.0% |15000 |31/12/09|01/12/08|
SHARPUK |UKS Tax Rate 17.5% |17500 |31/12/20|01/01/10|
SHARPUK |UKZ UK Zero Rate 0% |0 |31/12/20|04/02/98|
SHARPUK |UVO |"UK VAT Only " 17500 |31/12/20|01/01/94|
SHARPUK |WWV |Foreign Invoice NON UK VAT |0 |31/12/20|01/04/91|
SHARPUK |XMT |Exempt 0% |0 |31/12/20|28/01/98|
and Reject mode= output
than also it is not rejecting the records to reject link
it should reject in the below scenario mentioned if the coulmn does not have |before it reject it..
SHARPUK |ECS |EC goods imported into UK |0 |31/12/20|28/01/98|
SHARPUK |OTS |Outside The Scope 0% |0 |31/12/20|04/02/98|
SHARPUK |PRO |Irrecoverable VAT pro-forma |17500 |31/12/20|01/01/06|
SHARPUK |RVC Reverse Charge-Int'l Service |0 |31/12/20|01/04/91|
SHARPUK |UKB |Tax 17.5% |17500 |31/12/09|01/12/08|
SHARPUK |UKB |Tax 15.0% |15000 |31/12/20|01/01/10|
SHARPUK |UKN |UK Non Recoverable 0% |0 |31/12/20|04/02/98|
SHARPUK |UKR |Reduced rate VAT 5% |5000 |31/12/20|01/01/97|
SHARPUK |UKS |Tax Rate 17.5% 17500 |30/11/08|01/01/94|
SHARPUK |UKS Tax Rate 15.0% |15000 |31/12/09|01/12/08|
SHARPUK |UKS Tax Rate 17.5% |17500 |31/12/20|01/01/10|
SHARPUK |UKZ UK Zero Rate 0% |0 |31/12/20|04/02/98|
SHARPUK |UVO |"UK VAT Only " 17500 |31/12/20|01/01/94|
SHARPUK |WWV |Foreign Invoice NON UK VAT |0 |31/12/20|01/04/91|
SHARPUK |XMT |Exempt 0% |0 |31/12/20|28/01/98|
Thanks,
M
M
-
- Participant
- Posts: 59
- Joined: Wed Dec 31, 2008 5:49 am
Re: how to implement Reject logic
Hi,
Afer sequential file take transformer and do the count based on '|'
any way you will be knowing the max limit so that you can put constraint
in transformer saying that count less than that should be passed else rejected.
Afer sequential file take transformer and do the count based on '|'
any way you will be knowing the max limit so that you can put constraint
in transformer saying that count less than that should be passed else rejected.
Ravi
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
Re: how to implement Reject logic
hi Ravi thanks for reply but need some help!
in seq_file _stage i gave this format
Record level:
Final delimeter =none
Record delimeter = Unix new line
Field defaults:
Delimeter =|
Quote = none
job is running fine but problem when testing it with reject logic not able to get reject records:(:(:(
but not able to reject the records to reject file if coulmn doesnot have "|" before it..
I never did this scenario can u elaborate more? I mean what condition we should give? total "|" in file are 5 no need to vary about the last "|"
could you please give any example reagrding the condition in transformer stage?
These are the cloumns
Tra_Ori varchar 10
Tax_Ra varchar 10
Desc varchar 30
TR_1 varchar 7
expirydate varchar 8
effective dt varchar 8
in seq_file _stage i gave this format
Record level:
Final delimeter =none
Record delimeter = Unix new line
Field defaults:
Delimeter =|
Quote = none
job is running fine but problem when testing it with reject logic not able to get reject records:(:(:(
but not able to reject the records to reject file if coulmn doesnot have "|" before it..
I never did this scenario can u elaborate more? I mean what condition we should give? total "|" in file are 5 no need to vary about the last "|"
could you please give any example reagrding the condition in transformer stage?
These are the cloumns
Tra_Ori varchar 10
Tax_Ra varchar 10
Desc varchar 30
TR_1 varchar 7
expirydate varchar 8
effective dt varchar 8
Thanks,
M
M
-
- Participant
- Posts: 72
- Joined: Wed Dec 12, 2007 2:29 am
you can design your job this way
Seq_File------->Transformer------> Seq_File
In the source sequential file..take the complete record in only one field only..declare its length as the maximum possible length of a record according to your input specifications
Then use Dcount function in transformer which i guess,counts the number of occurence of given symbol (in your case its pipe)
If the value returned by Dcount function for a record, is less than the minimum number of pipes you are expecting,then direct it to the reject link
Hope this helps
Regards
Ulhas
Seq_File------->Transformer------> Seq_File
In the source sequential file..take the complete record in only one field only..declare its length as the maximum possible length of a record according to your input specifications
Then use Dcount function in transformer which i guess,counts the number of occurence of given symbol (in your case its pipe)
If the value returned by Dcount function for a record, is less than the minimum number of pipes you are expecting,then direct it to the reject link
Hope this helps
Regards
Ulhas
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
in seq_file _stage i gave this formatchulett wrote:Yes. In PX it would be directly from the stage, source or target, not off the Transformer like you would do in the Server product. ...
Record level:
Final delimeter =none
Record delimeter = Unix new line
Field defaults:
Delimeter =|
Quote = none
reject mode=output
job is running fine but problem when testing it with reject logic not able to get reject records:(
but not able to reject the records to reject file if coulmn doesnot have "|" before it..
These are the cloumns
Tra_Ori varchar 10
Tax_Ra varchar 10
Desc varchar 30
TR_1 varchar 7
expirydate varchar 8
effective dt varchar 8
any clear solution for rejecting from source stage seq-file stage were I am redaing the data???
Thanks,
M
M
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try being more explicit with data types. VarChar is very forgiving. Change TR1 to integer and expirydate and effective_dt to date (with a format string of "%dd/%mm/%yy").
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.
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
Ray's solution should resolve the issue. Could you please provide some sample record which is not getting rejected as per your expectations.ray.wurlod wrote:Use a reject link from the Sequential File stage that reads this file. Rows will be rejected if they don't contain the correct number of field delimiter characters. ...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Constraint expression ofmarpadga18 wrote:Need some condition in transformer stage to reject the rows if "|" are less than 5 so that i can reject that row?
Code: Select all
Count(InLink.TheString, "|") >= 5
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.
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am