IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reading a file written using Edited Picture Clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top