Results 1 to 7 of 7

Thread: DB2 Load

  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: DB2 Load

    How do I load a File created in Cobol into UDB on windows/solaris?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You load using ASC for the "OF filetype" parm and METHOD L which is used to specify the start and end column numbers from which to load data. See the command reference for more information.

    Here is a partial example from the manual:

    db2 load from ascfile1 of asc modified by striptblanks reclen=40
    method L (1 20, 21 22, 24 27, 28 31)
    insert into table1 (col1, col5, col2, col3)
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Feb 2004
    Posts
    6

    Db2 Load

    Would the Binary fields(SMALLINT & Others) be taken care

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Is the COBOL created asci file from the mainframe or from Unix/Linux/Windows?
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Feb 2004
    Posts
    6
    Originally posted by Marcus_A
    Is the COBOL created asci file from the mainframe or from Unix/Linux/Windows?
    from Mainframe

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I believe that you have to download the file as binary, and then specify the code page (codepage=x). See Table 7. Valid File Type Modifiers in the Command Reference under LOAD utility. You might also need to specify binarynumerics, packeddecimal, zoneddecimal, etc, as one of the modifiers. See the manual.

    If you can export the mainframe table as IXF format, you can load it in IXF format a bit easier than above.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Sep 2003
    Posts
    237
    Mainframe COBOL files(CF) have(had) block control, record control characters; packed decimal and binary fields; records spanning blocks etc. You canNOT use such a file in UDB.
    You can try a utility to convert CFs to CSV(comma or tab delimited) format; or write a program to convert everthing to DISPLAY format; then DISPLAY UPON PRINTER command to write to a SPOOL file. I think you can have a PRINT line greater than the standard 132 characters. You can FTP such a spool file and use it as input to load on udb
    mota

Posting Permissions

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