MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PICTURE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Fri Jan 02, 2004 5:35 am    Post subject: PICTURE Reply with quote

Hi,

If I give S9(4), does it occupy one extra byte for the sign?
_________________
Cheers!
Back to top
View user's profile Send private message
RobertL
Beginner


Joined: 18 Nov 2003
Posts: 22
Topics: 0
Location: Lisbon, Portugal

PostPosted: Fri Jan 02, 2004 7:42 am    Post subject: Reply with quote

Hi abracadabra,
No. Assuming that this is a USAGE DISPLAY item, the sign occupies the hi order nibble of the low order byte as follows:

F1F2F3F4 Unsigned number
F1F2F3C4 Positive number
F1F2F3D4 Negative number

Unless, that is, you specify SIGN IS SEPARATE. In this case an additional byte is used, either LEADING or TRAILING, to hold the sign (i.e. + or -).

Additional information can be found in http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGYLR205/CCONTENTS?SHELF=IGYSH211&DN=SC26-9046-04&DT=20000927030801

Hope this helps.
Regards,
Robert
Back to top
View user's profile Send private message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Sat Jan 03, 2004 12:25 am    Post subject: Reply with quote

Robert,

Does this mean the in PIC S9(4), i can only insert 3 digits?
_________________
Cheers!
Back to top
View user's profile Send private message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Sun Jan 04, 2004 6:50 am    Post subject: Reply with quote

abracadabra,

You can store values from -9999 to +9999 in PIC S9(4).

First 4 bits of last byte, will represent the sign.

Thanks,
Ravikumar.
Back to top
View user's profile Send private message
RobertL
Beginner


Joined: 18 Nov 2003
Posts: 22
Topics: 0
Location: Lisbon, Portugal

PostPosted: Tue Jan 06, 2004 7:14 am    Post subject: Reply with quote

Hi abracadabra,
Believe it or not, sometimes you can even store 5 digits in a PIC 9(4) field when USAGE IS BINARY, COMP, COMP-4, or COMP-5. Cobol treats these a strictly binary fields and truncates based on halfword capacity instead of picture clause length. These fields take up 2 bytes (one halfword) and have a maximum value of:
Code:

PIC 9(4) COMP  -- value range 0-65535
PIC S9(4) COMP -- value range -32768 through +32767

Hope this helps,
Regards,
Robert
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group