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
 

 

DB2 Load Requirement.

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

Active User


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

PostPosted: Thu Dec 15, 2011 5:54 pm    Post subject: DB2 Load Requirement.
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    Post subject:
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: 157
Location: South Africa

PostPosted: Thu Dec 15, 2011 6:52 pm    Post subject: Reply to: DB2 Load Requirement.
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    Post subject:
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    Post subject: Re: Reply to: DB2 Load Requirement.
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    Post subject:
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: 157
Location: South Africa

PostPosted: Fri Dec 16, 2011 10:27 am    Post subject: Reply to: DB2 Load Requirement.
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Cards mainframe developer requirement... capricorn Mainframe Jobs 0 Sun Sep 11, 2016 9:57 am
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am


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