|
Douglas Handy wrote: > > While FixNbr() can "fix" bad numeric data, I think the real question > is why the data is bad in the first place. How can you be sure that > the "fix" by substituting invalid zone and digit nibbles really gives > you the value you should have? > > You may be just treating a symptom and hiding a larger problem. I > think you need to examine what creates the data (if this is under your > control). > I agree. "Fixing" a record so the data may or may not be meaningless seems odd to me. And there may be equally wrong data in character fields, but because the system doesn't care what data is in character fields, you won't get an exception. Maybe the data isn't always being put in the positions that the RPG program expects. If you wanted to just completely skip bad records, you could read the file program-described into a data structure, and then process the data structure subfields in a monitor group, then if anything failed, you could handle it in the on-error - either massage the data (if that makes sense), or write the bad record out to some other file for manual inspection.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.