Data Decimal Error In As400
Contents |
statements Oracle on iSeries File Sharing View All Integrated File System (IFS) iSeries Access (Client Access) iSeries managed email and groupware NetServer Network File System (NFS) QNTC File System High Availability View All Business Continuity High fix decimal data error in sql as400 Availability Tools Replication IBM iSeries division news View All iSeries application development decimal data error occurred in as400 View All iSeries Application development tools iSeries CL programming iSeries COBOL programming iSeries ILE programming iSeries Java programming iSeries programming iseries decimal data error commands RPG iSeries programming Visual basic on iSeries iSeries backup and recovery View All Data backup, storage and retrieval on iSeries iSeries disaster recovery and business continuity Remote Journaling Restores Storage iSeries packed and zoned decimal in as400 database management View All DB2 UDB (universal databases) iSeries SQL commands and statements Oracle on iSeries iSeries document output View All Imaging on iSeries Printing on iSeries Printing-Imaging Tools iSeries hardware management View All Grid Computing Logical Partitions (LPAR) On-demand Computing iSeries networking View All Connecting to Printers FTP Physical connections to iSeries Remote Access to iSeries TCP-IP VoIP iSeries security planning View All iSeries
Decimal Data Error In Rpgle
physical security iSeries system and application security Security Tools iSeries systems management View All Change Management Debugging i5-OS -- OS-400 iSeries Applications iSeries compliance and regulation iSeries service and support issues iSeries system performance and monitoring Multi-platform Integration Performance Server Consolidation Server Installation Server Pricing Systems Management Tools iSeries training and education View All iSeries job market iSeries skills User Groups iSeries upgrades and modernization View All Web Topics Archive View All iSeries Resources Please select a category File Sharing High Availability IBM iSeries division news iSeries application development iSeries backup and recovery iSeries database management iSeries document output iSeries hardware management iSeries networking iSeries security planning iSeries systems management iSeries training and education iSeries upgrades and modernization Section Evaluate News Get Started Evaluate Manage Problem Solve Sponsored Communities Q What is a Decimal Data Error? byJohn Blenkinsop One Search400.com member writes, "Can you please tell me what a Decimal Data error is, and what is the scenario in which it is received?" Search400.com's application development expert John Blenkinsop explains. Sections Share this item with your network: Related Expert Q&A Converting amount fields – SearchSAP How to read the formatted dump o
This document provides information about finding and correcting decimal data errors. Resolving the problem It is not uncommon for programs to have problems with decimal data errors when working with files that originated on mainframes, non-IBM systems, and the IBM
Mch1202 Error In As400
System/36. Program-described files are normally used on these systems and can result in non-numeric hexadecimal how to handle decimal data error in rpg values in numeric fields. It is also possible for a program on the IBM OS/400 or IBM i5/OS system to do this because decimal data error in cobol 400 program-described files are still available, especially for programs that have been migrated and are running in the System/36 environment. The following example takes advantage of the field descriptions in externally-described files to correct the problem. The program reads in http://search400.techtarget.com/answer/What-is-a-Decimal-Data-Error each record and writes it out making assumptions on what the correct value should be. You are responsible for evaluating the results of using this program. Because it is necessary to make assumptions, the results might not be what you require. However, there is a very good chance the results will be satisfactory. Always keep a back-up copy of the file until you evaluate the results and are comfortable with the end result. In the case of http://www-01.ibm.com/support/docview.wss?uid=nas8N1018444 zoned numeric fields, hexadecimal values such as blanks, control characters, and unassigned hexadecimal values are normally converted to zeroes. When letters or special characters (for example, the ampersand) are encountered, the first hexadecimal character is converted to an F. For example, the letter A is C1 in hex, while the letter a is 81 in hex. Both are converted to F1, which is the number one. In testing, 8aA69 is converted to 81169. However, when certain values are encountered in certain positions in the field, the entire field can be converted to a zero value. For packed numeric fields, an incorrect value in any position normally causes the entire field to be converted to a zero value. One exception was noted in testing. A 10-digit packed field requires a 6-byte field, and the first position of the first byte is not used. An incorrect value in that first position still produced a correct converted value. All other testing resulted in a zero value being produced. To create and run the program to correct your data, you should do the following: 1. Make a copy of the file so you can examine the resulting changes. To avoid accidentally updating the production copy, use a different name for the copy. For example, if the original name is ORDDET, the copy could be ORDDETX. Note: Ensure you are not using an exist
decimal data errors. One single such error can ruin an entire day. The wise programmer uses tools and techniques to keep invalid numeric data from becoming a http://www.itjungle.com/fhg/fhg080713-story02.html problem. One such tool that you can use to find and fix invalid data is SQL. Assume that a physical file has a customer account number stored as seven digits packed decimal, http://www.ibmsystemsmag.com/ibmi/developer/rpg/Ending-Those-Decimal-Data-Error-Blues/ with no decimal positions. Suppose there are one or more blank records in the physical file. You query the file by customer number, like this: select * from baddata where customerid = 2026025 error in The system heartlessly responds with error messages: QRY2283: Selection error involving field CUSTOMERID; and CPD4019: Select or omit error on field BADDATA_1.CUSTOMERID member BADDATA. So what's an i professional to do? The solution is to use the HEX function to select the bad records. Since a blank is X'40' in the EBCDIC collating sequence, this is the SQL command you need. select * from baddata where decimal data error hex(customerid) = '40404040' Once you find the bad data, you can delete it. delete from baddata where hex(customerid) = '40404040' Or, if you prefer, you can correct it. update baddata set customerid = 0 where hex(customerid) = '40404040' Blanks may be the most common form of invalid decimal data, but they are not the only invalid values. Even so, the HEX function is still the way to find and fix the data. Here's another example. COST is a five-digit, packed-decimal field with two decimal positions. This statement retrieves items that have invalid cost values. select i.ItemNumber, i.Description from items as i where substr(hex(i.cost),1,1) < '0' or substr(hex(i.cost),2,1) < '0' or substr(hex(i.cost),3,1) < '0' or substr(hex(i.cost),4,1) < '0' or substr(hex(i.cost),5,1) < '0' or substr(hex(i.cost),6,1) not between 'A' and 'F' This statement will find items with any non-packed item cost, including blanks. These illustrations use packed-decimal data. The principle is the same for zoned-decimal data. Post this story to del.icio.us Post this story to Digg Post this story to Slashdot Sponsored By WORKSRIGHT SOFTWARE Do you need area code information? Do you need ZIP Code information? Do you need ZIP+4 information? Do you need cit
RECOVERY DB2 DOMINO HIGH AVAILABILITY LPAR NETWORKS PERFORMANCE PRINTING SECURITY SYSTEMS MANAGEMENT WEBSPHERE WINDOWS INTEGRATION GENERAL JAVA MODERNIZATION RPG WEBSPHERE CLOUD COMPUTING IBM ANNOUNCEMENTS IBM RESEARCH iTALK WITH TUOHY LINUX OPEN SOURCE SOA WHAT'S NEW APPLICATION DEVELOPMENT MISCELLANEOUS SYSTEMS MANAGEMENT AUTOMATIVE BANKING/FINANCE HEALTHCARE INSURANCE MANUFACTURING MISCELLANEOUS NON-PROFIT RETAIL DISK FLASH OPTICAL SERVERS TAPE PRODUCT REVIEWS IBM i > DEVELOPER > RPG Ending Those Decimal Data Error Blues July 2003 | by Jon Paris, Susan Gantner Print The OS/400 V5R2 version of the RPG compiler features many enhancements related to file I/O operations. We've found a useful way to leverage the fact that V5R2 allows you to specify a data structure (DS) as the result field of an I/O operation such as READ or UPDATE. Prior to V5R2, we could do this only for program-described files. (Remember those?) This new extension provides some interesting possibilities. For one thing, it can provide a performance benefit, especially for batch jobs that process multiple records with many fields. Normally with RPG programs an I/O operation such as a READ requires the compiler to move each field individually from the file buffer to its storage location. You may have noticed this behavior when stepping though a program in debug. If you press F10 (step) on, say, a READ operation, the debugger "leaps" off to the I-specs and subsequent step operations work their way painfully through field after field-this behavior occurs even if all of the files fields are described in an externally described DS. However, using this new support, when a DS is specified as the result field, all of the fields are filled with a single move operation. This is more efficient than a series of individual moves. Another advantage of this support is that it provides more options for detecting and resolving invalid data items that may exist in our files. With a normal type of READ, if any data validity problems