可以将 COBOL VISION 数据库导出为逗号分隔的 .csv 吗?

发布于 2024-12-02 01:06:24 字数 242 浏览 2 评论 0原文

我们有一个基于 AcuCobol 和视觉文件的系统。

我们需要将整个数据文件转储到基于 txt 的文件中,以便导入到 sql 服务器中。

我们现在正在使用 vutil 转储数据,但它正在创建一个固定宽度的文件,我们希望它是某种分隔文件。我们现在使用的命令是这样的:

vutil -unload -t sourcefile targetfile

现在有人有这方面的经验吗?如果有的话,最好的实用程序是什么?

We have a system based on AcuCobol and vision-files.

We need to dump the entire datafiles in to txt-based files to be imported in to a sql server.

We are using vutil to dump the data right now, but it's creating a fixed-width file and we would want this to be a delimited file of some sort. The command we are using right now is this:

vutil -unload -t sourcefile destinationfile

Now does anyone have any experiance with this, and if so, what would be the best utility for this?

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

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

发布评论

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

评论(3

疏忽 2024-12-09 01:06:24

为了完成这项工作,我要做的是:

将带有 JCL 的表卸载到文件中。
批量使用该文件,
与表格描述相匹配的抄写本:
(例如:如果您的表有 3 列 [ID]、[NAME] 和 [ADDRESS],则创建一个副本 CC-1:

 O1 CC-1 
    05 ID   PIC X (16).
    05 NAME PIC X (35).
    05 ADDRESS PIC X (35).

对于每一行,将该行移动到副本 CC-1 中。

创建第二个副本 CC-2

  O1 CC-2 
    05 ID   PIC X (16).
    05 FILLER PIC X VALUE ';'.
    05 NAME PIC X (35).
    05 FILLER PIC X VALUE ';'.
    05 ADDRESS PIC X (35).
    05 FILLER PIC X VALUE ';'.

进行 CC-1 到 CC-2 对应的动作
写入输出。
这对于每一行。您将在输出中获得包含所有数据的 CSV 文件。

您可以重用批处理和 JCL,只需更改记录的大小和副本的描述以匹配您要卸载的表。

自由又轻松。 :)

what I'll do to get the job done is this:

Unload your table with a JCL into a file.
Use this file in a batch,
with a copybook matching the description of the table :
(ex: if your table has 3 columns [ID], [NAME] and [ADDRESS], then create a copy CC-1 with:

 O1 CC-1 
    05 ID   PIC X (16).
    05 NAME PIC X (35).
    05 ADDRESS PIC X (35).

For each line move the line into the copy CC-1.

Create a second copy CC-2

  O1 CC-2 
    05 ID   PIC X (16).
    05 FILLER PIC X VALUE ';'.
    05 NAME PIC X (35).
    05 FILLER PIC X VALUE ';'.
    05 ADDRESS PIC X (35).
    05 FILLER PIC X VALUE ';'.

Do a move corresponding of CC-1 to CC-2
Write in the output.
This for each line. You get in the output a CSV file of all your data.

You can reuse the batch and JCL, you just have to change the size of the records and the descriptions of the copy to match the table you are unloading.

Free and easy. :)

乖乖 2024-12-09 01:06:24

Google 是你的朋友...我快速搜索了一下,找到了 NextForm ,它声称将 Vision 转换为 CSV(和其他格式)。

从“细则”来看,您似乎可以下载试用版,但必须花费大约 400.00 美元才能获得许可版本(不会丢失随机记录)。

我对这个产品完全没有经验,所以无法告诉你它是否真的有效。

编辑

有时,使用遗留系统比对抗遗留系统更有效率。

您是否看过AcuODBC?这允许 Windows 程序读取/导入
愿景文件。您可以使用它从任何支持 Windows ODBC 的应用程序访问 Vision 文件。我相信您可能需要编译一个数据字典才能完成这项工作,但它可以在您所在的位置和您想要的位置之间提供一座桥梁。

另一种方法可能是在 AcuCobol 中编写您自己的转储程序。读取记录、格式化并
写下来。如果有文件,编写如此复杂的 Cobol 程序应该不会是一项太具有挑战性的任务
没有复杂的结构(例如,同一文件中的多个记录类型/布局,或一个文件中的重复字段)
单条记录)。

如果需要将单个 Vision 文件后处理为
多个 SQL Server 表。不幸的是,复杂的转换相当
与 Cobol 遗留系统通用
因为它们倾向于使用丰富/复杂/非规范化的文件结构(与 SQL 不同,SQL 与
标准化表格数据)。

如果 Vision 文件比单个 SQL Server 表更复杂,那么也许您可以考虑使用
AcuXML 接口
将文件转储为 XML,然后使用 XSLT 处理器创建 CSV 或您想要的任何其他格式
需要从那里。这将允许您使用相当复杂的 Cobol 记录结构。再次,
这种方法意味着编写一些相当基本的 AcuCOBOL 字体端程序。

根据您对我原始帖子的评论,您不是一个顽固的 Cobol 程序员。也许会是
与商店中具有该语言工作知识的人员合作是一个好主意
环境,然后再进一步推动这一点。我有一种感觉,这个任务会比“转储和加载”更复杂一些。

Google is your friend... I did a quick search and came up with NextForm which claims to convert Vision to CSV (and other formats).

From the "fine print" it looks like you can download a trial copy but will have to fork out about $400.00 to get a licenced version (that won't drop random records).

I have absolutely no experience with this product so cannot tell you if it really does the job or not.

Edit

Sometimes it is more productive to work with rather than fight against a legacy system.

Have you looked at AcuODBC? This lets Windows programs read/import
Vision files. You could potentially use this to access Vision files from any Windows ODBC enabled application. I believe you may need to compile a data dictionary to make this work, but it could provide a bridge between where you are and where you want to be.

Another approach might be to write your own dump programs in AcuCobol. Read a record, format and
write it. Writting a Cobol program of this complexity should not be too challenging a task provided the files
do not have a complex structure (eg. multiple record types/layouts in the same file, or repeating fields within a
single record).

Your task will be significantly more complex if a single Vision file needs to be post-processed into
multiple SQL Server tables. Unfortunately, complex conversions are fairly
common with Cobol legacy systems
because of their tendancy to use rich/complex/denormalized file structures (unlike SQL which works best with
normalized tabular data).

If the Vision files are more complex that a single SQL Server table, then maybe you could consider using the
AcuXML Interface
to dump the files into XML and then use an XSLT processor to create CSV or whatever other format you
need from there. This would allow you to work with fairly complex Cobol record structures. Again,
this approach means writting some fairly basic AcuCOBOL font end programs.

Based on your comments to my original post, you are not a die-hard Cobol programmer. Maybe it would be
a good idea to team up with someone in your shop that has a working knowledge of the language and
environment before pushing this any further. I have a feeling that this task is going to be a bit more complicated than "dump and load".

橘虞初梦 2024-12-09 01:06:24

如果您的“工具”菜单下有 Acubench,则有一个“视觉文件实用程序”选项,您可以从那里将视觉数据卸载到制表符分隔的文本文件中。

从那里您可以将其作为制表符分隔文件导入到 Excel,然后重新保存为 csv 文件。

If you have Acubench under the Tools Menu there is an option for Vision File Utility, from there you can Unload your Vision Data to a text file which is tab delimited.

From there you can import to Excel as a tab delimited file and then re-save as a csv file.

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