Page 1 of 2

Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 1:54 am
by coldplay1991
Hi, I am loading a message from a source file and while load it (using DB2 LOAD) to a new table, the new column can not fully show it even though the character limit is very high. Also, is there any ideal SQL data choice and modifier to LOAD the long message output properly into the new table column(my target location). I dont want it to overflow to 2 lines and not show half or broken either.

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 3:34 am
by dick scherrer
Hello,

I am loading a message from a source file and while load it (using DB2 LOAD) to a new table, the new column can not fully show it even though the character limit is very high.
Why not :?
If the column is defined as "n" nytes, "n" bytes should work just fine.

You may need to consider reformatting the input data to conform to the rules (which have not been posted).

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 12:56 pm
by coldplay1991
I cant change input data dude. What N bytes you mean CHAR(n) ?
The input data is being truncated when I am copying it to a table.What is the idea way to show it full and in 1 row.

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 12:58 pm
by coldplay1991
DSNE612I DATA FOR COLUMN HEADER MESSAGE COLUMN NUMBER 6 WAS TRUNCATED

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 1:20 pm
by dick scherrer
Hello,

I see you are having difficulty with this concept. . . If you have 100 bytes of data (the actual number does not matter) and try to put this into a 30-byte column - it will not go in there.

What is the idea way to show it full and in 1 row.
If it will not fit, there is no "idea way". You can truncate the data before the load or you can just let it be lost. If you actively look at the data and report length problems, it may help resolve the problem.

Unless i've missed something i see 3 alternatives:
Change the table definition to prevent truncation.
Change the data to fit.
Just do nothing and live with it.

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 1:23 pm
by coldplay1991
What do you want me to post?

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 1:25 pm
by coldplay1991
see this image

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 1:27 pm
by coldplay1991
this is my current load method

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 1:58 pm
by db2sysdba
Provide the DDL of your target table(SHE0015.SDSFLG)

Re: Accomodating Long message into column

PostPosted: Fri Dec 09, 2011 2:04 pm
by coldplay1991
I did its in the picture posted above you. the SQL for the SHE0015.SDSFLG