|
"Klein, Ron" wrote:
>
> Hi All,
> I have encountered a lot of numeric fields that contain bad data. In
> specific these are packed fields that have a value of Hex'00' in them. So I
> need to change them to Hex'0F'. Any suggestions on how I can accomplish
> this. TIA
> Ron
Ron, there are a couple of ways to fix up your bad packed data:
1. a. Copy your DDS and in the copy, change the packed fields to zoned.
b. Create a new temp file from this DDS.
c. Do a CPYF FMTOPT(*MAP) from your file to the temp. Any fields
with bad
decimal data will get set to the default value for the field.
d. Do CPYF MBROPT(*REPLACE) FMTOPT(*MAP) from the temp to your file.
2. ILE RPG has a parameter that allows bad packed data from input files
to be
ignored and replaced with zero in the program field -
FIXNBR(*INPUTPACKED)
You could write a little 3-line program to clean up your file:
H fixnbr(*inputpacked)
Fmyfile up e disk
c update myrec
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.