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

Default value to the column in the DB2 load card


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 355
Location: New York

PostPosted: Fri Jan 02, 2009 2:18 pm
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
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: 355
Location: New York

PostPosted: Mon Jan 05, 2009 5:16 pm
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 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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top