Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2014
    Posts
    5

    Unanswered: DB2 load file in EBCDIC format using load utility

    Hi,

    Can anyone help me with the script to load a file in EBCDIC format using load utility?

    Thanks,
    Venkat

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    Question is too vague to answer. Give facts about your environment (db2 version, db2-server operating system , db2 client. What kind of scripting is commonly used at your site etc.

  3. #3
    Join Date
    Oct 2014
    Posts
    5
    Here is the load command that I use to load a file in
    DB2 client 9.5.7 in AIX machine.

    ---------------------------------------------
    load from /testdir/testx2.TXT
    of asc modified by dateformat="YYYYMMDD"
    dumpfile=/edwork/log/logfile.dis
    method l ( 2635 2649,2565 2594,
    1401 1408, 1941 1951,
    1537 1546, 1549 1551,
    288 296, 343 367,
    805 805,797 804,
    806 807)
    MESSAGES /edwork/log/logfile.msg
    tempfiles path /edwork/log
    REPLACE INTO schema1.testtable (
    BATCH_NUM,
    TRANSACTION_ID,
    SERVICE_DT,
    PRODUCT_ID,
    QTY,
    NO_DAYS,
    PROD_NUM,
    FIRST_ANME,
    GENDER,
    DOB,
    REL_CD )
    nonrecoverable;

    ----------------------------------------------------------

    The values that are loaded in QTY column are in EBCDIC format.
    Currently, we are loading them as a string and then coverting them to decimal using string functions.

    Is there a way to load the file in EBCDIC format or the QTY column alone can be loaded in EBCDIC format i.e. it should conver the EBCDIC value into a decimal while loading itself.

    Some of the values in EBCDIC format that are populated in QTY column:
    000003000}
    0000030000
    0000060000

    You can notice that the first value ends with a '}' - which is in EBCDIC format.

    Please help.

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    could dd command not help ?
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Oct 2014
    Posts
    5
    Is there a way to convert EBCDIC values to ASCII using any SQL functions in DB2?

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    all data is always saved in ascii except in lobs
    if any translate/convert happened while importing the data.. this should be corrected before the import.. otherwise data could be wrong..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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