Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Handling Data Exceptions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
praveenan

New User


Joined: 03 Dec 2007
Posts: 3
Location: India

PostPosted: Thu Jul 09, 2009 4:50 pm    Post subject: Handling Data Exceptions
Reply with quote

Hi,

Could someone please help on the below.

I have a variable PRICE declared as PIC '(4)9V.999'. When my program reads a value of '****.**' in place of price it abends. I have tried to handle this using ON Conversion and skip this error record with PRICE value '****.**'.

But instead of getting to ON Conversion block, my job abends with DATA EXCEPTION (ONCODE 8097). Now I want to know, how to handle this in a better way and skip the records that have any invalid value like '****.**'.

The program abends with DATA EXCEPTION while executing something like this:

IN.UNIT_PRICE = ROUND(REC.PRICE,2) * 100;
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 09, 2009 10:05 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

To avoid the data exception, you need to ensure the field contains a valid numeric value before moving it or using it in some calculation.
Back to top
View user's profile Send private message
praveenan

New User


Joined: 03 Dec 2007
Posts: 3
Location: India

PostPosted: Tue Jul 14, 2009 11:17 am    Post subject:
Reply with quote

Thanks!. Now I have used 'verify' before using that field and it works now.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jul 14, 2009 7:40 pm    Post subject: Reply to: Handling Data Exceptions
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
praveenan

New User


Joined: 03 Dec 2007
Posts: 3
Location: India

PostPosted: Wed Jul 15, 2009 10:59 am    Post subject:
Reply with quote

Hi,

I still have a question regarding the use of ON CONVERSION.Is it mandatory that we need to correct the error record which gets to CONVERSION loop (say using ONCHAR or ONSOURCE). Can we not just try to skip the record when it enters ON CONVERSION?.

I wanted to skip the records whichever encounters CONVERSION error, by just setting some flags inside the CONVERSION block ,like below.

ON CONVERSION
BEGIN;
WRIT_IT=0;
ERR_CNT=0;
END;

But the error record is not skipped,instead the conversion error is thrown.Please could someone help me on this.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us