|
|
| Author |
Message |
keane
New User
Joined: 24 Jul 2006 Posts: 5
|
|
|
|
I want to process a value with editing characters.
For example: If I have a value $1,250,000 in the input file, then i want to convert it into 1250000 for further processing.
Please let me know your ideas to acheive the above task |
|
| Back to top |
|
 |
References
|
|
 |
Bill O'Boyle
Senior Member
Joined: 14 Jan 2008 Posts: 345 Location: Orlando, FL, USA
|
|
|
|
In the applicable COBOL manual, review the concept of DEEDIT.
Bill |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8729 Location: 221 B Baker St
|
|
|
|
Hi Bill,
DEEDIT isn't found in any of the COBOL manuals we have linked (IBM Manuals at the top of the page).
Could you post a link (preferable for Enterprise COBOL) to some doc?
Thanks,
d |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1001 Location: Virginia, USA
|
|
|
|
| If you remove the $ you can move a numeric editted item to a numeric item. Look at the allowable moves in the COBOL Language Reference. |
|
| Back to top |
|
 |
Robert Sample
Senior Member
Joined: 06 Jun 2008 Posts: 941 Location: Atlanta, GA
|
|
|
|
BIF DEEDIT is a CICS function; if the program the O/P is working on is batch (which hasn't been specified), it can't be used.
| Code: |
01 WS-DATA.
05 WS-DATA-X PIC X(10) VALUE '$1,250,000'.
05 WS-DATA-NE REDEFINES WS-DATA-X
PIC $$,$$$,$$9.
77 WS-DATA-VALUE PIC 9(07).
PROCEDURE DIVISION.
MOVE WS-DATA-NE TO WS-DATA-VALUE.
DISPLAY WS-DATA-NE.
DISPLAY WS-DATA-VALUE. |
produces output of
and appears to meet the requirement. |
|
| Back to top |
|
 |
Bill O'Boyle
Senior Member
Joined: 14 Jan 2008 Posts: 345 Location: Orlando, FL, USA
|
|
|
|
In his 1993 COBOL/370 Book, Harvey Bookman discussed DEEDIT. Basically, you can move an edited-field back to a display-numeric (packed-decimal, maybe) field and perhaps, it was introduced with COBOL/370, I can't recall.
I'm on the road and the book is at home.
But, that's the gist of it.
Bill |
|
| Back to top |
|
 |
Terry Heinze
Active User
Joined: 14 Jul 2008 Posts: 176 Location: Richfield, MN, USA
|
|
|
|
| What you want is the NUMVAL-C intrinsic function (see Language Reference Manual). |
|
| Back to top |
|
 |
|
|