View previous topic :: View next topic
|
Author |
Message |
manugeorge2004
New User
Joined: 17 Jun 2009 Posts: 38 Location: Denver
|
|
|
|
I have a requirement to multiply a quantity with an amount ( sounds simple). But the value coming in for quantity is not predictable. Amount is alway 7 dollar positions and 2 cents positions
The quantity is coming in as X(10).
The value can be in any of the below format
00000001.5
0000001.55
000001.555
00001.5555
0001.55555
001.555555
01.5555555
1.55555555
How can I do the muliplication
How can I convert the above values to numeric with same data and do the multiply.
Can I use NUMVAL.
eg.COMPUTE QTY-NUM = FUNCTION NUMVAL(QTY-ALPHANUM)
If so, if I define QTY-NUM as 9(8)V9(8), can I give this directly in my multiplication
I want to avoid looping. Also, if NUMVAL wont do this, can I use any other functions or statements like UNSTRING,INSPECT etc
Your advice is appreciated |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
If the X(10) quantity could contain a currency sign, look at NUMVAL-C also. In addition to the Reference Manual Dick pointed to, see the Programming Guide for more information about NUMVAL and NUMVAL-C. |
|
Back to top |
|
|
|