Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

7.1.31 NUMVAL-C



The NUMVAL-C function returns the numeric value represented by the alphanumeric character string specified as argument-1. Any optional currency sign specified by argument-2 and any optional commas preceding the decimal point are stripped away, producing a numeric value that can be used in an arithmetic expression.

The function type is numeric.


X The NUMVAL-C function cannot be used if any of the following are true:


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__FUNCTION NUMVAL-C__(argument-1_ ____________ _)_________________>< |
   |                                    |_argument-2_|                      |
   |                                                                        |
   |________________________________________________________________________|
argument-1
Must be a nonnumeric literal or an alphanumeric data item whose content has either of the following formats:


    ________________________________________________________________________ 
   |                                                                        |
   | >__ _______ __ ___ __ _______ __ ____ __ _______ ____________________> |
   |    |_space_|  |_+_|  |_space_|  |_cs_|  |_space_|                      |
   |               |_-_|                                                    |
   |                                                                        |
   | >__ _digit__ ______________ __ ______________ _ __ _______ __________> |
   |    |        | <__________  |  |_.__ _______ _| |  |_space_|            |
   |    |        |___,__digit_|_|       |_digit_|   |                       |
   |    |_.__digit__________________________________|                       |
   |                                                                        |
   |________________________________________________________________________|

    ________________________________________________________________________ 
   |                                                                        |
   | >__ _______ __ ____ __ _______ ______________________________________> |
   |    |_space_|  |_cs_|  |_space_|                                        |
   |                                                                        |
   | >__ _digit__ ______________ __ ______________ _ __ _______ __________> |
   |    |        | <__________  |  |_.__ _______ _| |  |_space_|            |
   |    |        |___,__digit_|_|       |_digit_|   |                       |
   |    |_.__digit__________________________________|                       |
   |                                                                        |
   | >__ ____ __ _______ _________________________________________________> |
   |    |_+__|  |_space_|                                                   |
   |    |_-__|                                                              |
   |    |_CR_|                                                              |
   |    |_DB_|                                                              |
   |                                                                        |
   |________________________________________________________________________|
space
A string of one or more spaces.

cs
The string of one or more characters specified by argument-2. At most, one copy of the characters specified by cs can occur in argument-1.

digit
A string of one or more digits. The total number of digits must not exceed 18.

If the DECIMAL-POINT IS COMMA clause is specified in the SPECIAL-NAMES paragraph, the functions of the comma and decimal point in argument-1 are reversed.

argument-2
If specified, must be a nonnumeric literal or alphanumeric data item, subject to the following rules:

  • argument-2 must not contain any of the digits 0 through 9, any leading or trailing spaces, or any of the special characters + - . ,
    
    
  • argument-2 can be of any length valid for an elementary or group data item, including zero
    
    
  • Matching of argument-2 is case-sensitive. For example, if you specify argument-2 as 'Dm', it will not match 'DM', 'dm' or 'dM'.
    
    

If argument-2 is not specified, the character used for cs is the currency symbol specified for the program.

The returned value is an approximation of the numeric value represented by argument-1.

Previous Topic Next Topic Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.