View previous topic :: View next topic
|
Author |
Message |
usharaniA
New User
Joined: 22 Jan 2008 Posts: 85 Location: India
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
You might want to try dividing the number by 1000 before you MOVE to 9.99 |
|
Back to top |
|
|
replytovishu
New User
Joined: 09 Dec 2008 Posts: 23 Location: india
|
|
|
|
You want to write it in a file or what... |
|
Back to top |
|
|
usharaniA
New User
Joined: 22 Jan 2008 Posts: 85 Location: India
|
|
|
|
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 |
|
|
usharaniA
New User
Joined: 22 Jan 2008 Posts: 85 Location: India
|
|
|
|
yes i want to write into a flat file |
|
Back to top |
|
|
replytovishu
New User
Joined: 09 Dec 2008 Posts: 23 Location: india
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
|