If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Load

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-26-04, 13:17
jayan jayan is offline
Registered User
 
Join Date: Feb 2004
Posts: 6
DB2 Load

How do I load a File created in Cobol into UDB on windows/solaris?
Reply With Quote
  #2 (permalink)  
Old 02-26-04, 13:43
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #3 (permalink)  
Old 02-26-04, 14:15
jayan jayan is offline
Registered User
 
Join Date: Feb 2004
Posts: 6
Db2 Load

Would the Binary fields(SMALLINT & Others) be taken care
Reply With Quote
  #4 (permalink)  
Old 02-26-04, 14:40
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #5 (permalink)  
Old 02-26-04, 14:58
jayan jayan is offline
Registered User
 
Join Date: Feb 2004
Posts: 6
Quote:
Originally posted by Marcus_A
Is the COBOL created asci file from the mainframe or from Unix/Linux/Windows?
from Mainframe
Reply With Quote
  #6 (permalink)  
Old 02-26-04, 15:10
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #7 (permalink)  
Old 02-27-04, 15:03
dbamota dbamota is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On