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

Query realted to DB2 data type


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

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Tue Mar 11, 2008 11:43 am
Reply with quote

Hi,

I am working on DB2 V7.
I created a table with field Num1 of type INT and i generated copy book for this table. In copy book, for filed Num1 it is S9(9) comp.
But i need s9(10). Can i update only copy book from s9(9) comp to s9(10) comp? Will it effect storing of values in Database?

What is equivalent type in DB2 V7 for s9(10) comp (or) s9(11) comp.
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Tue Mar 11, 2008 2:05 pm
Reply with quote

What icon_question.gif Changing in the copybook and will change in the DB. icon_question.gif

Have u understood the DB concepts..plz go through it??
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Mar 11, 2008 5:16 pm
Reply with quote

Do you think you know more than DB2 about what field types correspond to DB2's data types?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Mar 11, 2008 5:38 pm
Reply with quote

The range of large integers is -2147483648 to +2147483647. If your COBOL programs can handle the full range will depend on the version of cobol and your compile options. If you change the picture to s9(10) you will have problems with DB2!
Back to top
View user's profile Send private message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Tue Mar 11, 2008 5:57 pm
Reply with quote

Hi,

i think no one understood my query. i wil be more clear now.

I am having a situation in which my DB2 table filed type is INT and its corresponding copy book field is S9(9) comp. Means i can store value upto 2147483647 i.e 10 digits. But now i want to store value upto 11 digits.

In DB2 V9 BIGINT data type is there but it is not there in DB V7.
So how i can store value upto 11 digits in DB2 V7?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Mar 11, 2008 6:01 pm
Reply with quote

Kiranmayee wrote:
Hi,

i think no one understood my query. i wil be more clear now.

I am having a situation in which my DB2 table filed type is INT and its corresponding copy book field is S9(9) comp. Means i can store value upto 2147483647 i.e 10 digits. But now i want to store value upto 11 digits.

In DB2 V9 BIGINT data type is there but it is not there in DB V7.
So how i can store value upto 11 digits in DB2 V7?


No one understood you question because you didn't ask about storing 11 digits! DB2 v7 does have the option for an 11 digit integer! You could define it as dec(11,0).
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Tue Mar 11, 2008 6:29 pm
Reply with quote

We cannot store 11 bytes in an Integer variable. In this case you have to define the database column as Decimal which can hold up to 18 bytes but occupy only 10 bytes of memory.

The DCLGEN variable for the Decimal column will be S9(18) Comp-3.
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top