View previous topic :: View next topic
|
Author |
Message |
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Hello,
My requirement is I have a varibale INV PIC X(10)
And I need to move it OUTV PIC 9(4)V9(5)
Ex :
INV = 1.0000
OUTV= 0001.00000
INV = 1.045
OUTV=0001.04500
Can anyone help me in this. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Does the data in INV contain an actual decimal "." point, do you want an actual decimal in OUTV? |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Yes The data in INV contains an actual decimal ".".
I want that decimal in my output .
as if the INV is 25.678 i want my OUTV as 0025.67800 |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
UNTESTED:
OUTV must be defined as PIC 9(4).9(5)
requires a new field TEMPV PIC 9(4)V9(5).
COMPUTE TEMPV = NUMVAL(INV)
MOVE TEMPV TO OUTV |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Hey Dick, wouldn't MOVE NUMVAL(INV) TO OUTV work too? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
It has to be a COMPUTE.
The receiving field can be defined with COMP-3 if you want:
Code: |
01 NUMVAL-AREA.
03 NUMVAL-FROM PIC X(17).
03 NUMVAL-TO PIC S9(13)V99 COMP-3.
MOVE ' +987.65' TO NUMVAL-FROM
DISPLAY 'FROM = {' NUMVAL-FROM '}'
COMPUTE NUMVAL-TO = FUNCTION NUMVAL (NUMVAL-FROM)
DISPLAY ' TO = {' NUMVAL-TO '}' |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
CICS Guy,
directly to OUTV (the edit mask) will work. My enterprise compiler does not like the MOVE, but will allow COMPUTE FUNCTION NUMVAL.
.......... I always use compute when I want to move numerics. my thing. |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Thanks all |
|
Back to top |
|
|
|