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
 

 

What is the difference between 9(04) and S9(04) ?

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

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Jul 03, 2013 12:44 pm    Post subject: What is the difference between 9(04) and S9(04) ?
Reply with quote

Since both 9(04) and S9(04) can store upto 4 bytes. Then what is the difference and please explain with an example.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Jul 03, 2013 12:55 pm    Post subject:
Reply with quote

9(04) value could range from 0 - 9999
S9(04) value could range from -9999 TO +9999
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Wed Jul 03, 2013 12:56 pm    Post subject: Reply to: What is the difference between 9(04) and S9(04) ?
Reply with quote

Find out from the manuals what S means in a COBOL PICture. Then find out, from the same manuals, how the data is stored and how the values associated with the S are represented.

If still unclear, you provide the examples: what you've done, and what you understood, the input values you used, the output you got, and the output you had expected to get.

I could just give you an answer, but that way you won't actually learn anything. This way you'll pick up lots that you will find invaluable (what does my PICture "look" like in storage?).
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Jul 03, 2013 12:57 pm    Post subject:
Reply with quote

Quote:

S9(04) value could range from -9999 TO +9999


Where the sign byte willl be stored since we have only 4 bytes
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Jul 03, 2013 3:04 pm    Post subject:
Reply with quote

Gopalakrishnan V wrote:
Quote:

S9(04) value could range from -9999 TO +9999


Where the sign byte willl be stored since we have only 4 bytes

There is never a sign byte; depending on the USAGE clause, there may be a sign bit, a sign nybble, or several sign nybbles. RTFM (Principles of Operation is more comprehensive than the Enterprise COBOL reference) to find out which is applicable in your case.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jul 03, 2013 8:48 pm    Post subject:
Reply with quote

Hello,

In a little test program define 2 variables with both PICtures.

Initialize them with a value of 1234.
Multiply one of them by -1
DISPLAY both fields.
Look a these fields in hex and notice the difference.

If you still have doubts, post your hex values and someone here will be able to exdplain.
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 Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts Difference Between CICS WebSupport an... sachinji84 CICS 1 Mon Mar 07, 2016 7:25 pm
No new posts Difference between -180 and -181 with... deepak_shrivastava DB2 4 Wed Jan 06, 2016 10:00 am
No new posts Difference between COBOL for MAINFRAM... dejunzhu COBOL Programming 1 Sat Oct 31, 2015 2:18 pm


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