|
From: Boris K. <bko...@ma...> - 2001-05-16 19:03:21
|
David,
The V specifies the implied decimal point and will not be printed. It is
used to determine decimal alignment for mathematical operations and MOVE
statements.
In order to get decimal points to print, you must define the element to be
DISPLAYed as a NUMERIC EDITED field. See in line changes below:
> -----Original Message-----
> From: David Billsbrough [mailto:kc...@ta....]
> Sent: Wednesday, May 16, 2001 2:46 PM
> To: Tiny-COBOL mail list
> Subject: [Tiny-cobol-users] Almost working with Red Hat Linux release
> 7.1 (Seawolf)
<snip>
>
>
> DATA DIVISION.
> File Section.
> FD employee-data Label Records are Standard.
> 01 employee-record.
> 05 employee-name-in PICTURE X(20).
> 05 hours-worked-in PICTURE 9(2).
> 05 hourly-rate-in PICTURE 9V99.
> FD payroll-listing Label Records are Omitted.
> 01 print-rec.
> 05 filler PICTURE X(21).
> 05 name-out PICTURE X(20).
> 05 filler PICTURE X(10).
> 05 hours-out PICTURE 9(2).
> 05 filler PICTURE X(8).
> 05 rate-out PICTURE 9V99.
> 05 filler PICTURE X(6).
> 05 weekly-wages-out PICTURE 999V99.
> Working-Storage Section.
> 01 are-there-more-records PICTURE XXX Value 'YES'.
01 WS-PRINT-REC.
... all but last line as in print-rec above ...
05 WS-WEEKLY-WAGES-OUT PIC 999.99.
...
PROCEDURE DIVISION.
...
COMPUTE weekly-wages-out ROUNDED = hours-worked-in * hourly-rate-in.
MOVE weekly-wages-out TO WS-WEEKLY-WAGES-OUT.
WRITE print-rec FROM WS-PRINT-REC.
...
<snip>
NOTE: The above is an example only. It is REALLY bad coding practice to
define the calculation field inside of the print record. Generally, I have
an area in WORKING-STORAGE where all the calculations are done. I also have
an area in WORKING-STORAGE where all the print information is formatted.
The print record associated with the FD for the output file only contains a
132 (or 80 or whatever is appropriate to your printer) character 01
definition and the writes are of the format illustrated above.
HTH
|