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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-27-2011, 03:50 PM
|
#1
|
Member
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627
Rep:
|
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
|
|
|
06-27-2011, 03:59 PM
|
#2
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
How is the data in the "COBOL" system being stored? DB2? Flat files?
Last edited by dugan; 06-27-2011 at 04:02 PM.
|
|
|
06-27-2011, 04:03 PM
|
#3
|
Member
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627
Original Poster
Rep:
|
Why this question?
Is there differents procedures ?
say both !
Is there a procedure from inside postgresql ffor example ??
thanks for help
regards
|
|
|
06-27-2011, 04:09 PM
|
#4
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
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.
|
|
|
06-27-2011, 04:15 PM
|
#5
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
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?
|
|
|
06-27-2011, 04:22 PM
|
#6
|
Member
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627
Original Poster
Rep:
|
Thanks for help
In fact I have a Database written in Cobol, I want to migrate it to serveur using postgresql.
thanks a lot
|
|
|
06-27-2011, 04:24 PM
|
#7
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
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.
|
|
|
06-27-2011, 04:30 PM
|
#8
|
Member
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 627
Original Poster
Rep:
|
Quote:
Originally Posted by anomie
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 ?
|
|
|
06-27-2011, 04:31 PM
|
#9
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
Quote:
Originally Posted by abd_bela
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.
|
|
|
06-27-2011, 05:07 PM
|
#10
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
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.)
|
|
|
06-27-2011, 06:11 PM
|
#11
|
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
|
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.
|
|
|
01-11-2025, 09:32 AM
|
#12
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,073
|
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.
|
|
|
All times are GMT -5. The time now is 02:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|