View previous topic :: View next topic
|
Author |
Message |
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
Hi all,
Please look at the below code,
Code: |
01 WS-SS-TYPE PIC S999 COMP VALUE +110.
01 WS-SST-REDEF REDEFINES WS-SS-TYPE.
05 FILLER PIC X.
05 WS-STOP-START-TYPE PIC X.
|
What will be the value of 'WS-STOP-START-TYPE'?? and please explain how is it happening?
Please help. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Here's how to find out.
1. Create a one record file with WS-SS-TYPE as you have defined it.
2. Browse/view/edit it.
3. Use the HEX ON primary command to see the hex value of each byte.
4. Let us know what you see, preferably by using the code tag as you have done. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you review the EBCDIC collating sequence (hint: Google is your friend), you will find that X'6E' is a greater than (>) sign. If you display WS-STOP-START-TYPE you will see the > sign. WS-SS-TYPE has the value X'006E' (6 times 16 is 96 + 14 is 110) so the second byte will be X'6E'. |
|
Back to top |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
Robert,
Thank you so much for the help.
This is the answer i wanted.
X'006E', so the first two bytes('00' of 006E) goes to the filler and the '6E' goes to ws-stop-start type.
Phil,
Thanks for the effort & time.
Now i understand how to get these. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Since you're using COMP (pure binary), try the windows calculator in scientific mode - type in decimal, switch to HEX. |
|
Back to top |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
you are right Phil,
I have used scientific calculator and is working fine. |
|
Back to top |
|
|
|