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
 
REDEFINES (Numeric to Alpha) - REG

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Oct 18, 2010 6:34 pm    Post subject: REDEFINES (Numeric to Alpha) - REG
Reply with quote

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

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 967
Location: Richmond, Virginia

PostPosted: Mon Oct 18, 2010 6:37 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8200
Location: East Dubuque, Illinois, USA

PostPosted: Mon Oct 18, 2010 6:41 pm    Post subject:
Reply with quote

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

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Oct 18, 2010 6:51 pm    Post subject:
Reply with quote

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

Active Member


Joined: 31 Oct 2006
Posts: 967
Location: Richmond, Virginia

PostPosted: Mon Oct 18, 2010 6:55 pm    Post subject:
Reply with quote

Since you're using COMP (pure binary), try the windows calculator in scientific mode - type in decimal, switch to HEX.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Oct 18, 2010 7:00 pm    Post subject:
Reply with quote

you are right Phil,
I have used scientific calculator and is working fine.
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm

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