Elaborate……
Calling the same function more than once isn’t going to solve its flaw, unless you know something I don’t.
Regards,
Richard Schoen
Web:
http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
message: 4
date: Tue, 15 Jul 2025 15:46:15 -0400
from: Rob Berendt <robertowenberendt@xxxxxxxxx>
subject: Re: SYSTOOLS.VALIDATE_DATA issues?
Recursion?
On Tue, Jul 15, 2025 at 3:44?PM Richard Schoen <richard@xxxxxxxxxxxxxxxxx>
wrote:
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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.