Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us