View previous topic :: View next topic
|
Author |
Message |
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Need some help in converting
X(10) to S9(6)V9(2) format.
Input Field will be something like this -123456.10
last 3 number will always be deimal and two decimal digits.
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you data will always be valid, look at NUMVAL in the manual. |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Its not working.
My data looks like this
Code: |
01 WS-FIELD-A PIC X(11) VALUE '-3456.78'.
01 WS-FIELD-C PIC S9(6)V9(2) COMP-3 .
COMPUTE WS-FIELD-C = FUNCTION NUMVAL(WS-FIELD-A).
|
Output looks like this
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
What was your expectation for the result with those WS-definitions? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have a look at this one and tell us why you think your value is not correct. |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Thanks I understand the output.
This field is one the field in part of copybook layout. When I am trying to move it layput its throwing error of incompatbility. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Are you saying it is still a problem? If so, show how. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
This field is one the field in part of copybook layout. When I am trying to move it layput its throwing error of incompatbility. |
Instead of telling us what the message says, SHOW US THE MESSAGE! (Cut and paste the EXACT message.) And show us the line(s) of code for which you are getting the message. |
|
Back to top |
|
|
|