Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COMP-3 field to report

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've got a signed packed decimal field defined as
S9(3)V9(2) COMP-3. How can I print this field on a report? Can I give it a positive or negative sign??
 
This code:
WORKING-STORAGE SECTION.
01 field-in-1 PIC S9(3)V9(2) COMP-3 VALUE -12.45.
01 field-in-2 PIC S9(3)V9(2) COMP-3 VALUE 12.45.
01 field-out PIC -(3).9(2).

PROCEDURE DIVISION.
1000-start.
MOVE field-in-1 TO field-out
DISPLAY field-out
MOVE field-in-2 TO field-out
DISPLAY field-out
STOP RUN.

Produces:
-12.45
12.45
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top