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

what is SMALLINT datatype in the DB2???


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dhavalev

New User


Joined: 24 Jan 2006
Posts: 2
Location: pune

PostPosted: Mon Feb 20, 2006 3:06 pm
Reply with quote

hi ...
I want to ask how much digit can it store in the SMALLINT datatype of the Db2...
I know that SMALLINT - pic s9(4) comp or COMP4
----------------------------------------------------------
suppose if we declare
I_MOD_YR SMALLINT
then can I_MOD_YR - can have value
'9999'
or '99999'
or '-99999'
or any one of the above

just clarify my doubt ????
because in my case I_MOD_YR is storing '99999' and '-99999'
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Feb 20, 2006 3:16 pm
Reply with quote

From the fine manual:
Quote:
A small integer is a System/390 binary integer with a precision of 15 bits. The range of small integers is -32768 to +32767.


O.
Back to top
View user's profile Send private message
dhavalev

New User


Joined: 24 Jan 2006
Posts: 2
Location: pune

PostPosted: Tue Feb 21, 2006 9:36 am
Reply with quote

I know that SMALLINT - pic s9(4) comp or COMP4
----------------------------------------------------------
suppose if we declare
I_MOD_YR SMALLINT
then can I_MOD_YR - can have value
'9999'
or '99999'
or '-99999'
or any one of the above

just clarify my doubt ????
because in my case I_MOD_YR is storing '99999' and '-99999'
Back to top
View user's profile Send private message
pnambiar

New User


Joined: 24 Feb 2006
Posts: 3

PostPosted: Sat Feb 25, 2006 12:11 am
Reply with quote

Check your compile options, TRUNC(BIN) option will cause s9(4) comp to store values between -32768 to +32767.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Select numeric portion from CHAR data... DB2 6
No new posts Loading data to table gives wrong for... DB2 19
No new posts Moving character data to smallint in db2 DB2 5
No new posts Converting Datatype while adding the ... DFSORT/ICETOOL 6
No new posts query in unloading a column defined a... DB2 8
Search our Forums:

Back to Top