Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us