Thanks for the response.
I was hoping VALIDATE_DATA was a little more encompassing for a single table to catch all errors for me in the first pass.
All the docs I've read seem to imply that it will return a list of ALL invalid columns. That's how I would expect it to work as well.
I'll have a deeper look at the source, but it's not the cleanest SQL function and definitely not over-documented 😊
In your cast example would you have to manually create an SQL statement for each table ?
I'm trying to have something more automated that goes thru a table one time and tells me where my bad columns are located.
Thanks again for your input.
Regards,
Richard Schoen
Web:
http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
message: 1
date: Tue, 15 Jul 2025 08:35:50 +0200
from: "Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
subject: RE: SYSTOOLS.VALIDATE_DATA issues?
Yep, that's correct. When I talked with Scott Forstie about that he mentioned that I to run it multiple times (after having corrected the wrong contents).
But the function is in the SYSTOOLS library, so you can get the source code, modify it and create your own function based on your modification.
For to detect or correct invalid numeric values, I use the TRY_CAST function and convert the column value into a numeric value with the same definition.
If an invalid value is detected a NULL value is returned ... and NULL Values can be trapped.
Something like this
Select *
From YourFile
Where Try_Cast(Col1 as Dec(11, 1)) is NULL
Or Try_Cast(Col2 as Dec(7, 2)) is NULL
Or ...
Or Try_Cast(ColN as Dec(15, 5)) is NULL;
Mit freundlichen Gr??en / Best regards
Birgitta Hauser
Modernization ? Education ? Consulting on IBM i Database and Software Architect IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"
"Train people well enough so they can leave, treat them well enough so they don't want to. " (Richard Branson) "Learning is experience ? everything else is only information!" (Albert
Einstein)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Richard Schoen
Sent: Tuesday, 15 July 2025 07:07
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: SYSTOOLS.VALIDATE_DATA issues?
Anyone else using this to validate table data ?
I'm seeing that it's only identifying a single column even though multiple columns have bad numeric data.
Any thought s ?
Regards,
Richard Schoen
As an Amazon Associate we earn from qualifying purchases.