IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Max no. in 9(4) COMP


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mfhelp
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 33

PostPosted: Tue Apr 01, 2008 3:37 pm
Reply with quote

In one of the interview, question asked was
"What is the Max no. that can be stored in 9(4) COMP variable"
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Apr 01, 2008 3:49 pm
Reply with quote

Hi !

had you searched the forum. Disscussed so many times that i can't count anymore.

regards, UmeySan
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Tue Apr 01, 2008 3:50 pm
Reply with quote

It depends on the compiler, but remember that a pic 9(4) comp field is usually a 16 bit integer and you can only store +-32667 in a signed 16 bit integer or +65535 in an unsigned 16 bit integer. You will be limited by the data format even if the compiler allows you store five digits.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top