Decimal Data Error As400 Cobol
Contents |
statements Oracle on iSeries File Sharing View All Integrated File System (IFS) iSeries Access (Client Access) iSeries managed email and groupware mch1202 error in as400 NetServer Network File System (NFS) QNTC File System High Availability
Decimal-data Error Occurred In As400
View All Business Continuity High Availability Tools Replication IBM iSeries division news View All iSeries how to handle decimal data error in rpg application development View All iSeries Application development tools iSeries CL programming iSeries COBOL programming iSeries ILE programming iSeries Java programming iSeries programming commands RPG iSeries rpgle monitor decimal data error 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 database management View All DB2 UDB (universal databases) iSeries SQL commands and statements Oracle on iSeries iSeries document output View All
Cause Of Decimal Data Error In As400
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 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 network
download here. We have all encountered decimal data errors at some time or another. The biggest difficulty they present is that, by the time they have been detected, no recovery is possible. Or to be more precise, no practical recovery is possible. In my previous tip, I mentioned that one of the benefits of data structure I/O is that you can avoid decimal data errors. In this tip I'm going to show you how and why that works. The code package associated with this tip contains three test programs that demonstrate the different scenarios. The first is a straightforward RPG program with no defenses. It reads a file in a loop and will encounter decimal data errors. The second is intended to show the basic use of DS http://search400.techtarget.com/answer/What-is-a-Decimal-Data-Error I/O. It still has errors but they are subtly different. The third program demonstrates how to extend the program to fully defend against such errors. See the Readme.txt file for instructions on how to install the source code on your system. One factor that adds to the difficulty of handling data decimal errors is that that they may occur on a READ or CHAIN operation, making it difficult to determine exactly which field is in error. This happens because the system detects the http://www.itjungle.com/fhg/fhg031715-story01.html error while moving the data from the buffer to the internal variable. When we use DS I/O, the entire record is moved as if it were a large character field. In other words the numeric data is not differentiated. Since numeric fields are not differentiated they can't cause errors! Let's walk through the process of running each of the three programs so that you can see the differences between them. First, here are relevant portions of program DATAERRS1. FBadData IF E DISK DoU %EOF(BadData); Read BadData; If %EOF(BadData); Leave; EndIf; records += 1; total += amount; date = %Date(numDate: *YMD); EndDo; If you run this program, you will receive an error when reading the second record. Using F1 to look at the actual details of the error reveals that it occurred on one of the compiler-generated lines associated with the READ. This is even more obvious when you run the program in debug. If you tell the program to go (option G) you will find a similar error occurs on the reading of the third record. In both cases, determining which field is in error is problematic and the only valid option is to cancel the program. Now run program DATAERRS2. FBadData IF E DISK D inputData E DS ExtName(BadData: *Input) DoU %EOF(BadData); Read BadData inputData; // Read into DS If %EOF(BadData); Leave; EndIf; records += 1; total += amount; date = %Date(numDate: *YMD); EndDo; The only difference is that the program uses a DS to rec
check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the http://www.code400.com/forum/forum/iseries-programming-languages/cobol-aa/8853-causes-of-decimal-data-error selection below. sponsored links Collapse Announcement Collapse No announcement yet. Causes of DECIMAL DATA ERROR Collapse X Collapse Posts Latest Activity Search Page of 1 Filter Time All Time Today Last Week Last Month Show All Discussions only Photos only Videos only Links only Polls only Filtered by: Clear All new posts kpandian Code400 Newbie Join Date: Oct 2009 Posts: 29 #1 Causes of DECIMAL DATA ERROR January 6th, 2010, 04:41 AM The following is the issue, i data error have faced. I read a file and moved the value of one of its NUMERIC [Eg.FLD1] field to a working variable [Eg. WFLD1] in COBOL. i.e MOVE FLD1 to WFLD1 [both fields are of numeric & length is same] But, my program has received MCH1202 during the processing of the file. Now, i need to find out the various possibles scenarios which can cause the DECIMAL DATA ERROR i.e MCH1202 in a COBOL program. so that i can avoid decimal data error those scenarios. Kindly help me in this regard. Tags: None Terry Wincheste Analyst Join Date: Jun 2005 Posts: 339 #2 January 6th, 2010, 06:27 AM Re: Causes of DECIMAL DATA ERROR Check to ensure the field has a valid numeric value *before* you move it: Code: if FLD1 numeric move FLD1 to WFLD1 else (Do Error Logic) end-if Comment Cancel Post johnmauro Experienced Forum Member Join Date: Dec 2007 Posts: 86 #3 January 6th, 2010, 09:26 AM Re: Causes of DECIMAL DATA ERROR and make sure the field receiving the numeric value has been properly set to a numeric value as in initilaization John M. Mauro Software Engineer MedAssets Comment Cancel Post kpandian Code400 Newbie Join Date: Oct 2009 Posts: 29 #4 January 7th, 2010, 12:29 AM Re: Causes of DECIMAL DATA ERROR Hi Terry and John, thanks for the solution. I have also implemented the same like solution. But, i just found that the following are the scenarios which will cause the DECIMAL DATA ERROR: 1. Assigning non-numeric values to NUMERIC field. [NUMERIC validation will prevent this] 2. Trying to refer a varible, which is not stored/assigned with any values. [Initialization will prevent this] If there are anyother possible scenarios which would cause the error, kindly share the same. Last edited by kpandian; August 10th, 2011, 10:51 PM. Reason: corrected the Typo error. Comment Cancel Post Previous Next sponsored links Collapse English (US) spa