

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Micro Focus 转换具有复杂记录布局的大型机数据文件
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus"></a>

*彼得·韦斯特，亚马逊 Web Services*

## Summary
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus-summary"></a>

注意： AWS Mainframe Modernization 服务（托管运行时环境体验）不再向新客户开放。要获得与 AWS Mainframe Modernization 服务（托管运行时环境体验）类似的功能，请浏览 AWS Mainframe Modernization 服务（自我管理体验）。现有客户可以继续正常使用该服务。有关更多信息，请参阅 [AWS Mainframe Modernization 可用性变更](https://docs.aws.amazon.com/m2/latest/userguide/mainframe-modernization-availability-change.html)。

此模式向您展示如何使用 Micro Focus 结构文件将包含非文本数据和复杂记录布局的大型机数据文件从 EBCDIC（扩展二进制编码十进制交换码）字符编码转换为 ASCII（美国信息交换标准代码）字符编码。若要完成文件转换，您必须执行以下操作：

1. 准备描述大型机环境中所有数据项和记录布局的单一源文件。

1. 使用 Micro Focus 数据文件编辑器作为 Micro Focus Classic Data File Tools 或 Data File Tools，创建包含数据记录布局的结构文件。结构文件可识别非文本数据，以便您可正确地将大型机文件从 EBCDIC 转换为 ASCII。

1. 通过Classic Data File Tools 或 Data File Tools 测试结构文件。

## 先决条件和限制
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus-prereqs"></a>

**先决条件**
+ 一个有效的 Amazon Web Services account
+ Micro Focus Enterprise Developer for Windows，可通过 [AWS Mainframe Modernization](https://aws.amazon.com/mainframe-modernization/) 获得

**产品版本**
+ Micro Focus Enterprise Server 7.0 和更高版本

## 工具
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus-tools"></a>
+ [Micro Focus Enterprise Server](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-8D6B7358-AC35-4DAF-A445-607D8D97EBB2.html) 为使用企业开发人员的任何集成式开发环境（IDE）变体创建的应用程序提供运行环境。
+ Micro Focus [Classic Data File Tools](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-06115324-0FBC-4CB7-BE9D-04BCFEA5821A.html) 可帮您转换、导航、编辑和创建数据文件。Classic Data File Tools 包括[数据文件转换器](https://www.microfocus.com/documentation/visual-cobol/vc60/VS2017/BKFHFHDFCV.html)、[记录布局编辑器](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/BKFHFHRLMF.html)以及[数据文件编辑器](https://www.microfocus.com/documentation/visual-cobol/vc60/VS2017/BKFHFHDFED.html)。
+ Micro Focus [Data File Tools](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-B1BCB613-6947-451C-8F71-72FB8254076A.html) 可创建、编辑和移动数据文件。Data File Tools 包括[数据文件编辑器](https://www.microfocus.com/documentation/visual-cobol/vc60/VS2017/BKFHFHDFED.html)、[文件转换实用程序](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/BKFHFHCONV.html)和[数据文件结构命令行实用程序](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-E84348EB-A93A-481A-A47C-61B0E1C076E6.html)。

## 操作说明
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus-epics"></a>

### 准备源文件
<a name="prepare-the-source-file"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 确定源组件。 | 确定文件的所有可能的记录布局，包含任何包含非文本数据的重新定义。如果您的布局包含重新定义，则必须将这些布局分解为描述数据结构每种可能排列的独特布局。通常，数据文件记录布局可以用以下原型来描述：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html)有关为包含复杂记录布局的文件创建扁平化记录布局的更多信息，请参阅在 [ASCII 环境中重新托管 EBCDIC 应用程序以进行大型机迁移](https://docs.aws.amazon.com/prescriptive-guidance/latest/mainframe-rehost-ebcdic-ascii/introduction.html)。 | 应用程序开发人员 | 
| 确定记录布局条件。 | 对于具有多个记录布局的文件或包含带有 REDEFINES 子句的复杂布局的文件，请标识记录中的数据和条件，您可使用这些数据和条件来定义转换期间要使用的布局。我们建议您与了解处理此文件的程序的主题专家 (SME) 讨论此任务。例如，文件可能包含两种包含非文本数据的记录类型。您可检查源代码，并可能找到类似以下代码的代码：<pre>MOVE "M" TO PART-TYPE<br /> MOVE "MAIN ASSEMBLY" TO PART-NAME<br />MOVE "S" TO PART-TYPE<br /> MOVE "SUB ASSEMBLY 1" TO PART-NAME</pre>代码可帮您识别以下内容：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html)您可记录此字段用于将记录布局与文件中的正确数据记录关联的值。 | 应用程序开发人员 | 
| 生成源文件。 | 如果文件通过多个源文件描述，或者如果记录布局包含从属于 REDEFINES 子句的非文本数据，则创建一个包含记录布局的新源文件。新程序不需要使用 SELECT 和 FD 语句描述文件。该程序可以简单地将记录描述含为 Working-Storage 中的 01 个级别。您可为每个数据文件创建一个源文件，也可以创建一个描述所有数据文件的主源文件。 | 应用程序开发人员 | 
| 编译源文件。 | 编译源文件，以构建数据目录。我们建议您使用 EBCDIC 字符集来编译源文件。如果使用 IBMCOMP 指令或 ODOSLIDE 指令，则也必须在源文件中使用这些指令。IBMCOMP 会影响 COMP 字段字节存储，而 ODOSLIDE 会影响发生变化结构的填充。如果此指令设置不正确，则转换工具将无法正确读取数据记录。这会导致转换后的文件中显示错误数据。 | 应用程序开发人员 | 

### (选项 A) 使用 Classic Data File Tools 创建结构文件
<a name="option-a-create-the-structure-file-using-classic-data-file-tools"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 启动该工具并加载目录。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 
| 创建默认记录布局。 | 对所有与任何条件布局不匹配的记录使用默认记录布局。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html)默认布局显示在**布局**窗格中，可以通过红色文件夹图标进行识别。 | 应用程序开发人员 | 
| 创建有条件记录布局。 | 当文件中包含多个记录布局时，请使用条件记录布局。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 

### （选项 B）使用 Data File Tools 创建结构文件
<a name="option-b-create-the-structure-file-using-data-file-tools"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 启动该工具并加载目录。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 
| 创建默认记录布局。 | 对所有不匹配任何条件布局的记录使用默认记录布局。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html)默认布局显示在**布局**窗格中，可以通过蓝色“D”图标进行识别。 | 应用程序开发人员 | 
| 创建有条件记录布局。 | 当文件中包含多个记录布局时，请使用条件记录布局。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 

### (选项 A )使用 Classic Data File Tools 测试结构文件
<a name="option-a-test-the-structure-file-using-classic-data-file-tools"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 测试 EBCDIC 数据文件。 | 确认您可使用结构文件正确查看 EBCDIC 测试数据文件。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 

### (选项 B )使用 Data File Tools 测试结构文件
<a name="option-b-test-the-structure-file-using-data-file-tools"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 测试 EBCDIC 数据文件。 | 确认您可使用结构文件正确查看 EBCDIC 测试数据文件。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 

### 测试数据文件转换
<a name="test-data-file-conversion"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 测试 EBCDIC 文件转换。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 应用程序开发人员 | 

## 相关资源
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus-resources"></a>
+ [Micro Focus](https://www.microfocus.com/en-us/products/enterprise-suite/overview)（Micro 文档）
+ [大型机和遗留代码](https://aws.amazon.com/blogs/?awsf.blog-master-category=category%23mainframe-and-legacy)（AWS Blog 文章）
+ [AWS Prescriptive Guidance](https://docs.aws.amazon.com/prescriptive-guidance/)（AWS 文档）
+ [AWS 文档](https://docs.aws.amazon.com/index.html)（AWS 文档）
+ [AWS 一般参考](https://docs.aws.amazon.com/general/latest/gr/Welcome.html)（AWS 文档）
+ [AWS 词汇表](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html)（AWS 文档）