× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



For OPM RPG, compile the program CRTRPGPGM with IGNDECERR(*YES).

For ILE RPG, compile the program CRTRPGMOD or CRTBNDRPG with FIXNBR(*ZONED 
*INPUTPACKED). Look at the help text from the CRTRPGMOD command, below.

Create RPG Module (CRTRPGMOD)

Fix numeric (FIXNBR) - Help

Specifies whether decimal data that is not valid is fixed by the compiler.

*NONE
Indicates that decimal data that is not valid will result in decimal errors 
during run time if used.

*ZONED
Zoned decimal data that is not valid will be fixed by the compiler on the 
conversion to packed data. Blanks in numeric fields will be treated as 
zeros. Each decimal digit will be checked for validity. If a decimal digit 
is not valid, it is replaced with zero.  If a sign is not valid, the sign 
will be forced to a positive sign code of hex 'F'.  If the sign is valid, 
it will be changed to either a positive sign hex 'F' or a negative sign hex 
'D' as appropriate.  If the resulting packed data is not valid, it will not 
be fixed.

*INPUTPACKED
Indicates that if packed decimal data that is not valid is encountered 
while processing input specifications, the internal variable will be set to 
zero.

Hope this helps.




-----Original Message-----
From:   rick.baird@xxxxxxxxxxxxxxx
Sent:   Sunday, September 21, 2003 12:25 PM
To:     RPG programming on the AS400 / iSeries
Subject:        Re: data decimal errors - ignore the prev message - sorry for 
the 
html - damned inotes!


hey all, sorry for the last message with html crap.

I've got a csv that I import into a workfile and process.  It's created by
a 3rd party.

sometimes, they screw up and send invalid numeric data when I'm looking for
numbers.  I've been burned on this several times, and i'm looking for a
good and quick way of trapping for the error.

I use the CPYFRMIMPF to load it into my PF, and it doesn't care about
invalid numerics - it just loads the data without error.

my rpg program blows up on the read - no chance for the MONITOR in the
calcs.

can I change the program to 'ignore data decimal errors' and then use
TESTN?  or a MONITOR group?

any and all ideas are appreciated.

thanks,

rick


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.