Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Posts
    5

    Unanswered: skip header option in db2 load command?

    I am loading data from csv file on unix directory to a load table in db2 through LOAD command as below (part of the script):

    my csv file has header too. With this command below, all the data is getting loaded skipping the header due to datatype mismatch and shows the job status as Failed. I want to deal it in a different way, by skipping the header not by datatype error but by some option of LOAD so that job status wouldnt be as Failed though the data is loaded. Is there anything like skip header option in Load command???

    ************************script******************** ******
    FLIST=`find $LOAD_FILE -print`
    for ACTFILE in $FLIST
    do
    # Load the file
    #
    db2 +p +o -x CONNECT TO $DSS_DATABASE
    db2 +p -x LOAD CLIENT FROM $ACTFILE OF DEL SKIPCOUNT 1 \
    MODIFIED BY COLDEL\, \
    METHOD P \(\
    1 \
    , 2 \
    , 3 \
    , 4 \
    \) \
    INSERT INTO $DSS_SCHEMA.load_my_table\( \
    abc \
    , def \
    , ghi \
    , jkl \
    \) \
    NONRECOVERABLE > /home/redbatch/EDW13/wsl/working/wsl1276.log 2>&1
    RETCODE=$?
    db2 +p +o -x TERMINATE

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,369
    RESTARTCOUNT should work in your example but note that this option is deprecated and can be removed any time so it's not recommended to use it. Don't use it with load RESTART (after it failed).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •