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: 2238
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
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


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