Validating all fields of a row & send errors to ErrFile/
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 7
- Joined: Wed Aug 03, 2005 1:14 pm
Hi, Thanks for replying so fast.
I am capturing each field individually and storing them in separate stage variables but I cannot seem to get more then 1 error message per row. I am rather new to DS and there may be something subtle that I not aware of with this technique.
For example ...
Acct# Chk# ID AcctCde ChkAmt
123A 2222 ABC 100.00
If there is an error in the account number field and the account code field I would like to be able to format the following records
ErrDesc Acct# Chk# ID AcctCde ChkAmt
Non-Numeric. Acct# 123A .....................................
AcctCde Required 123A ....................................
I only get the last message, I cannot get the first error message.
Again any help would be most appreciated. Sorry for the long winded post.
Thanks ... Working Grunt. :D
I am capturing each field individually and storing them in separate stage variables but I cannot seem to get more then 1 error message per row. I am rather new to DS and there may be something subtle that I not aware of with this technique.
For example ...
Acct# Chk# ID AcctCde ChkAmt
123A 2222 ABC 100.00
If there is an error in the account number field and the account code field I would like to be able to format the following records
ErrDesc Acct# Chk# ID AcctCde ChkAmt
Non-Numeric. Acct# 123A .....................................
AcctCde Required 123A ....................................
I only get the last message, I cannot get the first error message.
Again any help would be most appreciated. Sorry for the long winded post.
Thanks ... Working Grunt. :D
-
- Premium Member
- Posts: 252
- Joined: Mon Sep 19, 2005 10:28 pm
- Location: Melbourne, Australia
- Contact:
I have seen an idea posted in this forum whereby you concatenate the messages with a line feed character (ASCII 10) between each one, and them write them directly to a sequential file.
So, if a single input row has 4 errors, a single "row" is written to the output but it actually comes out as 4 rows.
A file is the ONLY place you can write them. If you direct the output to any other kind of stage it won't work.
So, if a single input row has 4 errors, a single "row" is written to the output but it actually comes out as 4 rows.
A file is the ONLY place you can write them. If you direct the output to any other kind of stage it won't work.
Ross Leishman
-
- Participant
- Posts: 31
- Joined: Mon Dec 01, 2003 6:24 am
- Location: London
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create validation stage variables of the kind
Note that each has a space character if the column is good.
To create a single message with all, simply concatenate these all together, then apply a Trim() function to reduce any extraneous internal space.
Code: Select all
If test Then " " Else "Column x is bad because..."
To create a single message with all, simply concatenate these all together, then apply a Trim() function to reduce any extraneous internal space.
Code: Select all
Trim(svValidate1 : svValidate2 : svValidate3)
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.
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
And you can put a char(10) at the start of each test message to make it appear on a seperate row. You can output both an error header file and an error item file, the header has some columns that identify the job name and process information (process identification and date) and something that identifies the row being processed. The item rows have details about the errors that occurred on that row. The char(10) format the output so the items follow the headers to make the file readable or loadable into a database.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Participant
- Posts: 7
- Joined: Wed Aug 03, 2005 1:14 pm