View previous topic :: View next topic
|
Author |
Message |
jsnair
New User
Joined: 26 Sep 2006 Posts: 38 Location: India
|
|
|
|
Hello All,
COMP-3 will always throw some confusion. My understanding was that we can not display the COMP-3 values directly. Even we can see so many documents says different methods to dispaly a comp-3 value. But I tried to execute below code and I was able to print the values directly in spool. Please look in to the piece of code mentioned below.
So this means we can print COMP-3 values in to spool directly?.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. CHECK1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 REC1.
10 WS-COMP PIC 9(3) COMP-3.
01 WS-VAL PIC 9(3) COMP-3 VALUE 123.
PROCEDURE DIVISION.
INITIALIZE REC1.
MOVE 879 TO WS-COMP.
DISPLAY 'WS-VAL : ' WS-VAL.
DISPLAY 'WS-COMP : ' WS-COMP.
STOP RUN. |
Spool Output:-
Code: |
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
WS-VAL : 123
WS-COMP : 879
******************************** BOTTOM OF DATA ******************************** |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
So this means we can print COMP-3 values in to spool directly?. |
There's never been an issue with them -- neither unsigned (like yours) nor signed. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
My understanding was that we can not display the COMP-3 values directly. |
Where did this "understanding" originate?
Suggest whoever/whatever was the source of this, you be careful of anything else learned there - it may be similarly flawed. . . |
|
Back to top |
|
|
|