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
 
S9 COMP-3 and S9(5) displaying the same output in the spool!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
HARLEEN SINGH MANN
Warnings : 2

New User


Joined: 03 Aug 2007
Posts: 17
Location: Pune

PostPosted: Fri Oct 19, 2007 6:31 pm    Post subject: S9 COMP-3 and S9(5) displaying the same output in the spool!
Reply with quote

my code is as follows:
-------------------------------------------------------------------------------
01 WW-1 PIC S9(5) USAGE IS COMP-3.
01 WW-2 PIC S9(5).
PROCEDURE DIVISION.
MOVE -123450 TO WW-1 WW-2
DISPLAY WW-1 WW-2
STOP RUN.
---------------------------------------------------------------------------
My confusion is that the display in the spool shows the same output for both.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 19, 2007 7:15 pm    Post subject:
Reply with quote

Hello,

Yes, that is what it should do. . .

The values are stored differently internally, but when displayed, they should show the same value.
Back to top
View user's profile Send private message
HARLEEN SINGH MANN
Warnings : 2

New User


Joined: 03 Aug 2007
Posts: 17
Location: Pune

PostPosted: Fri Oct 19, 2007 10:54 pm    Post subject: Reply to: S9 COMP-3 and S9(5) displaying the same output in
Reply with quote

Okay. take ur word on that. but tel me somethin: how can i see how the two fields are stored internally? should i write a file and see it in the file?


Also,

the value eg. MOVE -11110 TO WW-<COMP3VAR>
shows in SYSOUT after "hex on" as :-
FFFFD
11110

can you explain this please?

I know that D is for -ve but shouldn't it be D in the final nibble?
I am confused with that "hex on" feature.
can u or anyone throw some light.

thnks a lot
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 19, 2007 11:17 pm    Post subject:
Reply with quote

Hello,

Quote:
how can i see how the two fields are stored internally? should i write a file and see it in the file?
Yes, if you write these into a file, you can then browse the file with HEX ON and see how they are stored internally.

Quote:
the value eg. MOVE -11110 TO WW-<COMP3VAR>
shows in SYSOUT after "hex on" as :-
FFFFD
11110
I'd suggest you write this field to the same field as the one mentioned above. If the field is defined as comp-3, yes, the D will be in the low-order nibble. If the field is s9(5) only, it will have the D in the high-order nibble of the low-order byte.

It will be well demonstrated if you define multiple fields in the same record (of different types) and look at all of them together in the same record with HEX ON.

HEX on works better when browsing a dataset - i don't use HEX ON in sysout.
Back to top
View user's profile Send private message
HARLEEN SINGH MANN
Warnings : 2

New User


Joined: 03 Aug 2007
Posts: 17
Location: Pune

PostPosted: Fri Oct 19, 2007 11:29 pm    Post subject:
Reply with quote

Ohhh. i am understanding now. I dont have mainframe access right now(Iam at home) but will see these after writing them into a file.

And for your info if u r not aware we can open the SYSOUT in SE mode instead of simply S to view it in editor mode. where we can use hex on.

One last question. How do i compile my codes like the one i want to now (writing into a file to see the diff) at home? is there a mainframe emulator/simulator available? how do i compile n run codes on my PC?

Thanks and regards,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 19, 2007 11:58 pm    Post subject:
Reply with quote

Hello,

I'd suggest you talk with your system support or networking people and have them tell what you need to connect to your mainframe from outside your workplace. You will probably need a 3270-emulator to run on your pc and you should be able to connect to the mainframe from your internet connection.

They should be able to tell you where to download the emulator they prefer to support and how to configure it.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 21, 2007 10:09 pm    Post subject:
Reply with quote

Hi Harleen,

Another way to do it is to redefine the fields as PIC x and DISPLAY the PIC x names, not the numeric names. As I recall, because they are defined as A/N no data conversion is performed before DISPLAYing the data.

You'll still have to use HEX ON to view them in SYSOUT.
Back to top
View user's profile Send private message
HARLEEN SINGH MANN
Warnings : 2

New User


Joined: 03 Aug 2007
Posts: 17
Location: Pune

PostPosted: Mon Oct 22, 2007 12:52 am    Post subject: Reply to: S9 COMP-3 and S9(5) displaying the same output in
Reply with quote

that a good advice i must say. i l try the moving the two fields to PIC X() and get back to u here.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Oct 22, 2007 3:17 am    Post subject: Re: Reply to: S9 COMP-3 and S9(5) displaying the same output
Reply with quote

HARLEEN SINGH MANN wrote:
that a good advice i must say. i l try the moving the two fields to PIC X() and get back to u here.


No, redefine the comp-3 as a pic x( ) and display the pic x field.
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm

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