IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can we see the comp 3 values in SPOOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Mon Sep 25, 2006 10:06 am
Reply with quote

Hi All,

How can we see the Comp3 values in SPOOL? Could you please let me know the same?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Sep 25, 2006 10:25 am
Reply with quote

Husna,

U can display the comp3 value & then put hex on iy will give u the value

Correction r welcome.
Back to top
View user's profile Send private message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Mon Sep 25, 2006 11:27 am
Reply with quote

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
View user's profile Send private message
Rupa.P.V
Warnings : 1

New User


Joined: 04 Jul 2006
Posts: 30

PostPosted: Mon Sep 25, 2006 2:12 pm
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Sep 25, 2006 4:33 pm
Reply with quote

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
View user's profile Send private message
rocksolid

New User


Joined: 29 Aug 2006
Posts: 21
Location: India

PostPosted: Mon Sep 25, 2006 6:21 pm
Reply with quote

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? icon_confused.gif
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Mon Sep 25, 2006 10:11 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Mon Sep 25, 2006 10:57 pm
Reply with quote

If you want to see in SDSF, don't use hex command, as said, but SET HEX ON
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Sep 26, 2006 11:22 am
Reply with quote

Hi Husna,

I think it is clear now.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Sep 26, 2006 11:40 am
Reply with quote

hi Husna,
The easiest way is to move the Comp value into an Display variable and display it.

~Vamsi
Back to top
View user's profile Send private message
rocksolid

New User


Joined: 29 Aug 2006
Posts: 21
Location: India

PostPosted: Tue Sep 26, 2006 12:13 pm
Reply with quote

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
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Tue Sep 26, 2006 10:01 pm
Reply with quote

In spool you use SET HEX ON to check in hexadecimal
Back to top
View user's profile Send private message
rocksolid

New User


Joined: 29 Aug 2006
Posts: 21
Location: India

PostPosted: Wed Sep 27, 2006 12:00 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Wed Sep 27, 2006 11:53 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top