| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| abracadabra Beginner
 
 
 Joined: 02 Sep 2003
 Posts: 101
 Topics: 55
 Location: India
 
 | 
			
				|  Posted: Fri Jan 02, 2004 5:35 am    Post subject: PICTURE |   |  
				| 
 |  
				| Hi, 
 If I give S9(4), does it occupy one extra byte for the sign?
 _________________
 Cheers!
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| RobertL Beginner
 
  
 Joined: 18 Nov 2003
 Posts: 22
 Topics: 0
 Location: Lisbon, Portugal
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| abracadabra Beginner
 
 
 Joined: 02 Sep 2003
 Posts: 101
 Topics: 55
 Location: India
 
 | 
			
				|  Posted: Sat Jan 03, 2004 12:25 am    Post subject: |   |  
				| 
 |  
				| Robert, 
 Does this mean the in PIC S9(4), i can only insert 3 digits?
 _________________
 Cheers!
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ravikumar_sri2001 Beginner
 
  
 Joined: 06 Dec 2002
 Posts: 117
 Topics: 44
 Location: Chennai,India
 
 | 
			
				|  Posted: Sun Jan 04, 2004 6:50 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| RobertL Beginner
 
  
 Joined: 18 Nov 2003
 Posts: 22
 Topics: 0
 Location: Lisbon, Portugal
 
 | 
			
				|  Posted: Tue Jan 06, 2004 7:14 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		|  | 
	
		|  |