View previous topic :: View next topic
|
Author |
Message |
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Hi All,
How can we see the Comp3 values in SPOOL? Could you please let me know the same? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Husna,
U can display the comp3 value & then put hex on iy will give u the value
Correction r welcome. |
|
Back to top |
|
|
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Guptae,
I hope Display statement's are not used for COMP3?
If possible, will you please give me some practical example for the same? |
|
Back to top |
|
|
Rupa.P.V Warnings : 1 New User
Joined: 04 Jul 2006 Posts: 30
|
|
|
|
Hi all,
Yuu can Move the Comp value to a Normal Varaible(Declared without COMP) .And display the second Variable .
I think we cannot dispaly COMP variable.
Corect me if i am wrong.
Thanks |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
I think guptae ment, that you use the display comand in the pgm with
the comp variable to send data to sysout. Then, after programm-run
lookink in the sysout dataset and usin hex on command to see the original
hex string.
The same I often do in my Assembler programms for quick and dirty testing and displaying some critical variables.
Regards, UmeySan |
|
Back to top |
|
|
rocksolid
New User
Joined: 29 Aug 2006 Posts: 21 Location: India
|
|
|
|
Hi,
I executed a small program to display comp-3 value. Surprisingly I was able to display it. I am giving my cobol and JCL below.
Cobol :
IDENTIFICATION DIVISION.
PROGRAM-ID. COMP3TST.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-INPUT.
05 VAR-A PIC 9(03) VALUE 9.
05 VAR-B PIC 9(03) VALUE 3.
01 WS-OUTPUT.
05 VAR-C PIC 9(04) COMP-3.
PROCEDURE DIVISION.
ADD VAR-A, VAR-B TO VAR-C
DISPLAY 'RESULT : ' VAR-C
GOBACK.
My JCL:
//SNMS507C JOB 55029050,'CLAIMS ',REGION=4M,CLASS=C,
// MSGCLASS=Z,NOTIFY=&SYSUID
//*
//STEP01 EXEC PGM=COMP3TST
//STEPLIB DD DSN=S00P.CHGMAND.GNSP.#000361.LDB,DISP=SHR
//SYSOUT DD SYSOUT=*
SYSOUT:
******************************** Top of Data ***********************************
RESULT : 0012
******************************* Bottom of Data ********************************
I also tried with 2 input comp-3 values and got the same result.
I am confused. When we can't display comp-3 values? |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
You can see the COMP-3 as it is until it is negative
for example if VAR-A is defined as COMP-3
if you display it it will be shown as it is until it is positive. If you get a negative onto it it will be in a Alpha and numeric characters.
To avoid confusion we generally move it to a display variable and dispaly the same |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
If you want to see in SDSF, don't use hex command, as said, but SET HEX ON |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Husna,
I think it is clear now. |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi Husna,
The easiest way is to move the Comp value into an Display variable and display it.
~Vamsi |
|
Back to top |
|
|
rocksolid
New User
Joined: 29 Aug 2006 Posts: 21 Location: India
|
|
|
|
Hi KG,
yes when it is negative, it is showing in alphabatics....
Hi Vamsi,
I defined VAR-A and VAR-B as comp-3 variables and result field(VAR-C) as normal variable(Display usage).
But it is not giving exact value.
In above example, I took the values like
VAR-A is -3
VAR-B is -6
then SUBTRACT VAR-A FROM VAR-B GIVING VAR-C
Now display Values are:
VAR-A : 00L
VAR-B : 00O
RESULT : 000L
Even I give HEX ON in SPOOL, I was not able to see the exact values.
How we can? |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
In spool you use SET HEX ON to check in hexadecimal |
|
Back to top |
|
|
rocksolid
New User
Joined: 29 Aug 2006 Posts: 21 Location: India
|
|
|
|
Hi KG,
SET HEX ON command is not working.
But when I give HEX ON, I am getting something in different way.
In SPOOL, before HEX ON :(VAR-A = -143, VAR-B = -132, Result = -275)
VAR-A : 0014L
VAR-B : 0013K
RESULT : 27N
After giving HEX ON:
VAR-A : 0014L
ECD6C4474FFFFD444444444444444444444444444444444444444444444444444444444444444444
5190100A000143000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
VAR-B : 0013K
ECD6C4474FFFFD444444444444444444444444444444444444444444444444444444444444444444
5190200A000132000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
RESULT : 27N
DCEEDE474FFD44444444444444444444444444444444444444444444444444444444444444444444
9524330A027500000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
Highlighted one's are the values.
is this the way we get?
Thank you, |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Code: |
= -143, VAR-B = -132, Result = -275) |
-3 in HEX = 3D and displayed as D3 = L
-2 in HEX = 2D and displayed as D2 = K
-5 in HEX = 5D and displayed as D5 = N
Meaning : wrong conversion. |
|
Back to top |
|
|
|