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 3270 Data stream error Benchwarmer CICS 6 Tue Apr 17, 2018 12:06 am
No new posts Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am
No new posts How to list data set names with diffe... murali.andaluri CLIST & REXX 8 Thu Apr 12, 2018 11:33 pm
No new posts Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am
No new posts Get the list of data sets on DASD and... rakaitn JCL & VSAM 3 Thu Mar 08, 2018 12:38 pm

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