Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
venkat.bmw
Warnings : 2

New User

Joined: 05 May 2009
Posts: 21
Location: India

 Posted: Fri Sep 24, 2010 5:05 pm    Post subject: How to CONVERT TEXT for EXcel to Numeric(dec) value in COBOL 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)

Phrzby Phil

Active Member

Joined: 31 Oct 2006
Posts: 972
Location: Richmond, Virginia

 Posted: Fri Sep 24, 2010 6:11 pm    Post subject: 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.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Fri Sep 24, 2010 7:32 pm    Post subject: 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. . .
Phrzby Phil

Active Member

Joined: 31 Oct 2006
Posts: 972
Location: Richmond, Virginia

 Posted: Fri Sep 24, 2010 7:38 pm    Post subject: Dick is a bit more current than I am, so use certainly NUMVAL if you have it.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Fri Sep 24, 2010 8:02 pm    Post subject:

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. . .
Phrzby Phil

Active Member

Joined: 31 Oct 2006
Posts: 972
Location: Richmond, Virginia

 Posted: Fri Sep 24, 2010 8:28 pm    Post subject: 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.
Akatsukami

Global Moderator

Joined: 03 Oct 2009
Posts: 1786
Location: Bloomington, IL

Posted: Fri Sep 24, 2010 8:36 pm    Post subject:

 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.
Phrzby Phil

Active Member

Joined: 31 Oct 2006
Posts: 972
Location: Richmond, Virginia

 Posted: Fri Sep 24, 2010 8:41 pm    Post subject: 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.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Fri Sep 24, 2010 9:06 pm    Post subject:

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). . .
venkat.bmw
Warnings : 2

New User

Joined: 05 May 2009
Posts: 21
Location: India

 Posted: Tue Sep 28, 2010 7:28 pm    Post subject: Reply to: How to CONVERT TEXT for EXcel to Numeric(dec) valu Thanks all !!!! ...
Phrzby Phil

Active Member

Joined: 31 Oct 2006
Posts: 972
Location: Richmond, Virginia

 Posted: Tue Sep 28, 2010 7:29 pm    Post subject: Venkat - So what is your solution?
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How to display offset thru cobol prog... tvinodkumar7 CICS 1 Sun Apr 22, 2018 8:42 pm Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us