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
 

 

Default value to the column in the DB2 load card

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

New User


Joined: 30 Apr 2008
Posts: 20
Location: Noida

PostPosted: Thu Jan 01, 2009 8:02 pm    Post subject: Default value to the column in the DB2 load card
Reply with quote

Hi all,
A new column has been added to a table in DV01. I have unloaded the PR01 data of the table into a dataset.
Now i want to load the PR01 data to the DV01 table, but here i am facing a problem. Since the PR01 dataset doesnot have any entries for the new column when i try to load that data set iget an error msg that

INPUT FIELD 'xxx_xxx_xxx_NR' NOT ENTIRELY WITHIN INPUT RECORD

I tried fixing this by trying to provide a default value to the column in the load card

xxx_xxx_xxx_NR POSITION(825) CHAR(10) DEFAULTIF xxx_xxx_xxx_NR='0000000000')


But this didnt worked.
Please reply ASAP!
Back to top
View user's profile Send private message

ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Fri Jan 02, 2009 2:18 pm    Post subject:
Reply with quote

Hi,

I also faced similar challnges during loading of a table. Using SORT, I have provided default value to the input file (instead of giving default value in load card itself) as per table structure and loaded into table.
Back to top
View user's profile Send private message
prasenjit_dey

New User


Joined: 30 Apr 2008
Posts: 20
Location: Noida

PostPosted: Fri Jan 02, 2009 6:07 pm    Post subject: Reply to: Default value to the column in the DB2 load card
Reply with quote

Hi,
I tried to add values in the output data set through Batch file aid. I had issues in that.
Anyways i gave the condition as

$$DD01 COPYALL IF=(18,8,NE,C'')
MOVE=(825,10,C' ')

There must have been some error in the condition.Though i wasnt able to find.

Anyways i overcame this problem with a solution that is not a good one but well in emergencies it works.

Copied the dataset to a new one and increased the LRECL and BLKSIZE, so the new dataset had spaces for the last filed since it did not find any value for that in the i/p.

Thanks and if you have any other solution please feel free to share.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon Jan 05, 2009 5:16 pm    Post subject:
Reply with quote

Quote:

Copied the dataset to a new one and increased the LRECL and BLKSIZE, so the new dataset had spaces for the last filed since it did not find any value for that in the i/p.


This is a very bad practice. Do you have DFSORT in your shop? If so, include a SORT step to assign default values into the filed of the input file and then execute LOAD step.

Otherwise you can write a sample COBOL or Easetrieve program and move all the existing values into output file and default value (or spaces, zeroes) into the needed field.
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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