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
 

 

Field Format in Cobol

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

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Tue Jun 09, 2009 12:00 pm    Post subject: Field Format in Cobol
Reply with quote

Hi,
I'm reading a records and moving into the 01 level of the copybook.
I have
Code:
01  DB-BREAK-POINT-RECORD.
           05  BRPT-CONC-PCNT-NO-1           PIC 9V99  VALUE ZEROES.


I want to write the records with decimal notations.
For eg.if i move 1500 this should be written as 1.50.
But it is written as 1500.
So i changed the PIC values as 9.99 but still the same 1500 is written.
Help me to solve this.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2276
Location: @my desk

PostPosted: Tue Jun 09, 2009 12:06 pm    Post subject:
Reply with quote

Hello,

You might want to try dividing the number by 1000 before you MOVE to 9.99
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Tue Jun 09, 2009 12:07 pm    Post subject:
Reply with quote

You want to write it in a file or what...
Back to top
View user's profile Send private message
usharaniA

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Tue Jun 09, 2009 12:08 pm    Post subject:
Reply with quote

if suppose i dont know about the copy book structure and knows oly the Copy book name. how do i implement it.
Back to top
View user's profile Send private message
usharaniA

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Tue Jun 09, 2009 12:08 pm    Post subject:
Reply with quote

yes i want to write into a flat file
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Tue Jun 09, 2009 12:28 pm    Post subject:
Reply with quote

I would suggest you following.

try declaring another variable with pic 9.99 lets suppose ws-var1
move your variable to ws-var1 and write ws-var1 to flat file.

-Vishal
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jun 10, 2009 12:44 pm    Post subject:
Reply with quote

Show the actual code you used.

ILE COBOL Language Reference.

Examples of floating insertion editing:
Code:

   PICTURE               Value of Data        Edited Result
        $$$$.99                 .123               $.12
        $$$9.99                 .12               $0.12
   $,$$$,999.99            -1234.56           $1,234.56
   U,UUU,UU9.99-           -1234.56         EUR1,234.56-
   u,uuu,uu9.99             1234.56         USD1,234.56
   +,+++,999.99          -123456.789        -123,456.78
  $$,$$$,$$$.99CR       -1234567          $1,234,567.00CR
  ++,+++,+++.+++            0000.00
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. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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