LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2011, 03:50 PM   #1
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627

Rep: Reputation: 31
migrate DB from cobol to postgresql


HI,
Is there a software or procedure to migrate DB from COBOL to SQL ( or postgresql)
thanks a lot
bela
 
Old 06-27-2011, 03:59 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352

Rep: Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382
How is the data in the "COBOL" system being stored? DB2? Flat files?

Last edited by dugan; 06-27-2011 at 04:02 PM.
 
Old 06-27-2011, 04:03 PM   #3
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627

Original Poster
Rep: Reputation: 31
Why this question?
Is there differents procedures ?
say both !

Is there a procedure from inside postgresql ffor example ??

thanks for help
regards
 
Old 06-27-2011, 04:09 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352

Rep: Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382
Uhm, you don't know how the data you need to migrate is being stored or what format it's in? You don't know whether it's stored in files or in a DB2 database or in some other format? OBVIOUSLY, we need that information before we can recommend anything. Especially anything automated.

What you will likely end up doing is this. First you would create a script containing SQL CREATE statements to create the tables and relationships you need in the postgresql database. Then you would export the data you need from the "COBOL" system (note: COBOL is not a data storage format) and transform it into a script full of SQL INSERT statements. Then you would run both scripts on the postgresql system to create the tables and insert the data.

EDIT: if the data in the "cobol" system is in a db2 database, then you should read this document:

http://wiki.postgresql.org/wiki/File:DB2UDB-to-PG.pdf

Last edited by dugan; 06-27-2011 at 04:19 PM.
 
Old 06-27-2011, 04:15 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by abd_bela
Why this question?
Is there differents procedures ?
Let's not be daft here. COBOL is a programming language. How can we possibly advise you on migrating from a programming language to a database?

Migrating from legacy systems (read: large mainframe transactional systems) to new languages and databases is a huge undertaking. It often requires a well-coordinated staff of business experts, programmers, sysadmins, and database administrators. And these projects sometimes fail.

Did I misunderstand you? Are you asking how to migrate a single table from DB2 to PostgreSQL? Are you highly familiar with the table design and data?
 
Old 06-27-2011, 04:22 PM   #6
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627

Original Poster
Rep: Reputation: 31
Thanks for help

In fact I have a Database written in Cobol, I want to migrate it to serveur using postgresql.

thanks a lot
 
Old 06-27-2011, 04:24 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352

Rep: Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382
Then you already knew the answer to your original question: it's a proprietary database system used only in your organization, so obviously no automated tool or procedure exists.

I've told you what you need to do in post #4.
 
Old 06-27-2011, 04:30 PM   #8
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by anomie View Post
Let's not be daft here. COBOL is a programming language. How can we possibly advise you on migrating from a programming language to a database?



Migrating from legacy systems (read: large mainframe transactional systems) to new languages and databases is a huge undertaking. It often requires a well-coordinated staff of business experts, programmers, sysadmins, and database administrators. And these projects sometimes fail.


thanks


Did I misunderstand you? Are you asking how to migrate a single table from DB2 to PostgreSQL? Are you highly familiar with the table design and data?

Yes but you can create a database, at least this is our case. The database is install on HP server.
My goal is to transform this DB to sql BD.


THIS IS MY QUESTION? Is there a port which converts the DB in order to read it with SQL ?
 
Old 06-27-2011, 04:31 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352

Rep: Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382Reputation: 5382
Quote:
Originally Posted by abd_bela View Post
THIS IS MY QUESTION? Is there a port which converts the DB in order to read it with SQL ?
[/SIZE][/COLOR]
Of course not.

If you can tell us the name of the database software that's written in COBOL, or any of the other information that I asked for, then the answer might change.

Last edited by dugan; 06-27-2011 at 04:35 PM.
 
Old 06-27-2011, 05:07 PM   #10
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I'd add that if your proprietary database is hierarchical in design, you will want to do a complete analysis of the table data before attempting to stuff it into a relational database. (For instance: rows may need to be "flattened", and significant work may need to be done to determine suitable primary keys.)
 
Old 06-27-2011, 06:11 PM   #11
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
my recomendation would be to look at this http://www.simotime.com/cblcsv01.htm document and write a program to dump your data to csv files, then import them into your postgresql database.
 
Old 01-11-2025, 09:32 AM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,073
Blog Entries: 4

Rep: Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073
Although this thread is from 2011, its reference to "COBOL" caught my eye since I am very familiar with that language.

COBOL is very distinctive for its very precise control as to exactly how numbers are stored and processed. Most of this magic is hidden within the PICture clause within the DATA DIVISION. Many COBOL programs purposely use decimal arithmetic – not the more-common "float binary," which COBOL refers to as COMPutational.

Well, "COBOL does it with grace."

When you are moving data from a COBOL application to something else, it is very important that you choose the appropriate representation of the data within your target database. And, that the new applications which are processing these data continue to do so in the "correct" way at every step. If you do not do this, after processing a column of "a few billion non-integer numbers," which is fairly common, your answers will drift from the correct result. (Today, we can often see this on "busy" bank or other statements, if we care to "run a tape." The total at the bottom of the list is slightly wrong. Errors like these can accumulate.

Databases such as Postgres do provide representation options, such as numeric. But, you must then be sure that the programming which manipulates these data continues to do so in the "correct" way. (As COBOL does implicitly.)

You should probably engage someone who is specifically very-familiar with COBOL (ahem ...) to ensure that your replacement data-representation and your replacement program-logic will continue to perform as expected. Before you begin with the conversion.

Also, don't be too quick to "abandon COBOL," just because it's unfamiliar. Very solid compilers for this language continue to be available. They will produce executables and libraries that can still be integrated into your production flow. The language is "quirky," yes. But it is still very powerful and very much "in use." And, for critical high-volume stages in your pipeline, keeping(!) this language in places might turn out to be the best solution.

Last edited by sundialsvcs; 01-11-2025 at 09:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Easily Migrate A PostgreSQL Server With Minimal Downtime LXer Syndicated Linux News 0 04-07-2010 02:40 PM
Migrate from Oracle 11g to Postgresql for a non-DBA GenePoole59 Linux - Server 3 08-12-2009 10:08 AM
LXer: Migrate from MySQL or PostgreSQL to DB2 Express-C LXer Syndicated Linux News 0 06-18-2006 05:54 PM
migrate from suse, what should i migrate to? any suggestions?:twocents: Siljrath Linux - General 4 12-26-2005 02:14 PM
differences+between+mainframe+cobol+and+AIX+cobol+data+type ssrividhya AIX 1 08-09-2004 10:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration