Posted: Tue Jan 07, 2003 10:41 pm Post subject: Load varchar data problem
Hello,
I have a data in a sequential file.This file is a simple log file and records can span upto 300 characters in length. To upload this data into db2 tables, i followed the following procedure:
Created a control card as follows:
LOAD DATA RESUME YES LOG NO INDDN SYSREC00
INTO TABLE username.aaaaa_TABLE
(
aaaaa POSITION( 1 )
VARCHAR
)
Then I created a table under my user profile as follows:
Create Table aaaaa_TABLE (
aaaaa VARCHAR (300)
)in dsqdbdef.dsqtsdef;
Then i submitted the JCL for uploading to the db2 tables:
It gave the following error message:
DBU1- DSNURWRF - RECORD (1) WILL BE DISCARDED DUE TO INVALID 'aaaaa' COLUMN SPECIFICATION
But the loading was working fine with all other data types
Can you please help me in solving this?
Is this the problem with the control card? I'm not able to trouble shoot where the error is .
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Jan 08, 2003 5:37 pm Post subject:
Bindu,
I don't think you can load a sequential file directly to the varchar column. Basically the varchar column consists of 2 parts.The first part is the length and the second part is the text.
Hello Kolusu,
I tried unloadind the structure from the DB2 table and then load it .But even then it was giving the same error ...Any idea why this is happening (
Hello Kolusu,
Got the data loaded into DB2 ..thanks for ur help ..infact the error which we got even after unloading the structure directly from the DB2 tables was due to not allocating 2 spaces for the length field .. So we need to change the control card manually for allocating spaces for the length field.What we unloaded from the DB2 tables were as follows:
LOAD DATA RESUME YES LOG NO NOCOPYPEND INDDN SYSREC00 INTO TABLE
xxxxx.aaaaaa_TABLE
(
aaaaaa POSITION( 1 )
VARCHAR
NULLIF(303)='?'
)
And our input data in the seq. file was as follows:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000100 TIMESTAMP 0 19991115122812
000200 PROCESSOR 0 000 1
000300 FILEID 0 001 000000 023 WCTGEN/QCLSRC(CUCWCF45) 19991115122752 0
000400 FILEEND 0 001 000000
Note: it started from col:2
But when we changed the col of input data starting position to 3 it worked.
But the sad part of this is that we need to do it for each line of input data if it is Varchar ..Am i correct in my understanding?
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Jan 13, 2003 10:07 am Post subject:
Bindu,
Just a couple of clarifications.What is your DB2 Version? Did you mention the DCB parameter when unloading the table?? i.e did you mention the LRECL to be 300?
Unload utilities and sort products do not need hard coded DCB parameters as they are capable of calcuating the dcb parms from the sysin cards itself.
I tried to unload and load the data back and every thing went fine. Try using this jcl for unloading and loading the table.
Here XXXX is your DB2 region. Make sure that you don't have the DCB parm coded for unload step.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum