View previous topic :: View next topic
|
Author |
Message |
venkat.bmw Warnings : 2 New User
Joined: 05 May 2009 Posts: 21 Location: India
|
|
|
|
I have a field which gets value from excel
let assume working storage field as TOTAL-QTY
TOTAL-QTY = 000234.5500000 ( i am getting from excel)
Since this value is consider as text , i am getting value while converting to exact decimal
even '.' is consider as text . so i uable to move values
Note : i cannot use NUMVAL bcz of older cobol version.
i need to convert this to numeric field 234.55 9(9)v9(5) |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
If I understand, and regardless of where the data came from, you have a character value like "234.55" and you want the numeric representation.
If you always have two dec places, the define a group var with three parts: integer part IP (say PIC 9(9)), decimal point DPT (PIC X), and decimal part DP (PIC 99).
I would check DPT for = '.' just as a check, but the numeric calc is IP + DP/100.
If the number of dec places varies, then you'll need to write code to locate the decimal place, use reference modification to pull out the int and dec parts separately, and divide by the appropriate power of 10.
However, if I do not understand, then please disregard this post. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Before NUMVAL was implemented, we used arrays to parse the input value and create a numeric from the text value. . .
Suggest you do the same if you have no access to a current compiler. . . |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Dick is a bit more current than I am, so use certainly NUMVAL if you have it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Phil,
Quote: |
Note : i cannot use NUMVAL bcz of older cobol version. |
I do wonder at why organizations run compilers that are so out of date.
An incredibly poor management choice. . . |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Dick -
Upgrading requires a certain infrastructure investment, and that may not be available everywhere (at least with the quality required).
Since software doesn't "break," and since (we) experienced programmers find legit workarounds for known issues, I can understand a certain amount of stagnation here.
With limited investment $$, application programmers affect the bottom line more directly. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
dick scherrer wrote: |
I do wonder at why organizations run compilers that are so out of date. |
Because migrating to a new release not only requires the time and effort of the language support workgroup to install it and prescribe changes to JCL and (non-programmatic) procedures, but for someone to read through the migration documents and decide whether impacts require source modules to be reviewed and, perhaps, modified (costing even more).
My shop is now in the final year of a migration from MVS PL/I 1.1.1 to Enterprise PL/I (currently 3.8.0, build of 8 April 2010). It's a huge, expensive, and messy effort. And because it is huge, expensive, and messy, if IBM wasn't terminating support for MVS PL/I, we'd use that compiler until the Sun went cold. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
The tour guide at the Natural History Museum, pointing to the huge dinosaur skeleton, said that these animals roamed the earth 60million and six years ago.
I asked where she got that information, and she replied that when she started working at the museum, they told here the dinosaurs lived 60million years ago, and she's been working at the museum for six years. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I'm in favor of not always being the first in my neighborhood to get the current releases, but to run "stuff" that is 20-30-+ years old. . . Methinks this is nonsense.
Also, the "cost" of using the old stuff goes up. Unfortunately, this is only "opportunity cost", and as such counts little. . .
Quote: |
application programmers affect the bottom line more directly |
There is a willingness to pay the salaries to use less productive tools. . .
I also believe that as there is more and more integration with newer technologies, the out-of-service development tools will be replaced.
Lastly, it has been my experience that organizations that keep their software reasonably current do not have the problems/cost of waiting for many years to apply the upgrades. I suspect that if a system had been left to "idle" for 20 years, it could be quite an adventure doing the upgrade(s). . . |
|
Back to top |
|
|
venkat.bmw Warnings : 2 New User
Joined: 05 May 2009 Posts: 21 Location: India
|
|
|
|
Thanks all !!!! ... |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Venkat -
So what is your solution? |
|
Back to top |
|
|
|