Home > Ask the AS/400 Experts > iSeries Application Development Questions & Answers > What is a Decimal Data Error?
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

What is a Decimal Data Error?

John Blenkinsop EXPERT RESPONSE FROM: John Blenkinsop

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 20 January 2006
Can you please tell me what a Decimal Data error is, and what is the scenario in which it is received?


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries Application Development
Monitoring escape messages and using RCVMSG for diagnostic messages
Listing contents of multiple FTP directories on AS/400
Chain operation error after converting RPG3 to ILE RPG (RPGIV)
Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C
Searching fields for values
iSeries application display subfiles with other program windows
Searching part of a name or address in AS/400
Passing parameters in an ILE RPG module
What's happening to my subfile?
What happening to my subfile?

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


Fields declared as numeric in files and in programs will be checked to see if they contain valid numbers when the data in them is used in a program. If they are NOT valid numbers, this is a Decimal Data Error, and unless the error is trapped in the program the program will fall over.

For example, if you receive data from another computer into a file on your system, that data might be wrong. It could contain blanks where the field defined on your machine expects a number. When the file is opened by a program and the record containing the invalid data is read, you will not get an error. But if the field containing the invalid data is read in the program, by being the Factor1 of a MOVEx operation, or either factor in an ADD, SUB, DIV, MULT etc., or on the right-hand side of an EVAL, or if it is involved in a WRITE or UPDATE operation -- then it will be checked, and then the program will fail.

If you regularly receive files that contain invalid data, and you need to correct that data, you will have to declare the fields as character and use TESTN or CHECK (or some other method) to check that the field contains valid numbers and correct the data if it does not.

Sometimes the problem occurs when a numeric field is overlaid with a different numeric definition in a data structure. For example, if you have a PACKED numeric field in the record, and the programmer defines the field as ZONED in a data structure, the zoned field will contain data in a form which is invalid for a zoned field, even though it IS valid for a packed field. In such cases, it's just a matter of taking care.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts