View previous topic :: View next topic
|
Author |
Message |
Hank Watson
New User
Joined: 25 Nov 2010 Posts: 6 Location: Miami, FL
|
|
|
|
Does anyone have a clever way of taking a left justified, space filled PIC X field that contains a number and moving it to an actual numeric field. I can do it byte by byte (which I have done many times in the past) but is there an easier way? In other languages, such as JAVA, this is easy; but I don't know of an easy way to do this in COBOL. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
If you are absolutely positive the value will always be a left-justified numeric value, you might consider using NUMVAL to move the number to a numeric field.
If you are not familiar with NUMVAL, there is a link to "IBM Manuals" at the top of the page. What you are looking for will be in the COBOL Language Reference. |
|
Back to top |
|
|
Hank Watson
New User
Joined: 25 Nov 2010 Posts: 6 Location: Miami, FL
|
|
|
|
This was my first attempt at posting to any of the forums. I must say - VERY IMPRESSED! Perfect anwser forcing me to read the book and learn something new. Not surprisingly, the function works as documented. Many thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thanks for letting us know
Some of us "old guys" believe the main purpose of the forum is to help with learning . . .
d |
|
Back to top |
|
|
|