Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to insert data in VARCHAR(32000) column of DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
dilpreet

New User


Joined: 18 Mar 2008
Posts: 34
Location: INDIA

PostPosted: Tue May 13, 2014 9:07 am    Post subject: How to insert data in VARCHAR(32000) column of DB2
Reply with quote

Hi I have a column defined in DB2 table as

Code:
STPAP-DATA-AREA.       
49 STPAP-DATA-AREA-LEN
   PIC S9(4) USAGE COMP
49 STPAP-DATA-AREA-TEXT
   PIC X(32652).     


When I try inserting through a query , Data gets truncated and maximum length of data its inserting is of 6448 bytes. Please suggest how can I pass higher length data to this field.

Code'd
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue May 13, 2014 11:30 am    Post subject: Reply to: How to insert data in VARCHAR(32000) column of DB2
Reply with quote

PIC 9(4) COMP can hold a maximum value of 9999 due to "decimal truncation" for COMP/COMP-4/BINARY fields.

PIC 9(4) COMP-5 can hold a maximum value of 64k-1 due to "binary truncation" (truncation to field size) for COMP-5 fields.

All USAGE COMP/COMP-4/BINARY fields can be automatically changed to COMP-5 without further coding by specifying compiler option TRUNC(BIN), but you definitely don't want to do that due to the need to re-test everything.

So, change you definition from COMP to COMP-5 and you should be good-to-go.

Remember decimal vs binary truncation always. If your field-size is limited (you can't make it bigger, because it is someone else's definition) and you need more than the PICture number of digits, make it COMP-5.

So, make it COMP-5.
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us