

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 Micro Focus 轉換具有複雜記錄配置的大型主機資料檔案
<a name="convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus"></a>

*Peter West，Amazon Web Services*

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

注意： AWS Mainframe Modernization 服務 （受管執行期環境體驗） 不再開放給新客戶。對於類似 AWS Mainframe Modernization Service （受管執行期環境體驗） 的功能，請探索 AWS Mainframe Modernization Service （自我管理體驗）。現有客戶可以繼續正常使用該服務。如需詳細資訊，請參閱[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. 使用傳統資料檔案工具或資料檔案工具測試結構檔案。

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

**先決條件**
+ 作用中的 AWS 帳戶
+ 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 Developer](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-8D6B7358-AC35-4DAF-A445-607D8D97EBB2.html) 為使用 Enterprise Developer 的任何整合開發環境 (IDE) 變體建立的應用程式提供執行環境。
+ Micro Focus [Classic Data File Tools](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-06115324-0FBC-4CB7-BE9D-04BCFEA5821A.html) 可協助您轉換、導覽、編輯和建立資料檔案。傳統資料檔案工具包括[資料檔案轉換器](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 [資料檔案工具](https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-Eclipse/GUID-B1BCB613-6947-451C-8F71-72FB8254076A.html)可協助您建立、編輯和移動資料檔案。資料檔案工具包括[資料檔案編輯器](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>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 識別來源元件。 | 識別檔案的所有可能記錄配置，包括包含非文字資料的任何重新定義。如果您有包含重新定義的配置，您必須將這些配置分解為唯一配置，描述資料結構的每個可能變動。一般而言，資料檔案的記錄配置可以由下列原型描述：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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_tw/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 會影響 OCCURS VARYING 結構的填補。如果這些指令設定不正確，轉換工具將無法正確讀取資料記錄。這會導致轉換後檔案中的資料錯誤。 | 應用程式開發人員 | 

### （選項 A) 使用傳統資料檔案工具建立結構檔案
<a name="option-a-create-the-structure-file-using-classic-data-file-tools"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 啟動工具並載入字典。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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_tw/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_tw/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 應用程式開發人員 | 

### （選項 B) 使用資料檔案工具建立結構檔案
<a name="option-b-create-the-structure-file-using-data-file-tools"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 啟動工具並載入字典。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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_tw/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_tw/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 應用程式開發人員 | 

### （選項 A) 使用傳統資料檔案工具測試結構檔案
<a name="option-a-test-the-structure-file-using-classic-data-file-tools"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 測試 EBCDIC 資料檔案。 | 確認您可以使用結構檔案來正確檢視 EBCDIC 測試資料檔案。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 應用程式開發人員 | 

### （選項 B) 使用資料檔案工具測試結構檔案
<a name="option-b-test-the-structure-file-using-data-file-tools"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 測試 EBCDIC 資料檔案。 | 確認您可以使用結構檔案來正確檢視 EBCDIC 測試資料檔案。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/convert-mainframe-data-files-with-complex-record-layouts-using-micro-focus.html) | 應用程式開發人員 | 

### 測試資料檔案轉換
<a name="test-data-file-conversion"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 測試 EBCDIC 檔案的轉換。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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 Focus 文件）
+ [大型主機和舊版程式碼](https://aws.amazon.com/blogs/?awsf.blog-master-category=category%23mainframe-and-legacy) (AWS 部落格文章）
+ [AWS 規範指引](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 文件）