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(8) COMP to S9(4) COMP

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

New User


Joined: 03 Feb 2006
Posts: 25
Location: Calgary, AB

PostPosted: Fri Feb 03, 2006 3:34 am    Post subject: S9(8) COMP to S9(4) COMP
Reply with quote

Could any one please let me know "What happens to the value in S9(8) when it is moved to S9(4)". Any feedback is greatly appreciated.

For example, if I have 67229 in S9(8) COMP what will the value be when it is moved to S9(4) COMP?
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Feb 03, 2006 4:45 am    Post subject: Re: S9(8) COMP to S9(4) COMP
Reply with quote

Neerajpeddu,

As you know a ?COMP? field is a binary field. The ?S9(8) COMP? occupies 4 bytes and the ?S9(4) COMP? occupies 2 bytes.

The hex value of 67229 in the ?S9(8) COMP? field is x?0001069d?. When you move it to a ?S9(4) COMP? field, the move will truncate the high order bytes beyond the two bytes the ?S9(4) COMP? field occupies, leaving a hex value in the ?S9(4) COMP? field of x?069d? which = decimal 1693.

So, the answer is, when you move decimal value 67229 from a ?S9(8) COMP? field to a ?S9(4) COMP? field you get a decimal 1693.

If this is unclear please come back,

Dave
Back to top
View user's profile Send private message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 25
Location: Calgary, AB

PostPosted: Fri Feb 03, 2006 4:48 am    Post subject:
Reply with quote

Excellent!! Thank you very much David. I was getting that figure but was not able to figure out how and why. this explains it all. Thanks for your help.
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 COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
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 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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm

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