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

DB2 Load Requirement.


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

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu Dec 15, 2011 5:54 pm
Reply with quote

I got a issue with DB2 data requirement.

Got a DB2 table in which one column XYZ is VARCHAR (1000).
A file has a field which is PIC X(18). Trying to load the table using the file.
Load is successful but the requirement is the DB2 table the rest of 982 fields of DB2 column
shouldn't contain space.

Thanks,
Abhijit.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Dec 15, 2011 6:37 pm
Reply with quote

Then what is should contain?

You need to modify the file to add RDW for the varchar field.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu Dec 15, 2011 6:52 pm
Reply with quote

Got another doubt: Are low values of the file and the NULL value of DB2 are same.
Meanwhile I got the solution from one of my senior which I will try on Monday:
to use 2 byte binary length field before varchar field and
the field to be S9(4) comp value +1000.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Dec 15, 2011 6:57 pm
Reply with quote

But if you put length as 1000 then all the 1000 bytes will be populated to the varchar filed. but you want only 18 bytes rite?

NULL is nothing to do with low-values. NULL tells DB2 that this columns does not have any value.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Thu Dec 15, 2011 7:01 pm
Reply with quote

abhijit.nayak01 wrote:
Got another doubt: Are low values of the file and the NULL value of DB2 are same. .


NO! Low values (a COBOL term) are a value, NULL in DB2 is the lack of any value.
Back to top
View user's profile Send private message
db2sysdba.zos

New User


Joined: 04 Oct 2011
Posts: 25
Location: INDIA

PostPosted: Thu Dec 15, 2011 7:22 pm
Reply with quote

Whether the column 'XYZ', is last column of your table definition or not?
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Fri Dec 16, 2011 10:27 am
Reply with quote

No the xyz column is not the last column. Actually the table's column is varchar (1000) and initially the file field value was also 1000 but the requirement change came i.e. in a file only 18 character field wil come no matter what is the field length of the file and that field wil be loaded to the xyz column which has 1000 length. And if the 18 character is loaded to the table then rest of 982 character should be spaces.
My another senior said to use NOPAD option while loading which I can only check on monday as there is a three day holiday.
Back to top
View user's profile Send private message
db2sysdba.zos

New User


Joined: 04 Oct 2011
Posts: 25
Location: INDIA

PostPosted: Fri Dec 16, 2011 3:02 pm
Reply with quote

Yes! your senior's advice is right.

Added to his Information,

always place VARCHAR columns at last of the table definition. It will increase your performance.
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 Load new table with Old unload - DB2 DB2 6
No new posts How to load to DB2 with column level ... DB2 6
No new posts REASON 00D70014 in load utility DB2 6
No new posts DB2 Load - Sort Or order BY DB2 1
No new posts DB2 Load - NUMRECS DB2 3
Search our Forums:

Back to Top