IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

NUMVAL and IGZ0152S error


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Mon Aug 09, 2010 4:02 pm
Reply with quote

Hi,

JIYZ0151-CDGCOMER PIC X(15).
PT-CPTRAMS-STORE PIC 9(12).

COMPUTE PT-CPTRAMS-STORE = FUNCTION NUMVAL(JIYZ0151-CDGCOMER)
END-COMPUTE


Input is
JIYZ0151-CDGCOMER
X(15) DISP '00000100802HOUS'

I am getting error:
IGZ0152S Invalid character O was found in column 13 in argument-1 for function NUMVAL in program JICZ669 at
displacement X'335C'.
From compile unit JICZ669 at entry point JICZ669 at statement 1380 at compile unit offset +0000335C at entry
offset +0000335C at address 16D04304.

I had expected that NUMVAL will move 00000100802 into PT-CPTRAMS-STORE. However, program is abending on 'O'. I wondering why not 'H' or 'S'.

Could you please explain why is it abending, why NUMVAL is not working? Why is it pointin to 'O'?

Many thanks,
Zurich Lad
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 09, 2010 4:12 pm
Reply with quote

because H is a valid zoned decimal signed +8,
even though O s a valid zoned decimal signed -6,
NUMVAL does not accept more than 1 sign.

IF you would refer to the documentation about NUMVAL,
you will see that the function only accepts certain characters.
even for NUMVAL the text garbage has to be culled.

you could use an INSPECT CONVERTING before the NUMVAL
or determine exactly in your text where valid numeric data ends
and garbage begins
and use REFERENCE MODIFICATION on the NUMVAL.
Back to top
View user's profile Send private message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Mon Aug 09, 2010 4:21 pm
Reply with quote

Thanks very much Dick.

It was interesting surprise knowing NUMVAL does not accept more than one sign.

i will use INSPECT and REFERENCE MOD to fetch numeric part.

Regards.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 09, 2010 4:27 pm
Reply with quote

Quote:
It was interesting surprise knowing NUMVAL does not accept more than one sign.


well, to be honest, I did not find that in any manual.
I just figured,
what would NUMVAL do with two (2) signs?
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Aug 10, 2010 12:05 pm
Reply with quote

Quote:
I just figured,
what would NUMVAL do with two (2) signs?

Like the OP just experienced: It rolls over and dies...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top