Skip to Main Content
  • Questions
  • SQL Loader to convert COMP, COMP-3 to Oracle numeric types.

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, John.

Asked: July 21, 2020 - 8:43 pm UTC

Last updated: July 22, 2020 - 6:45 am UTC

Version: 12.2

Viewed 1000+ times

You Asked

I want to load a flat file created by COBOL on IBM MVS and containing COMP and COMP-3 (and text) fields into Oracle using SQL*Loader. I know that charater set conversion is supported. Are there built-in functions or public user functions to do the numeric conversion? I know the COBOL PICtures, and field start and length in the source file. If not, any other approach?


and Connor said...

Take a look here - there's been lots of contributions related to this requirement

https://asktom.oracle.com/pls/asktom/asktom.search?tag=converting-numbers

I've also seen (but not tried) techniques that theoretically let SQL Loader do it natively via characterset conversion, ie

LOAD DATA CHARACTERSET TR8EBCDIC1026 BYTEORDER BIG
INFILE ...
INTO TABLE ...
(
COL1 POSITION(NNN:NNN) DECIMAL(10,2)
...
)


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Utilities

All of the database utilities are explained in the Utilities guide.