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
 
Reading a file written using Edited Picture Clause

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

New User


Joined: 09 Jul 2007
Posts: 59
Location: Chennai

PostPosted: Tue Aug 07, 2007 5:05 pm    Post subject: Reading a file written using Edited Picture Clause
Reply with quote

A file contains the following data

F.Date T.Date CC Rate Amount Qty
05/25/06 03/18/07 1 -0.50 -4.90 1
04/15/06 03/18/07 1 -0.50 -5.57 1
11/14/05 03/18/07 1 -0.50 -8.08 1

I need to read this file. Actuallly I want to know how to read the Rate & Amount fields. S9(9)V9(2) variables are moved into -(8)9.9(2) variable are then written to this file. So now it is -(8)9.9(2) variable.

Can someone tell me what kind of variable shud i use in my progam to read this rate and amount in my program.

I need to read these values and reverse their sign and write it to another file.

Any pointers on the same would be really appreciated.
Back to top
View user's profile Send private message

ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Aug 07, 2007 7:04 pm    Post subject:
Reply with quote

Hi,
Read your fields in an alphanumeric declared variable and then convert them to numeric using COBOL function NUMVAL.

eg.

Code:

VARIABLE-A    PIC X(5) VALUE '-12.2'.
VARIABLE-B    PIC S9(2)V9.

MOVE FUNCTION NUMVAL(VARIABLE-A) TO VARIABLE-B


Actually I haven't tested above piece of code.
But you can go ahead and let us know if it works.

--Parag
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 To remove spaces from a VB file using... Selvarajars DFSORT/ICETOOL 5 Thu Jun 21, 2018 6:57 pm
No new posts B059 PREMATURE END OF FILE mvmadhuvenkatesh CA Products 5 Tue Jun 19, 2018 10:50 am
No new posts Formating output file Niki DFSORT/ICETOOL 3 Fri Jun 15, 2018 3:27 pm
No new posts Need help on TDQ load from file using... subratarec CICS 4 Wed Jun 13, 2018 11:32 pm
No new posts Reformat clause in joinkeys sortcard ... Mounika Nemani DFSORT/ICETOOL 2 Thu May 31, 2018 5:35 pm

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