旧 Cobol 软件和新操作系统

发布于 2024-09-19 01:23:38 字数 554 浏览 16 评论 0原文

大约 25 年前,一位中年男子为他之前工作的公司开发了软件...... 他用 COBOL 编写了所有内容...我花了几个小时才理解该系统是如何工作的! 嗯,我认为公司的服务器太旧了(8MB硬盘)... 他不使用数据库,而是将数据存储在文件中...... 他告诉我他想升级系统到新的...旧系统使用AIX操作系统.... 他想知道aix还是linux哪个更好,我认为linux的发行版可能更好,因为linux有很多免费软件...我不知道什么与AIX兼容... 该公司是某种类型的仓库... 他开发了一个网站供客户登录并查看一些信息。该网站位于远程服务器,他手动将数据库复制并粘贴到远程服务器...

他想向网站添加下订单的功能... 然而,他不愿意更新旧的 COBOL 代码并至少使用数据库...

公司中的人员通过使用某种 telnet 客户端远程登录服务器来使用服务器的程序...

我的问题用于教育目的... 有没有办法重用 COBOL 代码并创建 Web 界面? 或者,如果可以使用 cobol 中的相同代码为用户创建 GUI 程序... 因为我知道编写代码在不同的地方做同样的事情并不是一个好主意。 我的意思是业务逻辑存在于多个地方......

A mid aged man developed software for the company he works before about 25 years ago...
He has written everything in COBOL...It took me hours to understand how the system works!
Well the company's server is too old (8 mb hard disk ) i think ...
He doesnt use a database but stores the data in files...
He told me that he wants to upgrade the system to something new... The old system uses AIX operating system....
He was wondering whether aix or linux is better ,i think that a distribution of linux might be better because there is much free software for linux... i dont know what is compatible for AIX...
The company is some type of warehouse...
He has developed a website for the clients to login and see some info ..The website is at remote server and he manualy copies and pastes the database at the remote server...

He wants to add the functionality to the web site of placing orders...
However he isnt willing to update the old COBOL code and use a database at least...

The people in the company use the server's programms via telneting the server using somekind of telnet client....

My question for educational purposes...
Is there any way to reuse the COBOL code and creating a web interface?
Or if it is posible to create GUI program for the users while using the same code from cobol...
Because i know that writing code to do same things in diferent places isnt good idea..
i mean the bussiness logic to exist in more than one places...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

你是年少的欢喜 2024-09-26 01:23:38

逃跑!

至少在你的客户开始使用之前
一个真正的数据库系统来实现订单输入系统。
所有交易处理系统都需要
确保 ACID 属性
为每笔交易进行维护。这是根本原因之一
为什么真正的数据处理系统使用数据库。不使用 DBMS 是
灾难的必然公式(迟早)。

COBOL 可以连接到 Web 服务或 GUI 类型的应用程序吗?答案
肯定是的,而且这种做法并不罕见。让它发生
可能是一个或多或少痛苦的过程,具体取决于 COBOL 应用程序的方式
是结构化的。如果它具有 Client/Server 类型结构,
那么你只需要将客户端组件替换为 web/GUI
组件,插入适当的中间件来连接到服务器,你就差不多完成了。
如果 COBOL 应用程序被开发为
大泥球,那么你就是
经历一段艰难的旅程。由于你的客户自己在独立平台上开发了他的系统,我
我愿意赌大钱“大泥球”模型适用。为最坏的情况做好准备。

如果这个应用程序只需要“几个小时”而不是“几个月”来理解它听起来不太好
如此复杂 - 您可能会发现从头开始重建它是一个可行的选择。然而,
也不要低估这样做的工作量!

至于升级AIX系统或者切换到Linux,我无法帮助你。

以下是您可能需要查看的 AIX 上的 COBOL 的一些资源:

如果如果您选择采用 Linux 路线,我建议您查看:

您的客户表达了对 MicroFocus COBOL 的兴趣。 MicroFocus 可能是
大型机市场之外最大的 COBOL 供应商。他们有很好的声誉。
MicroFocus还支持Linux平台上的Web开发
并且往往对 IBM COBOL 方言有良好的支持,如果从 AIX 迁移,这可能是一个考虑因素。

我最后的建议是逃跑,直到你的客户醒悟过来
以下事实:

  • 数据和事务需要使用支持 ACID 的真实 DBMS 进行管理。
  • 将基于网络的订单输入系统安装到“泥球”上并不是一个周末项目。可能需要
    顺便说一句,对现有系统进行完全重构,甚至可能完全重写

...如果您想与此人保持工作关系,请不要致电他的系统
即使它是一个“泥球”。他建造了这个东西并且可能
将其视为他的孩子之一。

Run away!

At least until your client comes around to using
a real database system to implement the order entry system.
All transaction processing systems need
to ensure ACID properties
are maintained for every transaction. This is one of the fundamental reasons
why real data processing systems use databases. Not using a DBMS is
a sure formula for disaster (sooner or later).

Can COBOL be interfaced to a web service or a GUI type application? The answer
is definitely yes and it is not an uncommon practice. Making it happen
can be a more or less painful process depending on how the COBOL application
is structured. If it has a Client/Server type structure,
then you only need to replace the Client side components with web/GUI
components, insert the appropriate middle-ware to connect to the server and you are pretty much done.
If the COBOL application was developed as a
big ball of mud, then you are
in for a rough ride. Since your client developed his system on a stand-alone platform by himself, I
am willing to bet serious money the "big ball of mud" model applies. Be prepared for the worst.

If this application only took "hours" instead of "months" to understand it doesn't sound
all that complex - you may find rebuilding it from scratch is a viable option. However,
don't underestimate the work in doing that either!

As for upgrading the AIX system or switching to Linux, I cannot help you.

Here are a couple of resources for COBOL on AIX that you might want to review:

If you choose to go the Linux route I would recommend checking out:

Your client expressed interest in MicroFocus COBOL. MicroFocus is probably the
largest COBOL vendor outside of the mainframe market. They have a very good reputation.
MicroFocus also supports web development on Linux platforms
and tends to have good support for IBM COBOL dialects which may be a consideration if migrating from AIX.

My final words of advice are to run away until your client wakes up to the
following facts:

  • Data and transactions need to be managed using a real DBMS that supports ACID.
  • tacking a web based order entry system onto a "ball of mud" is not a week-end project. It may require
    a complete refactoring and possibly a complete re-write of the existing system

BTW... If you want to retain a working relationship with this person, don't call his system
a "ball of mud" even if it is one. He built this thing and probably
sees it as one of his children.

野の 2024-09-26 01:23:38

AIX 与 Linux —— Linux 会更便宜,高端 AIX 机器是你能买到的最强大的机器之一——否则没有太大区别,大多数 OSS 软件已经或可以很容易地移植到 AIX。

您最好的策略是重用现有的 COBOL COPYBOOK 并编写一个 COBOL 程序,该程序读取平面文件并插入到更可移植的格式(XML、MySql imort 文件、基于文件的数据库,例如 sqlite,或直接插入到位于网络服务器)。

这种方法的独特优点是存在常用的 COBOL 特性,例如“PIC BBBB99.99-”、“REDEFINES”、“OCCURS DEPENDING ON”、“COMP SYNCHROISED”中的字符格式数字“松弛字节处理、压缩十进制” COMP-3”格式确实很难用其他语言重现。

应该指出的是,直到最近,COBOL 仍然是少数能够正确执行算术运算(会计师所理解的)的语言之一。

AIX vs Linux -- Linux will be cheaper, top end AIX boxes are among the most powerful machines you can buy -- otherwise there is not much difference, most OSS software has been or can easily be ported to AIX.

You best strategy would be reuse the existing COBOL COPYBOOKs and write a COBOL program which reads the flat files and inserts into a more portbale format (XML,MySql imort file, file based database such as sqlite, or directly into a to the database at the web server).

The singular advantage of this approach is that there are commonly used COBOL ideosyncrasies such as the character format numbers in "PIC BBBB99.99-", "REDEFINES" , " OCCURS DEPENDING ON ", " COMP SYNCHROISED" slack byte handling, packed decimal "COMP-3" format that are really really difficult to reproduce in other languages.

It should be noted that until very recently COBOL was one of the few languages that could do Arithimatic (as understood by accountants) correctly.

将军与妓 2024-09-26 01:23:38

安装了 TinyCOBOL 的 Linux 服务器可能是一个选择。我会保留
密切关注The Daily WTF,希望听到故事的其余部分......

A Linux server with an installation of TinyCOBOL might be an option. I will keep
a close eye on The Daily WTF, in hopes of hearing the rest of the story...

无声无音无过去 2024-09-26 01:23:38

嗯,是的,他就是这么想的……这个系统是他 25 年的孩子!并给公司带来了资金。下周我将看到他的一个程序的来源......
实际上他做了大约5个不同的程序...

你说它可以接口,问题是如何接口???
用什么?现在系统通过telnet工作...
如果解决方案是在接口应用程序上创建 telnet 连接,并以这种方式获取数据......我认为这完全是糟糕的......

Well yes that is the way he thinks... This system is his child for 25 years! And brough money to the company.Next week i'll see the source of one of his program...
Actually he made about 5 different programs...

You said that it can be interfaced,the question is how???
Using what? Now the system works through telnet...
If the solution is creating telnet connections at the interfacing application ,and fetch data this way... i think that this is totally POOR..

风苍溪 2024-09-26 01:23:38

我使用的一种可能的方法是保留 COBOL 核心,但在边缘进行扩展。这符合“他想在下单网站上添加功能”。

Microfocus 提供了一个名为 Enterprise Server 的工具,它允许 COBOL 与 Web 服务交互。 (它可以在 Linux 和 AIX 上运行)。

如果您有一个 COBOL 程序 A 和另一个 COBOL 程序 B,并且 A 通过接口部分调用 B,则该工具允许您将 B 的接口部分公开为 Web 服务。

对于程序 A,您可以生成一个客户端代理,A 现在可以通过 Web 服务调用 B。

当然,因为 B 现在有一个 Web 服务,任何其他类型的程序(命令行、Windows 应用程序、Java、ASP 等)现在也可以调用它。

此外,他们还有一个名为 COBOL.NET 的产品,该产品在 Visual Studio 内运行并将 COBOL 转换为 MSIL。这意味着您可以链接任何 .NET 组件。

因此,方法是保留 COBOL 核心,但通过 Web 服务进行接口,并使用任何 CLR 兼容语言(C#、VB 等)进行新开发。

PS 将使用大端的 COBOL 系统迁移到使用小端的系统时要非常小心反之亦然!

One possible approach that I have used is to keep the COBOL core but expand around the edges. This fits in with "He wants to add the functionality to the web site of placing orders".

Microfocus provide a tool called Enterprise Server which allows COBOL to interact with web services. (It runs on both Linux and AIX).

If you have a COBOL program A and another COBOL program B and A calls B via the interface section, the tool allows you to expose B's interface section as a web service.

For program A, you then generate a client proxy and A can now call B via a web service.

Of course, because B now has a web service any other type of program (command line, Windows application, Java, ASP etc.) can now also call it.

Also, they have a product called COBOL.NET which runs inside Visual Studio and translates COBOL to MSIL. This means that you can then link in any .NET components.

So the approach is to keep the COBOL core but interface via web services and do new developments in any CLR compliant language (C#, VB etc.)

P.S. Be very careful of moving a COBOL system that uses big endian to a system that uses little endian and vice versa!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文