View previous topic :: View next topic
|
Author |
Message |
HARLEEN SINGH MANN Warnings : 2 New User
Joined: 03 Aug 2007 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
HARLEEN SINGH MANN Warnings : 2 New User
Joined: 03 Aug 2007 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
HARLEEN SINGH MANN Warnings : 2 New User
Joined: 03 Aug 2007 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
HARLEEN SINGH MANN Warnings : 2 New User
Joined: 03 Aug 2007 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
|