Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us