Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can we see the comp 3 values in SPOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How can we see the comp 3 values in SPOOL
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: 1187
Location: Bangalore,India

PostPosted: Mon Sep 25, 2006 10:25 am    Post subject:
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    Post subject:
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    Post subject: Re: How can we see the comp3 (or Comp) values in SPOOL?
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: 757
Location: Germany

PostPosted: Mon Sep 25, 2006 4:33 pm    Post subject:
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    Post subject:
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    Post subject: Re: How can we see the comp3 (or Comp) values in SPOOL?
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: 456
Location: Belgium

PostPosted: Mon Sep 25, 2006 10:57 pm    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Tue Sep 26, 2006 11:22 am    Post subject:
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    Post subject:
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    Post subject: Re: How can we see the comp3 (or Comp) values in SPOOL?
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    Post subject: Re: How can we see the comp3 (or Comp) values in SPOOL?
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    Post subject:
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: 456
Location: Belgium

PostPosted: Wed Sep 27, 2006 11:53 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us