EBCDIC到ASCII的转换 [英] EBCDIC to ASCII Conversions

查看:800
本文介绍了EBCDIC到ASCII的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有EBCDIC格式的大型机文件,我想将这些文件转换为ASCII格式.

I have mainframe file in EBCDIC format and I want to convert those files into ASCII format.

我曾尝试使用python 2.6将EBCDIC转换为ASCII,但存在很多问题,例如压缩字段未转换且记录计数增加.

I have tried converting EBCDIC to ASCII using python 2.6 but there are many issues in that like compression field didn't get converted and records count gets increased.

有什么方法可以将具有压缩字段的EBCDIC文件转换为ASCII格式.

Is there any way to convert EBCDIC files having compressed fields to ASCII format.

推荐答案

选项

某些选项

  • 将文件转换为大型机上的文本文件(sort或eastrieve都可以​​这样做)
  • 如果一次关闭Fileaid/File master可以将文件转换为大型机上的Text
  • 如果已关闭一次,则 RecordEditor 应该可以进行编辑带有Cobol抄写本的文件.它还可以生成JRecord代码来读取文件.

  • Convert the file to a Text file on the mainframe (sort or eastrieve will both do this)
  • If it is a once off the Fileaid/File master can convert the file to Text on the mainframe
  • If it is a once off the RecordEditor should be able to edit the file with a Cobol Copybook. It can also generate JRecord code to read the file.

如果文件中只有一个记录类型,则可以使用 CobolToCsv Cobol Copybook将文件转换为CSV.

If there is only one Record-Type in the file, CobolToCsv can use the Cobol Copybook to convert the file to a CSV.

  • 将EBCDIC Copybook复制到等效的Ascii Copybook(转换外部字段,保留二进制字段不变).如果将Mainframe Cobol文件转换为在Windows/Linux Cobol系统中使用,则很有用
  • 将EBCDIC二进制抄写本复制到Ascii文本抄写本

例如,使用 CobolToCsv 将Cobol数据文件转换为Csv(单一记录类型):

For Example to convert a Cobol Data File to Csv (single record type) using CobolToCsv :

java -jar ../lib/Cobol2Csv.jar -I In/DTAR020.bin  -O Out/o_DTAR020_space.csv ^
         -C DTAR020.cbl  ^
         -Q DoubleQuote  -FS Fixed_Length    ^
         -IC CP037 -Delimiter ,

哪里

  • In/DTAR020.bin 是输入Cobol数据文件
  • Out/o_DTAR020_space.csv 是输出的Csv文件
  • ** DTAR020.cbl **是Cobol抄写本
  • Fixed_Length 将其标识为固定长度的文件(大型机上的FB)
  • In/DTAR020.bin is the Input Cobol data file
  • Out/o_DTAR020_space.csv is the output Csv file
  • **DTAR020.cbl ** is the Cobol Copybook
  • Fixed_Length idicates it a fixed length File (FB on the Mainframe)
  • To edit the file see How do you edit a Binary Mainframe file in the RecordEditor using a Cobol Copybook (pt1)
  • To generate JRecord Code see How do you generate java~jrecord code for a Cobol copybook

这篇关于EBCDIC到ASCII的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆