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

DB2 - Values truncated during


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

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Sat Apr 16, 2011 11:31 am
Reply with quote

Hi,

We have a DB2 table with 3 fields and below is the DCLGEN structure.

DCLGEN
----------
EXEC SQL DECLARE TABLE1
(COL_A CHAR(10)
COL_B CHAR(10)
COL_C CHAR(10))
END-EXEC
01 WS-TABLE1.
05 WS-COL-A PIC X(10)
05 WS-COL-B PIC X(10)
05 WS-COL-C PIC X(10)

We have programs with below select queries in the system.
SELECT COLA,COLB,COLC FROM TABLE1

We are going to increase the size of COL-B to 15 bytes. But we are not planning to change the SQL Queries in the system.

Would someone able to tell me whether is there any impact in below existing query in the system?

SELECT COL_A,COLB,COLC FROM TABLE1

my understanding is the value of the fields from 11 to 15 position will be truncated and the system will return SQL code '000' with some value in null indicators..

Would someone able to provide additional information on this?

Thanks,
Nagu
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 16, 2011 12:04 pm
Reply with quote

simplest and quickest way to find out - try it. Why are you coding like that? Surely you should be using the copybook created by the dclgen process.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Apr 16, 2011 12:37 pm
Reply with quote

did anybody in Your organization ever hear of impact analysis ? icon_evil.gif
Yours/Your organization's plans,desires are completely irrelevant for the correctness of the results!

in other words the correctness of the results should be the driving concern for Your plans
not the other way around, make plans and hope for correct results !


Quote:
Surely you should be using the copybook created by the dclgen process.


we hope so icon_biggrin.gif
and then be satisfied that the outputs will be truncated
too much carelessness on the TS organization side

what happened when You compiled tested a program with the changed table ?
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts first column truncated in search result IBM Tools 13
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
Search our Forums:

Back to Top