Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to read data which is having editing characters?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
keane

New User


Joined: 24 Jul 2006
Posts: 11

PostPosted: Fri Jul 25, 2008 2:42 pm    Post subject: How to read data which is having editing characters?
Reply with quote

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
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Jul 25, 2008 3:57 pm    Post subject: Re: How to read data which is having editing characters?
Reply with quote

In the applicable COBOL manual, review the concept of DEEDIT.

Bill
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Jul 25, 2008 8:41 pm    Post subject: Reply to: How to read data which is having editing character
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jul 25, 2008 8:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 25, 2008 9:25 pm    Post subject:
Reply with quote

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
Code:
 $1,250,000
 1250000
and appears to meet the requirement.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Sat Jul 26, 2008 3:26 am    Post subject: Re: How to read data which is having editing characters?
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Jul 26, 2008 4:21 am    Post subject:
Reply with quote

What you want is the NUMVAL-C intrinsic function (see Language Reference Manual).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us