Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query realted to DB2 data type

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Query realted to DB2 data type
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    Post subject:
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

Active Member


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

PostPosted: Tue Mar 11, 2008 5:16 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us