JP2018025852A - Program analysis method, program analyzer and analysis program - Google Patents

Program analysis method, program analyzer and analysis program Download PDF

Info

Publication number
JP2018025852A
JP2018025852A JP2016155457A JP2016155457A JP2018025852A JP 2018025852 A JP2018025852 A JP 2018025852A JP 2016155457 A JP2016155457 A JP 2016155457A JP 2016155457 A JP2016155457 A JP 2016155457A JP 2018025852 A JP2018025852 A JP 2018025852A
Authority
JP
Japan
Prior art keywords
program
file
programs
types
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2016155457A
Other languages
Japanese (ja)
Inventor
西川 清
Kiyoshi Nishikawa
清 西川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2016155457A priority Critical patent/JP2018025852A/en
Publication of JP2018025852A publication Critical patent/JP2018025852A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide information that contributes to an increase in the efficiency of program correction.SOLUTION: A storage unit 11 stores a program asset 13 that includes a plurality of programs accessing the same file. An arithmetic unit 12 extracts, from the program asset 13, data structure definition statements 14a, 14b, 14c, 14d, 14e, 14f each indicating the structure of data stored in a file. The arithmetic unit 12 classifies these data structure definition statements into types 15a, 15b, 15c on the basis of comparison among the data structure definition statements 14a, 14b, 14c, 14d, 14e, 14f, and counts, for each of the types 15a, 15b, 15c, the number of programs that use a data structure definition statement that belongs to the type. The arithmetic unit 12 outputs distribution information 16 that indicates the distribution of the number of programs among the types 15a, 15b, 15c.SELECTED DRAWING: Figure 1

Description

本発明はプログラム分析方法、プログラム分析装置および分析プログラムに関する。   The present invention relates to a program analysis method, a program analysis apparatus, and an analysis program.

情報処理システムで使用されるプログラムは、長期間の運用に伴って拡張や変更が繰り返されることが多い。その結果として、プログラムの記述方法に一貫性がなくなることや、実質的に同じ内容の命令文が様々なプログラムに重複して記述されることがあり、当該プログラムの保守性が低下してしまうことがある。保守性の低いプログラムを使用し続けると、プログラムの可読性が低いために保守作業量が増大し、保守コストが大きくなってしまう。そこで、保守性が低くなったプログラムの構造を見直して再設計し、保守コストが小さくなるようにプログラムを修正することがある。   A program used in an information processing system is frequently expanded or changed with a long-term operation. As a result, the program description method may become inconsistent, and imperative statements with substantially the same content may be duplicated in various programs, reducing the maintainability of the program. There is. If a program with low maintainability is used continuously, the readability of the program is low, so the amount of maintenance work increases and the maintenance cost increases. Therefore, the structure of a program with low maintainability may be reviewed and redesigned, and the program may be modified to reduce maintenance costs.

プログラムの保守性が低くなる状況の1つとして、複数のプログラムが同一のファイルにアクセスする状況が挙げられる。ファイルにアクセスするプログラムには、当該ファイルから読み込むデータまたは当該ファイルに書き込むデータの構造を示すデータ構造定義文が記述されることがある。データ構造定義文では、例えば、1以上のデータ項目の項目名やデータ型が定義される。ここで、同じファイルにアクセスする複数のプログラムに、実質的に同じ内容のデータ構造定義文が記述されることが生じ得る。これら複数のプログラムのデータ構造定義文は、データ項目の項目名などが統一されていないために、互いに若干異なることがある。この状況では、ファイルに格納するデータの構造を変えようとすると各プログラムに応じた変更を行うことになり、プログラムの保守性が低くなる。   One situation in which the maintainability of the program is low is a situation in which a plurality of programs access the same file. In a program that accesses a file, a data structure definition statement indicating the structure of data read from the file or data written to the file may be described. In the data structure definition statement, for example, item names and data types of one or more data items are defined. Here, it may occur that data structure definition statements having substantially the same contents are described in a plurality of programs that access the same file. The data structure definition statements of the plurality of programs may be slightly different from each other because the item names of the data items are not unified. In this situation, if the structure of the data stored in the file is to be changed, the change is made according to each program, and the maintainability of the program is lowered.

そこで、例えば、データ項目名の統一を支援するソフトウェア標準化方法が提案されている。提案のソフトウェア標準化方法では、同じファイルにアクセスする複数のプログラムに定義されたデータ項目名を抽出し、抽出したデータ項目名を列挙した画面を表示する。列挙されたデータ項目名を参考にしてユーザに標準データ項目名を入力させ、プログラム中のデータ項目名を標準データ項目名に自動的に置換する。   Therefore, for example, a software standardization method that supports unification of data item names has been proposed. In the proposed software standardization method, data item names defined in a plurality of programs accessing the same file are extracted, and a screen listing the extracted data item names is displayed. The user inputs a standard data item name with reference to the enumerated data item names, and automatically replaces the data item name in the program with the standard data item name.

また、例えば、標準化装置が提案されている。提案の標準化装置は、同じファイルにアクセスする複数のプログラムに定義されたデータ項目名を抽出し、抽出したデータ項目名を列挙した画面を表示する。標準化装置は、列挙されたデータ項目名の中からユーザに標準データ項目名を選択させる。標準化装置は、ユーザが選択した標準データ項目名を元のプログラムとは異なる外部ファイルに保存し、プログラムに含まれるデータ構造定義文を削除し、当該外部ファイルを参照するようにプログラムを修正する。   For example, a standardization device has been proposed. The proposed standardization apparatus extracts data item names defined in a plurality of programs that access the same file, and displays a screen listing the extracted data item names. The standardization apparatus causes the user to select a standard data item name from among the listed data item names. The standardization apparatus saves the standard data item name selected by the user in an external file different from the original program, deletes the data structure definition sentence included in the program, and corrects the program to refer to the external file.

また、例えば、プログラム修正支援装置が提案されている。提案のプログラム修正支援装置は、プログラムに定義されたデータ項目毎に、当該プログラムのロジック中で使用されている回数をカウントし、使用回数が多いデータ項目を検討候補としてユーザに提示する。また、例えば、リエンジニアリング支援装置が提案されている。提案のリエンジニアリング支援装置は、プログラムを分析し、プログラムで使用されるデータ項目それぞれについて、データ項目名などの定義が外部ファイルに記載されている割合などの各種指標値を算出する。リエンジニアリング支援装置は、算出した指標値を所定の業界標準値と比較することで、プログラムの修正に要する日数や資金を見積もる。   For example, a program correction support apparatus has been proposed. For each data item defined in the program, the proposed program correction support device counts the number of times the program is used in the logic of the program, and presents the data item with a large number of uses to the user as a candidate for examination. For example, a re-engineering support device has been proposed. The proposed re-engineering support apparatus analyzes the program and calculates various index values such as a ratio in which definitions such as data item names are described in the external file for each data item used in the program. The re-engineering support apparatus estimates the number of days and funds required to modify the program by comparing the calculated index value with a predetermined industry standard value.

特開平6−187136号公報JP-A-6-187136 特開平7−104989号公報Japanese Patent Application Laid-Open No. 7-104989 特開平11−265285号公報JP-A-11-265285 特開2001−265625号公報JP 2001-265625 A

しかし、上記特許文献1,2に記載の技術においてユーザに提供される情報は、現在プログラムで使用されている複数通りのデータ項目名のみである。このため、プログラム修正の効率化に資する情報を提供するという点で改善の余地がある。   However, the information provided to the user in the techniques described in Patent Documents 1 and 2 is only a plurality of data item names currently used in the program. For this reason, there is room for improvement in terms of providing information that contributes to the efficiency of program correction.

例えば、現在使用されている複数通りのデータ項目名の中から標準データ項目名を選択する場合において、何れを標準データ項目名として選択すればよいかの判断に役立つ何らかの情報が提供されることが好ましい。また、例えば、限られた時間で保守性改善効果の大きいプログラム修正を行いたい場合において、何れのデータ項目名を優先的に検討すればよいかの判断に役立つ何らかの情報が提供されることが好ましい。   For example, when a standard data item name is selected from a plurality of currently used data item names, some information is provided to help determine which one should be selected as the standard data item name. preferable. In addition, for example, in the case where it is desired to modify a program having a large maintainability improvement effect in a limited time, it is preferable that some information that is useful for determining which data item name should be preferentially examined is provided. .

1つの側面では、本発明は、プログラム修正の効率化に資する情報を提供できるプログラム分析方法、プログラム分析装置および分析プログラムを提供することを目的とする。   In one aspect, an object of the present invention is to provide a program analysis method, a program analysis apparatus, and an analysis program that can provide information that contributes to the efficiency of program correction.

1つの態様では、コンピュータが実行するプログラム分析方法が提供される。同一のファイルにアクセスする複数のプログラムを含むプログラム資産から、それぞれがファイルに格納されるデータの構造を示す複数のデータ構造定義文を抽出する。複数のデータ構造定義文の間の比較に基づいて複数のデータ構造定義文を複数のタイプに分類し、複数のタイプそれぞれについて複数のプログラムのうち当該タイプに属するデータ構造定義文を使用するプログラムの数をカウントする。複数のタイプの間のプログラムの数の分布を示す分布情報を出力する。   In one aspect, a program analysis method executed by a computer is provided. A plurality of data structure definition statements each indicating a structure of data stored in the file are extracted from a program asset including a plurality of programs accessing the same file. A program that classifies a plurality of data structure definition statements into a plurality of types based on a comparison between a plurality of data structure definition statements, and uses a data structure definition statement belonging to that type among a plurality of programs for each of the plurality of types. Count the number. Output distribution information indicating the distribution of the number of programs among multiple types.

また、1つの態様では、記憶部と演算部とを有するプログラム分析装置が提供される。また、1つの態様では、コンピュータに実行させる分析プログラムが提供される。   In one aspect, a program analysis device having a storage unit and a calculation unit is provided. In one aspect, an analysis program to be executed by a computer is provided.

1つの側面では、プログラム修正の効率化に資する情報を提供できる。   In one aspect, information that contributes to efficient program modification can be provided.

第1の実施の形態のプログラム分析装置の例を示す図である。It is a figure which shows the example of the program analysis apparatus of 1st Embodiment. プログラム分析装置のハードウェア例を示すブロック図である。It is a block diagram which shows the hardware example of a program analyzer. 第1のレコード定義方法の例を示す図である。It is a figure which shows the example of the 1st record definition method. 第2のレコード定義方法の例を示す図である。It is a figure which shows the example of the 2nd record definition method. JCLファイルの例を示す図である。It is a figure which shows the example of a JCL file. ファイル参照テーブルの例を示す図である。It is a figure which shows the example of a file reference table. レコード定義のタイプ分類例を示す図である。It is a figure which shows the type classification example of a record definition. レコード定義のタイプ分類例を示す図(続き)である。It is a figure (continuation) which shows the type classification example of a record definition. タイプ分類テーブルの例を示す図である。It is a figure which shows the example of a type classification table. レコード定義分布の第1の可視化例を示す図である。It is a figure which shows the 1st visualization example of a record definition distribution. レコード定義分布の第2の可視化例を示す図である。It is a figure which shows the 2nd example of visualization of a record definition distribution. プログラム修正効果の可視化例を示す図である。It is a figure which shows the example of visualization of a program correction effect. プログラム分析装置の機能例を示すブロック図である。It is a block diagram which shows the function example of a program analyzer. プログラム分析の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of a program analysis. プログラム分析の手順例を示すフローチャート(続き)である。It is a flowchart (continuation) which shows the example of a procedure of a program analysis.

以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
第1の実施の形態を説明する。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
A first embodiment will be described.

図1は、第1の実施の形態のプログラム分析装置の例を示す図である。
第1の実施の形態のプログラム分析装置10は、既存のプログラム資産の保守性を向上させて情報処理システムの保守コストを低下させるときに使用される。プログラム分析装置10は、既存のプログラム資産を分析し、プログラム資産の修正作業を支援する。プログラム分析装置10は、ユーザが操作するクライアント装置でもよいし、クライアント装置からネットワーク経由でアクセスされるサーバ装置でもよい。
FIG. 1 is a diagram illustrating an example of a program analysis apparatus according to the first embodiment.
The program analysis apparatus 10 according to the first embodiment is used when improving the maintainability of existing program assets and reducing the maintenance cost of the information processing system. The program analysis apparatus 10 analyzes an existing program asset and supports a modification operation of the program asset. The program analysis device 10 may be a client device operated by a user or a server device accessed from a client device via a network.

プログラム分析装置10は、記憶部11および演算部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。演算部12は、例えば、CPU(Central Processing Unit)やDSP(Digital Signal Processor)などのプロセッサである。ただし、演算部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。プロセッサは、RAMなどのメモリ(記憶部11でもよい)に記憶されたプログラムを実行する。プログラムには、分析プログラムが含まれる。複数のプロセッサの集合(マルチプロセッサ)を「プロセッサ」と呼ぶこともある。   The program analysis device 10 includes a storage unit 11 and a calculation unit 12. The storage unit 11 may be a volatile semiconductor memory such as a RAM (Random Access Memory) or a non-volatile storage such as an HDD (Hard Disk Drive) or a flash memory. The computing unit 12 is, for example, a processor such as a CPU (Central Processing Unit) or a DSP (Digital Signal Processor). However, the calculation unit 12 may include an electronic circuit for a specific application such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). The processor executes a program stored in a memory such as a RAM (or the storage unit 11). The program includes an analysis program. A set of multiple processors (multiprocessor) may be referred to as a “processor”.

記憶部11は、プログラム資産13を記憶する。プログラム資産13は、同一のファイルにアクセスする複数のプログラムを含む。これら複数のプログラムの一部または全部は、当該同一のファイルからデータを読み出すプログラムであってもよい。また、これら複数のプログラムの一部または全部は、当該同一のファイルにデータを書き込むプログラムであってもよい。プログラム資産13に含まれるプログラムは、例えば、COBOLなどのプログラミング言語によって記述されたソースプログラムである。   The storage unit 11 stores program assets 13. The program asset 13 includes a plurality of programs that access the same file. Some or all of the plurality of programs may be programs that read data from the same file. Further, some or all of the plurality of programs may be programs that write data in the same file. The program included in the program asset 13 is a source program described in a programming language such as COBOL, for example.

複数のプログラムそれぞれは、例えば、ファイルに格納されるデータ(読み出すデータまたは書き込むデータ)の構造を示すデータ構造定義文を含む。ただし、これら複数のプログラムの一部は、データ構造定義を記載した外部ファイルを参照するものであってもよい。データ構造定義を記載した外部ファイルをプログラムから参照することは、例えば、COPY文やinclude文などを用いて行うことができる。プログラム資産13は、このような外部ファイルを含んでもよい。データ構造定義文は、例えば、ファイルに格納されるデータに含まれる1以上のデータ項目を識別するための1以上のデータ項目名と、当該1以上のデータ項目に対応する1以上のデータ型とを含む。   Each of the plurality of programs includes, for example, a data structure definition statement indicating the structure of data (read data or write data) stored in a file. However, some of the plurality of programs may refer to an external file that describes the data structure definition. The external file describing the data structure definition can be referred to from a program using, for example, a COPY statement or an include statement. The program asset 13 may include such an external file. The data structure definition statement includes, for example, one or more data item names for identifying one or more data items included in data stored in a file, and one or more data types corresponding to the one or more data items. including.

プログラム資産13の中には、同一のファイルに対して異なるデータ構造定義文を使用するプログラムが混在している。これは、例えば、プログラム資産13の拡張や変更を繰り返す過程で、プログラム間でデータ項目名が統一されなかったことにより生じ得る。また、これは、例えば、処理ロジックを記述する都合上、既存のプログラムで使用しているデータ型とは異なるデータ型を用いて新たなプログラムを作成したことにより生じ得る。また、これは、例えば、2以上のデータ項目の集合を集団項目とみなし、集団項目に対して独自の集団項目名を定義したことにより生じ得る。   In the program resource 13, there are mixed programs that use different data structure definition statements for the same file. This may occur, for example, because the data item names are not unified between programs in the process of repeatedly expanding or changing the program asset 13. Further, this may occur, for example, by creating a new program using a data type different from the data type used in the existing program for the convenience of describing the processing logic. In addition, this can be caused by, for example, considering a set of two or more data items as a group item and defining a unique group item name for the group item.

演算部12は、記憶部11に記憶されたプログラム資産13を分析し、同一のファイルに対する異なるデータ構造定義文の使用状況を可視化する。演算部12は、プログラム資産13から、同一のファイルに格納されるデータの構造を示す複数のデータ構造定義文を抽出する。例えば、演算部12は、プログラム資産13から、図1に示すデータ構造定義文14a,14b,14c,14d,14e,14fを抽出する。   The calculation unit 12 analyzes the program asset 13 stored in the storage unit 11 and visualizes the usage status of different data structure definition statements for the same file. The computing unit 12 extracts a plurality of data structure definition statements indicating the structure of data stored in the same file from the program asset 13. For example, the computing unit 12 extracts the data structure definition statements 14a, 14b, 14c, 14d, 14e, and 14f shown in FIG.

データ構造定義文14a,14b,14c,14d,14e,14fは、例えば、互いに異なるプログラムに記述されていたデータ構造定義文である。データ構造定義文14a,14d,14fは、データ項目名が「key−item」でありデータ型が「X(10)」であることを示している。データ構造定義文14b,14eは、データ項目名が「key−item」でありデータ型が「N(5)」であることを示している。データ構造定義文14cは、データ項目名が「item−01」でありデータ型が「X(10)」であることを示している。ここで、「X(10)」は半角10文字を表し、「N(5)」は全角5文字を表しており、両者は同じデータ長を示している。   The data structure definition statements 14a, 14b, 14c, 14d, 14e, and 14f are, for example, data structure definition statements described in different programs. The data structure definition statements 14a, 14d, and 14f indicate that the data item name is “key-item” and the data type is “X (10)”. The data structure definition statements 14b and 14e indicate that the data item name is “key-item” and the data type is “N (5)”. The data structure definition statement 14c indicates that the data item name is “item-01” and the data type is “X (10)”. Here, “X (10)” represents 10 half-width characters, “N (5)” represents 5 full-width characters, and both indicate the same data length.

演算部12は、抽出した複数のデータ構造定義文の間の比較に基づいて、複数のデータ構造定義文を複数のタイプに分類する。例えば、演算部12は、異なるデータ型を使用するデータ構造定義文を異なるタイプに分類する。また、例えば、演算部12は、異なるデータ項目名を使用するデータ構造定義文を原則として異なるタイプに分類する。ただし、演算部12は、データ項目名の一部分(例えば、接頭辞)のみ異なるデータ構造定義文など、類似するデータ項目名を使用するデータ構造定義文を同じタイプに分類してもよい。   The computing unit 12 classifies the plurality of data structure definition sentences into a plurality of types based on comparison between the extracted plurality of data structure definition sentences. For example, the calculation unit 12 classifies data structure definition sentences that use different data types into different types. In addition, for example, the arithmetic unit 12 classifies data structure definition sentences using different data item names into different types in principle. However, the calculation unit 12 may classify data structure definition statements that use similar data item names into the same type, such as data structure definition statements that differ only in part of the data item names (for example, prefixes).

上記のデータ構造定義文14a,14b,14c,14d,14e,14fは、例えば、タイプ15a,15b,15cに分類される。すなわち、データ構造定義文14a,14d,14fはタイプ15aに分類される。データ構造定義文14b,14eはデータ型がタイプ15aと異なるため、タイプ15bに分類される。データ構造定義文14cはデータ項目名がタイプ15a,15bと異なるため、タイプ15cに分類される。   The data structure definition statements 14a, 14b, 14c, 14d, 14e, and 14f are classified into, for example, types 15a, 15b, and 15c. That is, the data structure definition statements 14a, 14d, and 14f are classified into the type 15a. The data structure definition statements 14b and 14e are classified into the type 15b because the data type is different from the type 15a. The data structure definition statement 14c is classified into the type 15c because the data item name is different from the types 15a and 15b.

演算部12は、複数のタイプそれぞれについて、当該タイプに属するデータ構造定義文を使用するプログラムの数をカウントする。上記のタイプ15aのプログラム数は3、タイプ15bのプログラム数は2、タイプ15cのプログラム数は1である。   For each of the plurality of types, the calculation unit 12 counts the number of programs that use the data structure definition statement belonging to the type. The number of programs of type 15a is 3, the number of programs of type 15b is 2, and the number of programs of type 15c is 1.

そして、演算部12は、複数のタイプの間のプログラム数の分布を示す分布情報16を出力する。例えば、演算部12は、プログラム分析装置10に接続されたディスプレイに分布情報16を表示させる。また、例えば、演算部12は、他の装置に分布情報16を送信する。分布情報16は、複数のタイプそれぞれのプログラム数を示すグラフ(例えば、積み上げ棒グラフ)であってもよい。また、分布情報16は、複数のタイプの間のプログラム数の比を示すグラフ(例えば、円グラフ)であってもよい。演算部12は、分布情報16と併せて、各タイプに属するデータ構造定義文を出力してもよい。   And the calculating part 12 outputs the distribution information 16 which shows distribution of the number of programs among several types. For example, the calculation unit 12 displays the distribution information 16 on a display connected to the program analysis device 10. Further, for example, the calculation unit 12 transmits the distribution information 16 to another device. The distribution information 16 may be a graph (for example, a stacked bar graph) indicating the number of programs of each of a plurality of types. Further, the distribution information 16 may be a graph (for example, a pie chart) indicating a ratio of the number of programs among a plurality of types. The calculation unit 12 may output a data structure definition sentence belonging to each type together with the distribution information 16.

第1の実施の形態のプログラム分析装置10によれば、プログラム資産13から同一のファイルに対する複数のデータ構造定義文が抽出され、抽出された複数のデータ構造定義文が比較されて複数のタイプに分類される。そして、複数のタイプそれぞれについて当該タイプに属するデータ構造定義文を使用するプログラムの数がカウントされ、複数のタイプの間のプログラム数の分布を示す分布情報16が出力される。   According to the program analysis apparatus 10 of the first embodiment, a plurality of data structure definition sentences for the same file are extracted from the program asset 13, and the plurality of extracted data structure definition sentences are compared to a plurality of types. being classified. Then, for each of the plurality of types, the number of programs using the data structure definition statement belonging to the type is counted, and distribution information 16 indicating the distribution of the number of programs among the plurality of types is output.

これにより、同一のファイルに対する複数のデータ構造定義文の使用状況を可視化することができ、プログラム資産13の修正の効率化に資する情報を提供することができる。例えば、複数のデータ構造定義文を集約する(例えば、データ項目名を統一する)にあたり、複数のタイプのうち最もプログラム数の多いタイプを標準データ構造定義文として選択することで、修正作業を効率化することができる。また、例えば、プログラム数の多いタイプを優先的に修正対象として検討することで、限られた時間の中で保守性改善効果の大きい修正作業を優先的に行うことが可能となる。   As a result, it is possible to visualize the usage status of a plurality of data structure definition statements for the same file, and to provide information that contributes to efficient modification of the program asset 13. For example, when aggregating multiple data structure definition statements (for example, unifying data item names), selecting the type with the largest number of programs as the standard data structure definition statement from multiple types makes the correction work more efficient Can be Further, for example, by considering a type having a large number of programs as a correction target with priority, it is possible to preferentially perform a correction operation having a large effect of improving maintainability within a limited time.

[第2の実施の形態]
次に、第2の実施の形態を説明する。
図2は、プログラム分析装置のハードウェア例を示すブロック図である。
[Second Embodiment]
Next, a second embodiment will be described.
FIG. 2 is a block diagram illustrating a hardware example of the program analysis apparatus.

プログラム分析装置100は、CPU101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106および通信インタフェース107を有する。CPU101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106および通信インタフェース107は、バス108に接続されている。なお、プログラム分析装置100は、第1の実施の形態のプログラム分析装置10に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。CPU101は、第1の実施の形態の演算部12に対応する。   The program analysis apparatus 100 includes a CPU 101, a RAM 102, an HDD 103, an image signal processing unit 104, an input signal processing unit 105, a medium reader 106, and a communication interface 107. The CPU 101, RAM 102, HDD 103, image signal processing unit 104, input signal processing unit 105, medium reader 106, and communication interface 107 are connected to a bus 108. The program analysis device 100 corresponds to the program analysis device 10 of the first embodiment. The RAM 102 or the HDD 103 corresponds to the storage unit 11 of the first embodiment. The CPU 101 corresponds to the calculation unit 12 of the first embodiment.

CPU101は、プログラムの命令を実行する演算回路を含むプロセッサである。CPU101は、HDD103に記憶されたプログラムやデータの少なくとも一部をRAM102にロードし、プログラムを実行する。なお、CPU101は複数のプロセッサコアを備えてもよく、プログラム分析装置100は複数のプロセッサを備えてもよく、以下で説明する処理を複数のプロセッサまたはプロセッサコアを用いて並列に実行してもよい。また、複数のプロセッサの集合(マルチプロセッサ)を「プロセッサ」と呼んでもよい。   The CPU 101 is a processor including an arithmetic circuit that executes program instructions. The CPU 101 loads at least a part of the program and data stored in the HDD 103 into the RAM 102 and executes the program. The CPU 101 may include a plurality of processor cores, the program analysis apparatus 100 may include a plurality of processors, and the processes described below may be executed in parallel using a plurality of processors or processor cores. . A set of processors (multiprocessor) may be called a “processor”.

RAM102は、CPU101が実行するプログラムやCPU101が演算に用いるデータを一時的に記憶する揮発性の半導体メモリである。なお、プログラム分析装置100は、RAM以外の種類のメモリを備えてもよく、複数個のメモリを備えてもよい。   The RAM 102 is a volatile semiconductor memory that temporarily stores programs executed by the CPU 101 and data used by the CPU 101 for calculations. Note that the program analysis apparatus 100 may include a type of memory other than the RAM, or may include a plurality of memories.

HDD103は、OS(Operating System)やミドルウェアやアプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性の記憶装置である。プログラムには、分析プログラムが含まれる。なお、プログラム分析装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の記憶装置を備えてもよく、複数の不揮発性の記憶装置を備えてもよい。   The HDD 103 is a non-volatile storage device that stores an OS (Operating System), software programs such as middleware and application software, and data. The program includes an analysis program. The program analysis apparatus 100 may include other types of storage devices such as a flash memory and an SSD (Solid State Drive), and may include a plurality of nonvolatile storage devices.

画像信号処理部104は、CPU101からの命令に従って、プログラム分析装置100に接続されたディスプレイ111に画像を出力する。ディスプレイ111としては、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ(LCD:Liquid Crystal Display)、プラズマディスプレイ(PDP:Plasma Display Panel)、有機EL(OEL:Organic Electro-Luminescence)ディスプレイなどを用いることができる。   The image signal processing unit 104 outputs an image to the display 111 connected to the program analysis apparatus 100 in accordance with a command from the CPU 101. As the display 111, a CRT (Cathode Ray Tube) display, a liquid crystal display (LCD), a plasma display (PDP), an organic electro-luminescence (OEL) display, or the like can be used. .

入力信号処理部105は、プログラム分析装置100に接続された入力デバイス112から入力信号を取得し、CPU101に出力する。入力デバイス112としては、マウスやタッチパネルやタッチパッドやトラックボールなどのポインティングデバイス、キーボード、リモートコントローラ、ボタンスイッチなどを用いることができる。また、プログラム分析装置100に、複数の種類の入力デバイスが接続されていてもよい。   The input signal processing unit 105 acquires an input signal from the input device 112 connected to the program analysis apparatus 100 and outputs it to the CPU 101. As the input device 112, a mouse, a touch panel, a touch pad, a pointing device such as a trackball, a keyboard, a remote controller, a button switch, or the like can be used. A plurality of types of input devices may be connected to the program analysis apparatus 100.

媒体リーダ106は、記録媒体113に記録されたプログラムやデータを読み取る読み取り装置である。記録媒体113として、例えば、磁気ディスク、光ディスク、光磁気ディスク(MO:Magneto-Optical disk)、半導体メモリなどを使用できる。磁気ディスクには、フレキシブルディスク(FD:Flexible Disk)やHDDが含まれる。光ディスクには、CD(Compact Disc)やDVD(Digital Versatile Disc)が含まれる。   The medium reader 106 is a reading device that reads programs and data recorded on the recording medium 113. As the recording medium 113, for example, a magnetic disk, an optical disk, a magneto-optical disk (MO), a semiconductor memory, or the like can be used. Magnetic disks include flexible disks (FD: Flexible Disk) and HDDs. The optical disc includes a CD (Compact Disc) and a DVD (Digital Versatile Disc).

媒体リーダ106は、例えば、記録媒体113から読み取ったプログラムやデータを、RAM102やHDD103などの他の記録媒体にコピーする。読み取られたプログラムは、例えば、CPU101によって実行される。なお、記録媒体113は、可搬型記録媒体であってもよく、プログラムやデータの配布に用いられることがある。また、記録媒体113やHDD103を、コンピュータ読み取り可能な記録媒体と言うことがある。   For example, the medium reader 106 copies a program or data read from the recording medium 113 to another recording medium such as the RAM 102 or the HDD 103. The read program is executed by the CPU 101, for example. The recording medium 113 may be a portable recording medium and may be used for distributing programs and data. In addition, the recording medium 113 and the HDD 103 may be referred to as computer-readable recording media.

通信インタフェース107は、ネットワーク114に接続され、ネットワーク114を介して他の装置と通信を行うインタフェースである。通信インタフェース107は、スイッチなどの通信装置とケーブルで接続される有線通信インタフェースでもよいし、基地局と無線リンクで接続される無線通信インタフェースでもよい。   The communication interface 107 is an interface that is connected to the network 114 and communicates with other devices via the network 114. The communication interface 107 may be a wired communication interface connected to a communication device such as a switch via a cable, or may be a wireless communication interface connected to a base station via a wireless link.

次に、ファイルにアクセスするソースプログラムの記述方法について説明する。
図3は、第1のレコード定義方法の例を示す図である。
ソースプログラム131は、プログラミング言語としてCOBOLを用いて記述されたソースプログラム(ソースコード)の例である。ソースプログラム131は、見出し部(IDENTIFICATION DIVISON)、環境部(ENVIRONMENT DIVISION)、データ部(DATA DIVISION)および手続き部(PROCEDURE DIVISION)を含む。
Next, a description is given of a method for describing a source program that accesses a file.
FIG. 3 is a diagram illustrating an example of the first record definition method.
The source program 131 is an example of a source program (source code) described using COBOL as a programming language. The source program 131 includes a heading part (IDENTIFICATION DIVISION), an environment part (ENVIRONMENT DIVISION), a data part (DATA DIVISION), and a procedure part (PROCEDURE DIVISION).

見出し部には、プログラム名が記述される。ソースプログラム131のプログラム名は「PROGRAM1」である。環境部には、アクセスするファイルの論理ファイル名と中間ファイル名との対応関係が記述される。論理ファイル名と中間ファイル名は何れも、ファイルシステムが使用する物理的なファイル名(実ファイル名)とは異なる仮想的なファイル名である。論理ファイル名は、データ部で使用されるファイル名である。中間ファイル名は、後述するジョブ制御言語(JCL:Job Control Language)プログラムで使用されるファイル名である。ソースプログラム131がアクセスするファイルの論理ファイル名は「人事−REC」、中間ファイル名は「FILE1」である。   The program name is described in the heading part. The program name of the source program 131 is “PROGRAM1”. The environment section describes the correspondence between the logical file name of the file to be accessed and the intermediate file name. Both the logical file name and the intermediate file name are virtual file names different from the physical file name (real file name) used by the file system. The logical file name is a file name used in the data part. The intermediate file name is a file name used in a job control language (JCL) program to be described later. The logical file name of the file accessed by the source program 131 is “HR-REC”, and the intermediate file name is “FILE1”.

データ部には、論理ファイル名と対応付けて、論理ファイル名が示すファイルに格納されるデータの構造を示すレコード定義が記述される。第2の実施の形態のレコード定義は、第1の実施の形態のデータ構造定義文に対応する。レコード定義は、ファイルに格納されるデータに含まれる1以上のレコード(データ項目)を示す。1つのレコードに対して、1つのデータ項目名と1つのデータ型とが定義される。ただし、処理ロジックを記述するのに好適な場合、2以上のレコードの集合に対し集団項目名が付与されることがある。   In the data portion, a record definition indicating the structure of data stored in the file indicated by the logical file name is described in association with the logical file name. The record definition of the second embodiment corresponds to the data structure definition statement of the first embodiment. The record definition indicates one or more records (data items) included in the data stored in the file. One data item name and one data type are defined for one record. However, when suitable for describing processing logic, a group item name may be given to a set of two or more records.

ソースプログラム131には、論理ファイル名「人事−REC」に対して、(従業員コード,X(5))、(所属コード,X(3))、(氏名,N(10))というレコード定義が記述されている。データ型であるX(5)は5文字の半角文字列を表し、X(3)は3文字の半角文字列を表し、N(10)は10文字の全角文字列を表している。   The source program 131 has a record definition of (employee code, X (5)), (affiliation code, X (3)), (name, N (10)) for the logical file name “HR-REC”. Is described. The data type X (5) represents a 5-character half-width character string, X (3) represents a 3-character half-width character string, and N (10) represents a 10-character full-width character string.

手続き部には、データ部で定義されたレコード定義を利用した処理ロジックが記述される。手続き部には、論理ファイル名が示すファイルからデータを読み出す処理ロジックが記述されることがある。その場合、データ項目名を変数名として用いて、ファイルから読み出したデータを参照することができる。また、手続き部には、論理ファイル名が示すファイルにデータを書き込む処理ロジックが記述されることがある。その場合、データ項目名を変数名として用いて、ファイルに書き込むデータを生成することができる。   In the procedure part, processing logic using the record definition defined in the data part is described. The procedure part may describe processing logic for reading data from the file indicated by the logical file name. In that case, data read from the file can be referred to using the data item name as the variable name. In the procedure section, processing logic for writing data to a file indicated by the logical file name may be described. In that case, data to be written to the file can be generated using the data item name as the variable name.

図4は、第2のレコード定義方法の例を示す図である。
ソースプログラム132は、図3のソースプログラム131と同様に、プログラミング言語としてCOBOLを用いて記述されたソースプログラムの例である。ソースプログラム132の環境部には、ソースプログラム131と同様に、論理ファイル名「人事−REC」と中間ファイル名「FILE1」が記述されている。すなわち、ソースプログラム132は、ソースプログラム131と同じファイルにアクセスすることがある。
FIG. 4 is a diagram illustrating an example of the second record definition method.
The source program 132 is an example of a source program described using COBOL as a programming language, like the source program 131 of FIG. In the environment section of the source program 132, similarly to the source program 131, a logical file name “HR-REC” and an intermediate file name “FILE1” are described. That is, the source program 132 may access the same file as the source program 131.

ただし、ソースプログラム131と異なり、ソースプログラム132のデータ部にはレコード定義が直接記述されていない。その代わりに、ソースプログラム132のデータ部には、レコード定義ファイル133を参照するCOPY文が記述されている。COPY文は、参照先のレコード定義ファイルに記述されたレコード定義を取り込む命令文である。ソースプログラム132は、ファイル名が「人事RECファイル」であるレコード定義ファイル133のレコード定義をデータ部に取り込んでいる。   However, unlike the source program 131, the record definition is not directly described in the data portion of the source program 132. Instead, a COPY statement referring to the record definition file 133 is described in the data portion of the source program 132. The COPY statement is a command statement that captures the record definition described in the record definition file at the reference destination. The source program 132 imports the record definition of the record definition file 133 whose file name is “HR REC file” into the data part.

レコード定義ファイル133は、ソースプログラムから分離されたレコード定義用の外部ファイルである。レコード定義ファイル133には、ソースプログラム131のデータ部と同様に、(従業員コード,X(5))、(所属コード,X(3))、(氏名,N(10))というレコード定義が記述されている。レコード定義ファイル133のレコード定義をソースプログラム132のデータ部に取り込むことで、論理ファイル名「人事−REC」が示すファイルのデータにソースプログラム132からアクセスすることができる。   The record definition file 133 is an external file for record definition separated from the source program. In the record definition file 133, similarly to the data part of the source program 131, record definitions of (employee code, X (5)), (affiliation code, X (3)), (name, N (10)) are included. It has been described. By importing the record definition of the record definition file 133 into the data part of the source program 132, the data of the file indicated by the logical file name “HR-REC” can be accessed from the source program 132.

レコード定義ファイル133はソースプログラム132から分離されているため、複数のソースプログラムがレコード定義ファイル133を共有することも可能である。なお、上記のCOPY文とレコード定義ファイル133を利用したレコード定義の方法は、C言語のinclude文とヘッダファイルを利用することによっても実現できる。   Since the record definition file 133 is separated from the source program 132, a plurality of source programs can share the record definition file 133. The record definition method using the COPY statement and the record definition file 133 can also be realized by using a C include statement and a header file.

ここで、情報処理システムを長期間運用していると、情報処理システム上で使用されるプログラム資産の拡張や変更が繰り返されることがある。その結果として、同一のファイルに対して、図3のような埋め込み形式のレコード定義を利用するソースプログラムと図4のような外部参照形式のレコード定義を利用するソースプログラムとが、プログラム資産の中に混在することがある。また、レコード定義の記述方法が統一されず、ソースプログラムやレコード定義ファイルによってレコード定義が異なることがある。   Here, when the information processing system is operated for a long period of time, the expansion and change of the program assets used on the information processing system may be repeated. As a result, a source program that uses an embedded record definition as shown in FIG. 3 and a source program that uses an external reference record definition as shown in FIG. May be mixed. In addition, the record definition description method is not uniform, and the record definition may differ depending on the source program or the record definition file.

同一のファイルに対して異なるレコード定義が存在する原因として、例えば、不注意により既存のデータ項目名と異なるデータ項目名を使用して新しいソースプログラムを作成してしまったことが考えられる。この場合、事後的にデータ項目名を統一することが可能であることが多い。一方、原因として、例えば、処理ロジックを記述する都合上、既存のソースプログラムが使用していない新たな集団項目名を定義した場合や、意図的に既存のレコード定義とは異なるデータ型を使用した場合も考えられる。この場合、処理ロジックが変わらないようにレコード定義を事後的に統一することが難しいことがある。   One possible cause of the existence of different record definitions for the same file is, for example, that a new source program has been created using a data item name that is different from an existing data item name. In this case, it is often possible to unify data item names afterwards. On the other hand, as a cause, for example, when defining a new group item name that is not used by an existing source program for the convenience of describing processing logic, or intentionally using a data type that is different from the existing record definition Cases are also conceivable. In this case, it may be difficult to unify the record definitions afterwards so that the processing logic does not change.

同一のファイルについてのレコード定義が様々なソースプログラムに重複して記述されている場合、プログラム資産の保守性が低下して以降の保守コストが増大する。また、同一のファイルについて複数のタイプのレコード定義が存在する場合にも、プログラム資産の保守性が低下して以降の保守コストが増大する。そこで、理想的には、1つのファイルについて1つのレコード定義ファイルを作成し、当該ファイルにアクセスするソースプログラムは全て当該レコード定義ファイルを参照するようにすることが好ましい。   When the record definition for the same file is described in duplicate in various source programs, the maintainability of the program asset is lowered and the subsequent maintenance cost is increased. In addition, even when there are a plurality of types of record definitions for the same file, the maintainability of the program asset is lowered and the subsequent maintenance cost is increased. Therefore, ideally, it is preferable that one record definition file is created for one file, and all source programs that access the file refer to the record definition file.

ただし、上記のように、同一のファイルについてのレコード定義を機械的に統一することが難しい場合がある。そこで、プログラム資産の保守性を向上させるために、情報処理システムのユーザやエンジニアなどがソースプログラムを見直し、統一することが可能な範囲でレコード定義を修正することがある。第2の実施の形態のプログラム分析装置100は、そのようなレコード定義の修正作業を支援する。具体的には、プログラム分析装置100は、複数のタイプのレコード定義の使用状況を可視化する。   However, as described above, it may be difficult to mechanically unify record definitions for the same file. Therefore, in order to improve the maintainability of program assets, the record definition may be corrected within a range where a user or an engineer of the information processing system can review and unify the source program. The program analysis apparatus 100 according to the second embodiment supports such a record definition correction operation. Specifically, the program analysis apparatus 100 visualizes the usage status of a plurality of types of record definitions.

以下、プログラム分析装置100による可視化方法を説明する。まず、ソースプログラムからアクセスされるファイルの物理的同一性を判定する方法について説明する。
図5は、JCLファイルの例を示す図である。
Hereinafter, the visualization method by the program analysis apparatus 100 will be described. First, a method for determining the physical identity of a file accessed from a source program will be described.
FIG. 5 is a diagram illustrating an example of a JCL file.

JCLファイル134は、1以上のソースプログラムを所定の順序で起動させるジョブを制御するためのJCLプログラムを記述したバッチファイルである。JCLファイル134のファイル名は「JCL01」である。プログラム分析装置100は、JCLファイル134を用いて、論理ファイル名から実ファイル名を特定する。   The JCL file 134 is a batch file describing a JCL program for controlling a job for starting one or more source programs in a predetermined order. The file name of the JCL file 134 is “JCL01”. The program analysis apparatus 100 uses the JCL file 134 to identify the actual file name from the logical file name.

JCLファイル134には、複数のジョブステップが定義される。各ジョブステップについて、JCLファイル134には、ジョブ名と、起動されるソースプログラムのプログラム名が記述される。図5のJCLファイル134には、ジョブ名「JOB1」とプログラム名「PROGRAM1」が記述されている。また、各ジョブステップについて、JCLファイル134には、中間ファイル名と実ファイル名との対応関係が記述される。図5のJCLファイル134には、中間ファイル名「FILE1」が実ファイル名「FILE1.DAT1」に対応することが記述されている。同様に、中間ファイル名「FILE2」が実ファイル名「FILE2.DAT2」に対応し、中間ファイル名「FILE3」が実ファイル名「FILE3.DAT3」に対応することが記述されている。   A plurality of job steps are defined in the JCL file 134. For each job step, the JCL file 134 describes the job name and the program name of the activated source program. In the JCL file 134 of FIG. 5, a job name “JOB1” and a program name “PROGRAM1” are described. For each job step, the JCL file 134 describes the correspondence between the intermediate file name and the actual file name. The JCL file 134 of FIG. 5 describes that the intermediate file name “FILE1” corresponds to the actual file name “FILE1.DAT1”. Similarly, it is described that the intermediate file name “FILE2” corresponds to the actual file name “FILE2.DAT2”, and the intermediate file name “FILE3” corresponds to the actual file name “FILE3.DAT3”.

なお、JCLファイル134には、データの使用方法を示すパラメータが記述されることがある。「NEW」はそのジョブステップでデータを新規に生成することを示す。「OLD」はそのジョブステップの前から存在するデータを排他的に読み出すことを示す。「SHR」はそのジョブステップの前から存在するデータを共有で読み出すことを示す。   In the JCL file 134, a parameter indicating how to use data may be described. “NEW” indicates that data is newly generated in the job step. “OLD” indicates that data existing before the job step is read out exclusively. “SHR” indicates that data existing before the job step is shared and read.

図6は、ファイル参照テーブルの例を示す図である。
プログラム分析装置100は、1以上のソースプログラムと1以上のJCLファイルとを分析してファイル参照テーブル135を生成する。ファイル参照テーブル135は、プログラム名、中間ファイル名、論理ファイル名、レコード定義ファイル名、JCLファイル名、ジョブ名および実ファイル名の項目を有する。
FIG. 6 is a diagram illustrating an example of a file reference table.
The program analysis apparatus 100 generates one file reference table 135 by analyzing one or more source programs and one or more JCL files. The file reference table 135 has items of program name, intermediate file name, logical file name, record definition file name, JCL file name, job name, and actual file name.

プログラム名の項目には、ソースプログラムやJCLファイルから抽出されたプログラム名が登録される。中間ファイル名の項目には、ソースプログラムやJCLファイルから抽出された中間ファイル名が登録される。論理ファイル名の項目には、ソースプログラムから抽出された論理ファイル名が登録される。レコード定義ファイル名の項目には、ソースプログラムから抽出されたレコード定義ファイル名が登録される。ただし、レコード定義が直接埋め込まれているソースコードについては、レコード定義ファイル名の項目は空欄となる。JCLファイル名の項目には、JCLファイルのファイル名が登録される。ジョブ名の項目には、JCLファイルから抽出されたジョブ名が登録される。実ファイル名の項目には、JCLファイルから抽出された実ファイル名が登録される。   In the program name item, a program name extracted from a source program or a JCL file is registered. In the intermediate file name item, an intermediate file name extracted from the source program or JCL file is registered. The logical file name extracted from the source program is registered in the logical file name item. The record definition file name extracted from the source program is registered in the record definition file name field. However, for the source code in which the record definition is directly embedded, the record definition file name field is blank. In the JCL file name item, the file name of the JCL file is registered. The job name extracted from the JCL file is registered in the job name item. The real file name extracted from the JCL file is registered in the real file name item.

プログラム分析装置100は、1以上のソースプログラムそれぞれについて、見出し部からプログラム名を抽出し、環境部から中間ファイル名と論理ファイル名を抽出する。また、プログラム分析装置100は、抽出した論理ファイル名についてのCOPY文がデータ部に記述されている場合、COPY文に含まれるレコード定義ファイル名を抽出する。プログラム分析装置100は、抽出したプログラム名と中間ファイル名と論理ファイル名とレコード定義ファイル名を対応付けてファイル参照テーブル135に登録する。   For each of one or more source programs, the program analysis apparatus 100 extracts a program name from the heading part, and extracts an intermediate file name and a logical file name from the environment part. In addition, when the COPY statement for the extracted logical file name is described in the data part, the program analysis apparatus 100 extracts the record definition file name included in the COPY statement. The program analysis apparatus 100 registers the extracted program name, intermediate file name, logical file name, and record definition file name in the file reference table 135 in association with each other.

例えば、プログラム分析装置100は、ソースプログラム131から、プログラム名「PROGRAM1」、中間ファイル名「FILE1」および論理ファイル名「人事−REC」を抽出して登録する。レコード定義がソースプログラム131に直接埋め込まれているため、レコード定義ファイル名の項目は空欄になる。また、例えば、プログラム分析装置100は、ソースプログラム132から、プログラム名「PROGRAM2」、中間ファイル名「FILE1」、論理ファイル名「人事−REC」およびレコード定義ファイル名「人事RECファイル」を抽出して登録する。   For example, the program analysis apparatus 100 extracts the program name “PROGRAM1”, the intermediate file name “FILE1”, and the logical file name “HR-REC” from the source program 131 and registers them. Since the record definition is directly embedded in the source program 131, the record definition file name field is blank. Further, for example, the program analysis apparatus 100 extracts the program name “PROGRAM2”, the intermediate file name “FILE1”, the logical file name “HR-REC”, and the record definition file name “HR REC file” from the source program 132. sign up.

また、プログラム分析装置100は、1以上のJCLファイルそれぞれについて、JCLファイル名、ジョブ名、プログラム名、中間ファイル名および実ファイル名を抽出する。プログラム分析装置100は、ファイル参照テーブル135から、抽出したプログラム名と中間ファイル名を含む情報を検索し、検索した情報と対応付けて、抽出したJCLファイル名とジョブ名と実ファイル名をファイル参照テーブル135に登録する。   Further, the program analysis apparatus 100 extracts the JCL file name, job name, program name, intermediate file name, and actual file name for each of one or more JCL files. The program analysis apparatus 100 searches the file reference table 135 for information including the extracted program name and intermediate file name, and associates the extracted JCL file name, job name, and actual file name with a file reference in association with the searched information. Register in the table 135.

例えば、プログラム分析装置100は、JCLファイル134から、JCLファイル名「JCL01」、ジョブ名「JOB1」、プログラム名「PROGRAM1」、中間ファイル名「FILE1」および実ファイル名「FILE1.DAT1」を抽出する。プログラム分析装置100は、ファイル参照テーブル135から、プログラム名「PROGRAM1」と中間ファイル名「FILE1」に対応する行を検索する。プログラム分析装置100は、ファイル参照テーブル135の検索した行に、JCLファイル名「JCL01」、ジョブ名「JOB1」および実ファイル名「FILE1.DAT1」を登録する。   For example, the program analysis apparatus 100 extracts a JCL file name “JCL01”, a job name “JOB1”, a program name “PROGRAM1”, an intermediate file name “FILE1”, and an actual file name “FILE1.DAT1” from the JCL file 134. . The program analysis apparatus 100 searches the file reference table 135 for lines corresponding to the program name “PROGRAM1” and the intermediate file name “FILE1”. The program analysis apparatus 100 registers the JCL file name “JCL01”, the job name “JOB1”, and the actual file name “FILE1.DAT1” in the retrieved row of the file reference table 135.

これにより、プログラム名とレコード定義ファイル名と実ファイル名を紐付けることができる。すなわち、複数のソースプログラムそれぞれがデータアクセスに用いる物理的なファイルと、参照するレコード定義ファイルとを特定できる。   Thereby, the program name, the record definition file name, and the actual file name can be associated. That is, a physical file used for data access by each of a plurality of source programs and a record definition file to be referenced can be specified.

次に、プログラム資産に含まれるレコード定義のタイプ分類について説明する。
図7は、レコード定義のタイプ分類例を示す図である。
レコード定義141〜145は、同一のファイルについての異なるレコード定義であり、例えば、異なるソースプログラムに記述されたものである。
Next, the type classification of the record definition included in the program asset will be described.
FIG. 7 is a diagram illustrating an example of type classification of record definition.
The record definitions 141 to 145 are different record definitions for the same file, and are described in different source programs, for example.

レコード定義141に記述された「XXX−KEY」、「XXX−FLG」は集団項目名である。レコード定義141に記述された「XXX−PGM−ID」、「XXX−SEQ−NO」、「XXX−TANMATSU−KBN」はデータ項目名である。また、レコード定義141に記述された「XXX−FLG−1」、「XXX−FLG−2」、「XXX−FLG−3」、「XXX−FLG−4」、「XXX−FLG−5」はデータ項目名である。また、レコード定義141に記述された「XXX−SITE−MEI」、「XXX−SITE−MEI−RYAKUSHO」、「FILLER」はデータ項目名である。レコード定義141に記述された「X(07)」、「9(02)」、「X(01)」、「N(15)」、「N(07)」、「X(21)」はデータ型である。   “XXX-KEY” and “XXX-FLG” described in the record definition 141 are group item names. “XXX-PGM-ID”, “XXX-SEQ-NO”, and “XXX-TANMATSU-KBN” described in the record definition 141 are data item names. Also, “XXX-FLG-1”, “XXX-FLG-2”, “XXX-FLG-3”, “XXX-FLG-4”, and “XXX-FLG-5” described in the record definition 141 are data. Item name. In addition, “XXX-SITE-MEI”, “XXX-SITE-MEI-RYAKUSHO”, and “FILLER” described in the record definition 141 are data item names. “X (07)”, “9 (02)”, “X (01)”, “N (15)”, “N (07)”, “X (21)” described in the record definition 141 are data. It is a type.

データ項目名に含まれる「XXX−」は接頭辞である。2つのデータ項目名の同一性を判断するにあたり、プログラム分析装置100は、接頭辞を匿名化する(接頭辞の違いを無視する)ことがある。データ項目名の接頭辞は論理ファイル名と関連していることがある。例えば、論理ファイル名が「U01−REC」であるファイルについてのデータ項目名が「U01−AAA」のように定義されることがある。この場合、データ項目名の先頭に付加されている「U01−」を接頭辞とみなすことができる。   “XXX-” included in the data item name is a prefix. In determining the identity of two data item names, the program analysis apparatus 100 may anonymize the prefix (ignore the difference between the prefixes). Data item name prefixes may be associated with logical file names. For example, a data item name for a file whose logical file name is “U01-REC” may be defined as “U01-AAA”. In this case, “U01−” added to the head of the data item name can be regarded as a prefix.

レコード定義142は、データ項目名「XXX−SITE−MEI」に対応するデータ型が「X(30)」である点でレコード定義141と異なる。また、レコード定義142は、データ項目名「XXX−SITE−MEI−RYAKUSHO」に対応するデータ型が「X(14)」である点でレコード定義141と異なる。よって、レコード定義141が第1のタイプに属するとすると、レコード定義142は第2のタイプに属する。   The record definition 142 is different from the record definition 141 in that the data type corresponding to the data item name “XXX-SITE-MEI” is “X (30)”. The record definition 142 is different from the record definition 141 in that the data type corresponding to the data item name “XXX-SITE-MEI-RYAKUSHO” is “X (14)”. Therefore, if the record definition 141 belongs to the first type, the record definition 142 belongs to the second type.

レコード定義143は、「XXX−SITE−MEI−RYAKUSHO」が集団項目名であり、「XXX−SITE−MEI−RYAKU−KJ」がデータ項目名である点でレコード定義141と異なる。レコード定義143は、レコード定義141,142の何れとも異なっている。よって、レコード定義143は第3のタイプに属する。   The record definition 143 is different from the record definition 141 in that “XXX-SITE-MEI-RYAKUSHO” is a group item name and “XXX-SITE-MEI-RYAKU-KJ” is a data item name. The record definition 143 is different from any of the record definitions 141 and 142. Therefore, the record definition 143 belongs to the third type.

図8は、レコード定義のタイプ分類例を示す図(続き)である。
レコード定義144は、レコード定義141のデータ項目名「XXX−FLG」が「XXX−SHORI−FLG」に変更されている点でレコード定義141と異なる。また、レコード定義144は、レコード定義141のデータ項目名「FILLER」が「XXX−FILLER」に変更されている点でレコード定義141と異なる。レコード定義144は、レコード定義141〜143の何れとも異なっている。よって、レコード定義144は第4のタイプに属する。なお、接頭辞を匿名化する場合、「FILLER」と「XXX−FILLER」とが実質的に同じであると判断されてもよい。
FIG. 8 is a diagram (continued) showing an example of type classification of record definition.
The record definition 144 is different from the record definition 141 in that the data item name “XXX-FLG” of the record definition 141 is changed to “XXX-SHORI-FLG”. The record definition 144 is different from the record definition 141 in that the data item name “FILLER” of the record definition 141 is changed to “XXX-FILLER”. The record definition 144 is different from any of the record definitions 141 to 143. Therefore, the record definition 144 belongs to the fourth type. When the prefix is anonymized, it may be determined that “FILLER” and “XXX-FILLER” are substantially the same.

レコード定義145は、データ項目名「XXX−SITE−MEI」に対応するデータ型が「X(30)」である点でレコード定義141と異なる。また、レコード定義145は、データ項目名「XXX−SITE−MEI−RYAKUSHO」に対応するデータ型が「X(14)」である点でレコード定義141と異なる。また、レコード定義145は、レコード定義141のデータ項目名「FILLER」が「XXX−FILLER」に変更されている点でレコード定義141と異なる。上記のデータ型の差異は、レコード定義142と同様である。また、上記のデータ項目名の差異は、レコード定義144と同様である。しかし、レコード定義145は、全体としてレコード定義141〜144の何れとも異なっている。よって、レコード定義145は第5のタイプに属する。このように、レコード定義141〜145は互いに異なるタイプに属することになる。   The record definition 145 is different from the record definition 141 in that the data type corresponding to the data item name “XXX-SITE-MEI” is “X (30)”. The record definition 145 is different from the record definition 141 in that the data type corresponding to the data item name “XXX-SITE-MEI-RYAKUSHO” is “X (14)”. The record definition 145 is different from the record definition 141 in that the data item name “FILLER” of the record definition 141 is changed to “XXX-FILLER”. The difference between the above data types is the same as that of the record definition 142. The difference between the data item names is the same as that of the record definition 144. However, the record definition 145 is different from any of the record definitions 141 to 144 as a whole. Therefore, the record definition 145 belongs to the fifth type. As described above, the record definitions 141 to 145 belong to different types.

図9は、タイプ分類テーブルの例を示す図である。
プログラム分析装置100は、上記のようにして分類した複数のタイプの使用状況を可視化するにあたり、タイプ分類テーブル136を生成する。
FIG. 9 is a diagram illustrating an example of the type classification table.
The program analysis apparatus 100 generates a type classification table 136 when visualizing the usage statuses of a plurality of types classified as described above.

プログラム分析装置100は、レコード定義のタイプ毎に、当該タイプに属するレコード定義を使用するソースプログラムの数をカウントする。複数のソースプログラムが共通のレコード定義ファイルをCOPY文によって参照している場合、COPY文1つにつきカウントが+1される。また、プログラム分析装置100は、タイプ毎に共通のレコード定義ファイルを作成してソースプログラムに直接記述されたレコード定義を全て外部参照形式に変換した場合の削減率を試算する。削減率は、現在のプログラム資産に含まれるソースプログラムの総ステップ数(例えば、総行数)に対する、変換により減少するソースプログラムのステップ数(例えば、減少行数)の割合である。   For each type of record definition, the program analysis apparatus 100 counts the number of source programs that use the record definition belonging to that type. When a plurality of source programs refer to a common record definition file by a COPY statement, the count is incremented by one for each COPY statement. Further, the program analysis apparatus 100 creates a common record definition file for each type, and calculates a reduction rate when all record definitions directly described in the source program are converted into an external reference format. The reduction rate is a ratio of the number of steps of the source program (for example, the number of reduced lines) reduced by the conversion to the total number of steps of the source program (for example, the total number of lines) included in the current program asset.

削減率は実ファイル毎に算出される。多数のソースプログラムに埋め込み形式で記述されているタイプが存在する実ファイルは、削減率が大きくなりやすい。一方、既に1つまたは少数のレコード定義ファイルを参照する外部参照形式に統一されているタイプが存在する実ファイルは、削減率が小さくなりやすい。また、少数のソースプログラムでしか使用されていないタイプが存在する実ファイルは、削減率が小さくなりやすい。   The reduction rate is calculated for each real file. An actual file having a type described in an embedded format in a large number of source programs tends to have a large reduction rate. On the other hand, a reduction rate tends to be small for an actual file that already has a type that is standardized to an external reference format that refers to one or a few record definition files. In addition, a reduction rate tends to be small for an actual file having a type that is used only by a small number of source programs.

ここで、接頭辞を匿名化してデータ項目名同士を比較した場合(接頭辞を無視した場合)、接頭辞を無視しない場合よりもタイプ数が少なくなる。この場合、接頭辞のみ異なるレコード定義の記述を統一することができれば、接頭辞を無視しない場合よりも削減率が大きくなる。そこで、プログラム分析装置100は、接頭辞を無視しない場合と接頭辞を無視した場合の両方についてプログラム数や削減率を算出することが好ましい。   Here, when the prefixes are anonymized and the data item names are compared with each other (when the prefix is ignored), the number of types is smaller than when the prefix is not ignored. In this case, if the description of the record definitions that differ only in the prefix can be unified, the reduction rate becomes larger than the case where the prefix is not ignored. Therefore, it is preferable that the program analysis apparatus 100 calculates the number of programs and the reduction rate both when the prefix is not ignored and when the prefix is ignored.

タイプ分類テーブル136は、実ファイル名、プログラム数、削減率、接頭辞無視のプログラム数および接頭辞無視の削減率の項目を有する。実ファイル名の項目には、ソースプログラムからアクセスされる物理的なファイルの実ファイル名が登録される。プログラム数の項目には、接頭辞を無視せずにレコード定義をタイプ分類したときの複数のタイプのソースプログラム数が列挙される。実ファイル名とプログラム名の関係は、ファイル参照テーブル135を用いて特定することができる。   The type classification table 136 includes items of an actual file name, the number of programs, a reduction rate, the number of programs ignoring prefixes, and a reduction rate ignoring prefixes. In the real file name item, the real file name of a physical file accessed from the source program is registered. In the program number field, the number of source programs of a plurality of types when a record definition is classified without ignoring the prefix is listed. The relationship between the actual file name and the program name can be specified using the file reference table 135.

削減率の項目には、接頭辞を無視しないことで得られた複数のタイプそれぞれを外部参照形式に変換した場合の削減率が登録される。接頭辞無視のプログラム数の項目には、接頭辞を無視してレコード定義をタイプ分類したときの複数のタイプのソースプログラム数が列挙される。接頭辞を無視したときのタイプ数は、接頭辞を無視しないときのタイプ数以下となる。接頭辞無視の削減率の項目には、接頭辞を無視することで得られた複数のタイプそれぞれを外部参照形式に変換した場合の削減率が登録される。接頭辞を無視したときの削減率は、接頭辞を無視しないときの削減率以上となる。   In the item of reduction rate, the reduction rate when each of a plurality of types obtained by not ignoring the prefix is converted into an external reference format is registered. In the item of the number of programs ignoring the prefix, the number of source programs of a plurality of types when the record definition is typed by ignoring the prefix is listed. The number of types when the prefix is ignored is less than the number of types when the prefix is not ignored. In the item “reduction rate of ignoring prefix”, a reduction rate when each of a plurality of types obtained by ignoring the prefix is converted into an external reference format is registered. The reduction rate when the prefix is ignored is greater than the reduction rate when the prefix is not ignored.

プログラム分析装置100は、生成したタイプ分類テーブル136に基づいて可視化画面をディスプレイ111に表示する。次に、可視化画面の例を説明する。
図10は、レコード定義分布の第1の可視化例を示す図である。
The program analysis apparatus 100 displays a visualization screen on the display 111 based on the generated type classification table 136. Next, an example of a visualization screen will be described.
FIG. 10 is a diagram illustrating a first visualization example of the record definition distribution.

可視化画面151はディスプレイ111に表示される。可視化画面151は、実ファイル名が「ファイルA」であるファイルについての複数のタイプの使用状況を示す。可視化画面151の左側の円グラフは、接頭辞を無視しない場合の複数のタイプの間のプログラム数の比を示している。可視化画面151の右側の円グラフは、接頭辞を無視した場合の複数のタイプの間のプログラム数の比を示している。   The visualization screen 151 is displayed on the display 111. The visualization screen 151 shows the usage status of a plurality of types for a file whose real file name is “file A”. The pie chart on the left side of the visualization screen 151 shows the ratio of the number of programs among a plurality of types when the prefix is not ignored. The pie chart on the right side of the visualization screen 151 shows the ratio of the number of programs among a plurality of types when the prefix is ignored.

円グラフを用いることで、あるファイルについて最も多く使用されているレコード定義のタイプを把握することが容易となる。ユーザは、例えば、最も多く使用されているタイプを標準レコード定義として選択し、当該ファイルのレコード定義を標準レコード定義に統一することを検討することが考えられる。また、円グラフを用いることで、標準レコード定義以外のタイプがどの程度使用されているか把握することが容易となる。これにより、ユーザは、例えば、当該ファイルのレコード定義を修正することによるプログラム資産の保守性向上効果を見積もることが可能となる。プログラム分析装置100は、ユーザ入力に応じて、異なるファイルについての円グラフを表示してもよい。   By using a pie chart, it is easy to grasp the type of record definition that is most frequently used for a certain file. For example, the user may select the most frequently used type as the standard record definition and consider to unify the record definition of the file into the standard record definition. Also, by using a pie chart, it becomes easy to grasp how much types other than the standard record definition are used. As a result, the user can estimate the effect of improving the maintainability of the program asset by correcting the record definition of the file, for example. The program analysis apparatus 100 may display a pie chart for different files in response to user input.

図11は、レコード定義分布の第2の可視化例を示す図である。
可視化画面152はディスプレイ111に表示される。可視化画面152は、複数のファイルについての複数のタイプの使用状況を示す。可視化画面152では、各ファイルについての複数のタイプのプログラム数が積み上げ棒グラフによって表されている。図11の例は、接頭辞を無視した場合のプログラム数を示す。プログラム分析装置100は、ユーザ入力に応じて、接頭辞を無視した場合のグラフと無視しない場合のグラフを切り替えて表示してもよい。積み上げ棒グラフを用いることで、図10の場合と同様に、あるファイルについて最も多く使用されているレコード定義のタイプを把握することが容易となる。また、積み上げ棒グラフを用いることで、標準レコード定義以外のタイプがどの程度使用されているか把握することが容易となる。
FIG. 11 is a diagram illustrating a second visualization example of the record definition distribution.
The visualization screen 152 is displayed on the display 111. The visualization screen 152 shows a plurality of types of usage status for a plurality of files. On the visualization screen 152, the number of programs of a plurality of types for each file is represented by a stacked bar graph. The example of FIG. 11 shows the number of programs when the prefix is ignored. The program analysis apparatus 100 may switch and display a graph when the prefix is ignored and a graph when the prefix is not ignored according to a user input. By using the stacked bar graph, as in the case of FIG. 10, it becomes easy to grasp the type of record definition used most frequently for a certain file. In addition, by using the stacked bar graph, it is easy to grasp how much types other than the standard record definition are used.

図12は、プログラム修正効果の可視化例を示す図である。
可視化画面153はディスプレイ111に表示される。可視化画面153は、複数の実ファイル名それぞれについて、接頭辞を無視せずに試算した削減率と接頭辞を無視して試算した削減率とを表形式で表している。可視化画面153によれば、ソースプログラムのレコード定義を外部参照形式に変換することによる効果を定量的に表現できる。図12では、削減率が1%以上になる場合を強調表示している。
FIG. 12 is a diagram illustrating a visualization example of the program correction effect.
The visualization screen 153 is displayed on the display 111. The visualization screen 153 displays, for each of a plurality of real file names, a reduction rate calculated without ignoring the prefix and a reduction rate calculated without ignoring the prefix in a tabular format. According to the visualization screen 153, the effect of converting the record definition of the source program into the external reference format can be quantitatively expressed. In FIG. 12, the case where the reduction rate is 1% or more is highlighted.

次に、プログラム分析装置100の機能について説明する。
図13は、プログラム分析装置の機能例を示すブロック図である。
プログラム分析装置100は、JCLファイル記憶部121、ソースプログラム記憶部122、ファイル参照テーブル記憶部123およびタイプ分類テーブル記憶部124を有する。また、プログラム分析装置100は、JCLファイル分析部125、ソースプログラム分析部126、タイプ判定部127および表示制御部128を有する。
Next, functions of the program analysis apparatus 100 will be described.
FIG. 13 is a block diagram illustrating an example of functions of the program analysis apparatus.
The program analysis apparatus 100 includes a JCL file storage unit 121, a source program storage unit 122, a file reference table storage unit 123, and a type classification table storage unit 124. In addition, the program analysis apparatus 100 includes a JCL file analysis unit 125, a source program analysis unit 126, a type determination unit 127, and a display control unit 128.

JCLファイル記憶部121、ソースプログラム記憶部122、ファイル参照テーブル記憶部123およびタイプ分類テーブル記憶部124は、例えば、RAM102またはHDD103の記憶領域を用いて実装される。JCLファイル分析部125、ソースプログラム分析部126、タイプ判定部127および表示制御部128は、例えば、CPU101が実行するプログラムモジュールを用いて実装される。   The JCL file storage unit 121, the source program storage unit 122, the file reference table storage unit 123, and the type classification table storage unit 124 are mounted using, for example, a storage area of the RAM 102 or the HDD 103. The JCL file analysis unit 125, the source program analysis unit 126, the type determination unit 127, and the display control unit 128 are implemented using, for example, program modules executed by the CPU 101.

JCLファイル記憶部121は、JCLファイル134のような1以上のJCLファイルを記憶する。プログラム分析装置100は、JCLファイル記憶部121に記憶されるJCLファイルを他の装置から受信してもよい。また、プログラム分析装置100は、JCLファイルを記録媒体113から読み出してもよい。   The JCL file storage unit 121 stores one or more JCL files such as the JCL file 134. The program analysis apparatus 100 may receive a JCL file stored in the JCL file storage unit 121 from another apparatus. The program analysis apparatus 100 may read the JCL file from the recording medium 113.

ソースプログラム記憶部122は、ソースプログラム131,132のような1以上のソースプログラムを記憶する。また、ソースプログラム記憶部122は、ソースプログラムから参照される1以上のレコード定義ファイルを記憶する。プログラム分析装置100は、ソースプログラム記憶部122に記憶されるソースプログラムやレコード定義ファイルを他の装置から受信してもよい。また、プログラム分析装置100は、ソースプログラムやレコード定義ファイルを記録媒体113から読み出してもよい。   The source program storage unit 122 stores one or more source programs such as the source programs 131 and 132. Further, the source program storage unit 122 stores one or more record definition files referenced from the source program. The program analysis apparatus 100 may receive a source program or a record definition file stored in the source program storage unit 122 from another apparatus. Further, the program analysis apparatus 100 may read the source program and the record definition file from the recording medium 113.

ファイル参照テーブル記憶部123は、ファイル参照テーブル135を記憶する。タイプ分類テーブル記憶部124は、タイプ分類テーブル136を記憶する。
JCLファイル分析部125は、JCLファイル記憶部121に記憶されたJCLファイルを分析し、JCLファイル名、ジョブ名、プログラム名、中間ファイル名および実ファイル名を抽出する。JCLファイル分析部125は、ファイル参照テーブル記憶部123に記憶されたファイル参照テーブル135に、プログラム名および中間ファイル名と対応付けて、JCLファイル名、ジョブ名および実ファイル名を登録する。
The file reference table storage unit 123 stores a file reference table 135. The type classification table storage unit 124 stores a type classification table 136.
The JCL file analysis unit 125 analyzes the JCL file stored in the JCL file storage unit 121 and extracts the JCL file name, job name, program name, intermediate file name, and actual file name. The JCL file analysis unit 125 registers the JCL file name, job name, and actual file name in the file reference table 135 stored in the file reference table storage unit 123 in association with the program name and the intermediate file name.

ソースプログラム分析部126は、ソースプログラム記憶部122に記憶されたソースプログラムを分析し、プログラム名、中間ファイル名、論理ファイル名およびレコード定義ファイル名を抽出する。ソースプログラム分析部126は、ファイル参照テーブル記憶部123に記憶されたファイル参照テーブル135に、プログラム名、中間ファイル名、論理ファイル名およびレコード定義ファイル名を登録する。   The source program analysis unit 126 analyzes the source program stored in the source program storage unit 122 and extracts a program name, an intermediate file name, a logical file name, and a record definition file name. The source program analysis unit 126 registers the program name, intermediate file name, logical file name, and record definition file name in the file reference table 135 stored in the file reference table storage unit 123.

タイプ判定部127は、ファイル参照テーブル記憶部123に記憶されたファイル参照テーブル135を参照して、ソースプログラム記憶部122に記憶されたソースプログラムやレコード定義ファイルからレコード定義を抽出する。タイプ判定部127は、同一のファイルに対するレコード定義を相互に比較して複数のタイプに分類する。   The type determination unit 127 refers to the file reference table 135 stored in the file reference table storage unit 123 and extracts a record definition from the source program or record definition file stored in the source program storage unit 122. The type determination unit 127 compares record definitions for the same file with each other and classifies them into a plurality of types.

タイプ判定部127は、接頭辞を無視しない場合と接頭辞を無視した場合それぞれについて、複数のタイプそれぞれに属するレコード定義を使用するソースプログラムの数をカウントする。タイプ判定部127は、タイプ分類テーブル記憶部124に記憶されたタイプ分類テーブル136に、接頭辞を無視しない場合のプログラム数と接頭辞を無視した場合のプログラム数を登録する。また、タイプ判定部127は、タイプ毎に1つのレコード定義ファイルを生成するシミュレーションを行い、接頭辞を無視しない場合と接頭辞を無視した場合それぞれについて削減率を試算する。タイプ判定部127は、タイプ分類テーブル記憶部124に記憶されたタイプ分類テーブル136に、接頭辞を無視しない場合の削減率と接頭辞を無視した場合の削減率を登録する。   The type determination unit 127 counts the number of source programs that use record definitions belonging to each of a plurality of types, respectively, when the prefix is not ignored and when the prefix is ignored. The type determination unit 127 registers the number of programs when the prefix is not ignored and the number of programs when the prefix is ignored in the type classification table 136 stored in the type classification table storage unit 124. The type determination unit 127 performs a simulation for generating one record definition file for each type, and calculates a reduction rate for each of the case where the prefix is not ignored and the case where the prefix is ignored. The type determination unit 127 registers, in the type classification table 136 stored in the type classification table storage unit 124, the reduction rate when the prefix is not ignored and the reduction rate when the prefix is ignored.

表示制御部128は、タイプ分類テーブル記憶部124に記憶されたタイプ分類テーブル136に基づいて、可視化画面151〜153のような可視化画面を生成する。表示制御部128は、生成した可視化画面をディスプレイ111に表示させる。表示制御部128は、ユーザからの入力に応じて、表示する可視化画面を切り替えてもよい。なお、プログラム分析装置100は、タイプ分類テーブル136の情報またはそれに基づいて生成された可視化情報(グラフなど)を他の装置に送信してもよい。また、プログラム分析装置100は、タイプ分類テーブル136の情報またはそれに基づいて生成された可視化情報を、ディスプレイ111以外の出力デバイス(プリンタなど)に出力してもよい。   The display control unit 128 generates visualization screens such as the visualization screens 151 to 153 based on the type classification table 136 stored in the type classification table storage unit 124. The display control unit 128 causes the display 111 to display the generated visualization screen. The display control unit 128 may switch the visualization screen to be displayed according to the input from the user. Note that the program analysis apparatus 100 may transmit the information of the type classification table 136 or the visualization information (graph or the like) generated based on the information to another apparatus. Further, the program analysis apparatus 100 may output the information of the type classification table 136 or the visualization information generated based on the information to the output device (such as a printer) other than the display 111.

図14は、プログラム分析の手順例を示すフローチャートである。
(S10)ソースプログラム分析部126は、ソースプログラムを1つ選択する。
(S11)ソースプログラム分析部126は、選択したソースプログラムの見出し部からプログラム名を抽出する。また、ソースプログラム分析部126は、選択したソースプログラムの環境部から中間ファイル名と論理ファイル名を抽出する。
FIG. 14 is a flowchart illustrating a procedure example of program analysis.
(S10) The source program analysis unit 126 selects one source program.
(S11) The source program analysis unit 126 extracts a program name from the heading part of the selected source program. Further, the source program analysis unit 126 extracts the intermediate file name and the logical file name from the environment unit of the selected source program.

(S12)ソースプログラム分析部126は、選択したソースプログラムのデータ部から、ステップS11で抽出した論理ファイル名についての記述を取得する。そして、ソースプログラム分析部126は、当該論理ファイル名についての記述が、当該ソースプログラム外のレコード定義ファイルを参照するものであるか、すなわち、レコード定義を取り込むCOPY文であるか判断する。COPY文である場合はステップS13に処理が進み、COPY文でない場合はステップS14に処理が進む。   (S12) The source program analysis unit 126 acquires a description of the logical file name extracted in step S11 from the data part of the selected source program. Then, the source program analysis unit 126 determines whether the description about the logical file name refers to a record definition file outside the source program, that is, a COPY statement that captures the record definition. If it is a COPY statement, the process proceeds to step S13, and if it is not a COPY statement, the process proceeds to step S14.

(S13)ソースプログラム分析部126は、選択したソースプログラムのデータ部から、論理ファイル名と当該論理ファイル名に対応付けられたレコード定義ファイル名を抽出する。そして、ステップS15に処理が進む。   (S13) The source program analysis unit 126 extracts a logical file name and a record definition file name associated with the logical file name from the data part of the selected source program. Then, the process proceeds to step S15.

(S14)ソースプログラム分析部126は、選択したソースプログラムのデータ部から論理ファイル名を抽出する。そして、ステップS15に処理が進む。
(S15)ソースプログラム分析部126は、ファイル参照テーブル135に、抽出したプログラム名、中間ファイル名、論理ファイル名およびレコード定義ファイル名を対応付けて登録する。ただし、レコード定義ファイル名が抽出されなかった場合(ステップS13を実行しなかった場合)には、レコード定義ファイル名の項目は空欄となる。
(S14) The source program analysis unit 126 extracts a logical file name from the data part of the selected source program. Then, the process proceeds to step S15.
(S15) The source program analysis unit 126 registers the extracted program name, intermediate file name, logical file name, and record definition file name in the file reference table 135 in association with each other. However, when the record definition file name is not extracted (when step S13 is not executed), the item of the record definition file name is blank.

(S16)ソースプログラム分析部126は、未選択の残りのソースプログラムが存在するか判断する。残りのソースプログラムがある場合はステップS10に処理が進み、残りのソースプログラムがない場合はステップS17に処理が進む。   (S16) The source program analysis unit 126 determines whether there are remaining unselected source programs. If there is a remaining source program, the process proceeds to step S10, and if there is no remaining source program, the process proceeds to step S17.

(S17)JCLファイル分析部125は、JCLファイルに記述されたジョブステップを1つ選択する。1つのジョブステップは、1つのソースプログラムの実行を示す。
(S18)JCLファイル分析部125は、選択したジョブステップが記述されたJCLファイルのJCLファイル名を取得する。また、JCLファイル分析部125は、選択したジョブステップの記述から、ジョブ名、起動するソースプログラムのプログラム名、使用するファイルの1以上の中間ファイル名および1以上の実ファイル名を抽出する。
(S17) The JCL file analysis unit 125 selects one job step described in the JCL file. One job step indicates execution of one source program.
(S18) The JCL file analysis unit 125 acquires the JCL file name of the JCL file in which the selected job step is described. Further, the JCL file analysis unit 125 extracts the job name, the program name of the source program to be started, one or more intermediate file names of the files to be used, and one or more actual file names from the description of the selected job step.

(S19)JCLファイル分析部125は、ステップS18で抽出したプログラム名と中間ファイル名の組が、ファイル参照テーブル135に登録されているか判断する。プログラム名と中間ファイル名の組が登録されている場合はステップS20に処理が進み、登録されていない場合はステップS21に処理が進む。   (S19) The JCL file analysis unit 125 determines whether the combination of the program name and the intermediate file name extracted in step S18 is registered in the file reference table 135. If the set of program name and intermediate file name is registered, the process proceeds to step S20, and if not registered, the process proceeds to step S21.

(S20)JCLファイル分析部125は、抽出したプログラム名および中間ファイル名と対応付けて、ステップS18で抽出したJCLファイル名、ジョブ名および実ファイル名をファイル参照テーブル135に登録する。   (S20) The JCL file analysis unit 125 registers the JCL file name, job name, and actual file name extracted in step S18 in the file reference table 135 in association with the extracted program name and intermediate file name.

(S21)JCLファイル分析部125は、未選択の残りのジョブステップが存在するか判断する。残りのジョブステップがある場合はステップS17に処理が進み、残りのジョブステップがない場合はステップS22に処理が進む。   (S21) The JCL file analysis unit 125 determines whether there are any remaining unselected job steps. If there are remaining job steps, the process proceeds to step S17. If there are no remaining job steps, the process proceeds to step S22.

図15は、プログラム分析の手順例を示すフローチャート(続き)である。
(S22)タイプ判定部127は、ファイル参照テーブル135に登録された情報を実ファイル名でソートし、同じ実ファイル名の情報を纏める。
FIG. 15 is a flowchart (continued) showing an example of the procedure of program analysis.
(S22) The type determination unit 127 sorts the information registered in the file reference table 135 by the actual file names, and collects the information of the same actual file names.

(S23)タイプ判定部127は、実ファイル名を1つ選択する。
(S24)タイプ判定部127は、選択した実ファイル名が示すファイルについてのレコード定義を、ソースプログラム記憶部122に記憶されたソースプログラムやレコード定義ファイルから全て抽出する。すなわち、タイプ判定部127は、ファイル参照テーブル135から、選択した実ファイル名を含む情報を抽出する。タイプ判定部127は、レコード定義ファイル名が登録されていない情報に対しては、ソースプログラムからレコード定義を抽出する。一方、タイプ判定部127は、レコード定義ファイル名が登録されている情報に対しては、レコード定義ファイルからレコード定義を抽出する。
(S23) The type determination unit 127 selects one real file name.
(S24) The type determination unit 127 extracts all record definitions for the file indicated by the selected real file name from the source program and record definition file stored in the source program storage unit 122. That is, the type determination unit 127 extracts information including the selected actual file name from the file reference table 135. The type determination unit 127 extracts a record definition from the source program for information for which no record definition file name is registered. On the other hand, the type determination unit 127 extracts the record definition from the record definition file for the information in which the record definition file name is registered.

(S25)タイプ判定部127は、ステップS24で抽出した複数のレコード定義を比較して、それら複数のレコード定義を複数のタイプに分類する。ここでは、タイプ判定部127は、データ項目名の接頭辞を匿名化せずにレコード定義を比較する。よって、同じタイプに属するレコード定義は、データ項目名とデータ型が完全に一致している。   (S25) The type determination unit 127 compares the plurality of record definitions extracted in step S24 and classifies the plurality of record definitions into a plurality of types. Here, the type determination unit 127 compares the record definitions without anonymizing the prefix of the data item name. Therefore, record definitions belonging to the same type have the same data item name and data type.

(S26)タイプ判定部127は、ステップS25で得られた複数のタイプそれぞれについて、当該タイプに属するレコード定義を使用するソースプログラムの数をカウントする。埋め込み形式のソースプログラムについては、当該タイプに属するレコード定義がデータ部に記述されているソースプログラム1つにつき、カウントが+1される。外部参照形式のソースプログラムについては、当該タイプに属するレコード定義を記述したレコード定義ファイルを参照するソースプログラム1つにつき、カウントが+1される。タイプ判定部127は、複数のタイプのプログラム数をタイプ分類テーブル136に登録する。   (S26) For each of the plurality of types obtained in step S25, the type determination unit 127 counts the number of source programs that use the record definition belonging to the type. For the embedded source program, the count is incremented by one for each source program in which the record definition belonging to the type is described in the data part. For a source program in the external reference format, the count is incremented by one for each source program that refers to a record definition file describing a record definition belonging to the type. The type determination unit 127 registers the number of programs of a plurality of types in the type classification table 136.

(S27)タイプ判定部127は、現在のプログラム資産に含まれるソースプログラムおよびレコード定義ファイルの総行数を算出する。
(S28)タイプ判定部127は、タイプ毎にレコード定義を外部化すること、すなわち、タイプ毎に1つのレコード定義ファイルを生成して全てのソースプログラムを外部参照形式に変換するシミュレーションを行う。そして、タイプ判定部127は、レコード定義の外部化により減少する行数を試算する。なお、レコード定義の外部化によりソースプログラムの行数が減少する一方、新たに生成したレコード定義ファイルの行数だけ増加することがある。ここで試算される行数は、両者の差分である実質的な減少行数である。
(S27) The type determination unit 127 calculates the total number of lines of the source program and the record definition file included in the current program asset.
(S28) The type determination unit 127 externalizes the record definition for each type, that is, performs a simulation of generating one record definition file for each type and converting all source programs to the external reference format. Then, the type determination unit 127 calculates the number of lines that decrease due to the externalization of the record definition. Note that externalization of the record definition may decrease the number of lines in the source program, while increasing the number of lines in the newly generated record definition file. The number of rows calculated here is a substantially reduced number of rows which is the difference between the two.

(S29)タイプ判定部127は、ステップS28で試算した減少行数をステップS27で算出した総行数で割った削減率を算出する。タイプ判定部127は、選択した実ファイル名と対応付けて、算出した削減率をタイプ分類テーブル136に登録する。   (S29) The type determination unit 127 calculates a reduction rate obtained by dividing the reduced number of rows calculated in step S28 by the total number of rows calculated in step S27. The type determination unit 127 registers the calculated reduction rate in the type classification table 136 in association with the selected actual file name.

(S30)タイプ判定部127は、ステップS24で抽出したレコード定義に含まれるデータ項目名から接頭辞の部分を判断し、接頭辞を匿名化する。タイプ判定部127は、データ項目名に含まれる接頭辞を特殊な文字または文字列に置換してもよい。また、タイプ判定部127は、データ項目名から接頭辞を削除してもよい。   (S30) The type determination unit 127 determines the prefix portion from the data item name included in the record definition extracted in step S24, and anonymizes the prefix. The type determination unit 127 may replace the prefix included in the data item name with a special character or character string. In addition, the type determination unit 127 may delete the prefix from the data item name.

(S31)タイプ判定部127は、ステップS30で接頭辞を匿名化したレコード定義を用いて、ステップS25〜S29と同様の処理を行う。これにより、接頭辞の違いを無視した場合の複数のタイプが得られ、複数のタイプそれぞれのプログラム数が算出される。また、接頭辞の違いを無視した場合の削減率が算出される。タイプ判定部127は、算出したプログラム数と削減率をタイプ分類テーブル136に登録する。   (S31) The type determination unit 127 performs the same processing as steps S25 to S29 using the record definition in which the prefix is anonymized in step S30. Thereby, a plurality of types when the difference in prefixes is ignored is obtained, and the number of programs of each of the plurality of types is calculated. In addition, the reduction rate when the difference in prefixes is ignored is calculated. The type determination unit 127 registers the calculated number of programs and the reduction rate in the type classification table 136.

(S32)タイプ判定部127は、未選択の残りの実ファイル名が存在するか判断する。残りの実ファイル名がある場合はステップS23に処理が進み、残りの実ファイル名がない場合はステップS33に処理が進む。   (S32) The type determination unit 127 determines whether there are remaining unselected real file names. If there are remaining real file names, the process proceeds to step S23. If there are no remaining real file names, the process proceeds to step S33.

(S33)表示制御部128は、タイプ分類テーブル136に基づいて可視化画面を生成し、ディスプレイ111に可視化画面を表示させる。例えば、表示制御部128は、1以上の実ファイル名について、複数のタイプの間のプログラム数の比を算出し、可視化画面151のような円グラフを表示させる。また、例えば、表示制御部128は、1以上の実ファイル名について、可視化画面152のような積み上げ棒グラフを表示させる。また、例えば、表示制御部128は、可視化画面153のような削減率を表示させる。   (S33) The display control unit 128 generates a visualization screen based on the type classification table 136 and causes the display 111 to display the visualization screen. For example, the display control unit 128 calculates the ratio of the number of programs among a plurality of types for one or more real file names, and displays a pie chart such as the visualization screen 151. For example, the display control unit 128 displays a stacked bar graph such as the visualization screen 152 for one or more real file names. For example, the display control unit 128 displays a reduction rate such as the visualization screen 153.

第2の実施の形態のプログラム分析装置100によれば、ソースプログラムとJCLファイルを分析することで、データが格納された物理的なファイルとソースプログラムとが紐付けられる。この紐付けに基づいて、同一のファイルに対する複数のレコード定義が抽出され、複数のレコード定義の間の比較に基づいてそれら複数のレコード定義が複数のタイプに分類される。そして、複数のタイプそれぞれについてソースプログラムの数がカウントされ、複数のタイプの間のプログラム数の分布が表示される。   According to the program analysis apparatus 100 of the second embodiment, by analyzing the source program and the JCL file, the physical file storing the data and the source program are linked. Based on this association, a plurality of record definitions for the same file are extracted, and the plurality of record definitions are classified into a plurality of types based on comparison between the plurality of record definitions. Then, the number of source programs is counted for each of the plurality of types, and the distribution of the number of programs among the plurality of types is displayed.

これにより、同一のファイルに対する複数のレコード定義の使用状況を可視化することができる。よって、レコード定義の記述方法を統一する修正作業や、レコード定義の記述をソースプログラムからレコード定義ファイルに移動する修正作業を効率化できる。例えば、レコード定義で使用するデータ項目名を統一するにあたり、複数のタイプのうち最もプログラム数の多いタイプのデータ項目名を標準データ項目名として選択することで、修正作業を効率化することができる。また、例えば、プログラム数の多いタイプのレコード定義を修正対象として優先的に検討することで、限られた時間の中で保守性改善効果の大きい修正作業を優先的に行うことが可能となる。また、削減率の大きいファイルについて優先的に修正作業を行うことで、大きな保守性改善効果を得ることができる。   This makes it possible to visualize the usage status of a plurality of record definitions for the same file. Therefore, it is possible to improve the efficiency of the correction work for unifying the record definition description method and the correction work for moving the record definition description from the source program to the record definition file. For example, when unifying data item names used in the record definition, the data item name of the type with the largest number of programs among a plurality of types can be selected as the standard data item name, so that correction work can be made more efficient. . Further, for example, by preferentially considering a record definition of a type having a large number of programs as a correction target, it becomes possible to preferentially perform a correction operation having a large maintainability improvement effect within a limited time. In addition, by performing correction work preferentially for a file with a large reduction rate, it is possible to obtain a significant improvement in maintainability.

10 プログラム分析装置
11 記憶部
12 演算部
13 プログラム資産
14a,14b,14c,14d,14e,14f データ構造定義文
15a,15b,15c タイプ
16 分布情報
DESCRIPTION OF SYMBOLS 10 Program analyzer 11 Memory | storage part 12 Operation part 13 Program assets 14a, 14b, 14c, 14d, 14e, 14f Data structure definition sentence 15a, 15b, 15c Type 16 Distribution information

Claims (6)

コンピュータが実行するプログラム分析方法であって、
同一のファイルにアクセスする複数のプログラムを含むプログラム資産から、それぞれが前記ファイルに格納されるデータの構造を示す複数のデータ構造定義文を抽出し、
前記複数のデータ構造定義文の間の比較に基づいて前記複数のデータ構造定義文を複数のタイプに分類し、前記複数のタイプそれぞれについて前記複数のプログラムのうち当該タイプに属するデータ構造定義文を使用するプログラムの数をカウントし、
前記複数のタイプの間の前記プログラムの数の分布を示す分布情報を出力する、
プログラム分析方法。
A program analysis method executed by a computer,
From a program asset including a plurality of programs that access the same file, a plurality of data structure definition statements each indicating the structure of data stored in the file are extracted,
The plurality of data structure definition statements are classified into a plurality of types based on a comparison between the plurality of data structure definition statements, and a data structure definition statement belonging to the type among the plurality of programs for each of the plurality of types. Count the number of programs used,
Outputting distribution information indicating a distribution of the number of programs among the plurality of types;
Program analysis method.
前記複数のデータ構造定義文それぞれは、前記ファイルに格納されるデータに含まれる1以上のデータ項目に対応する1以上のデータ型を示し、
異なるデータ型を使用するデータ構造定義文は異なるタイプに分類される、
請求項1記載のプログラム分析方法。
Each of the plurality of data structure definition statements indicates one or more data types corresponding to one or more data items included in data stored in the file,
Data structure definition statements that use different data types are classified into different types,
The program analysis method according to claim 1.
前記分布情報は、前記複数のタイプそれぞれの前記プログラムの数を示す第1のグラフ、および、前記複数のタイプの間の前記プログラムの数の比を示す第2のグラフの少なくとも一方を含む、
請求項1記載のプログラム分析方法。
The distribution information includes at least one of a first graph indicating the number of the programs of each of the plurality of types and a second graph indicating a ratio of the number of the programs between the plurality of types.
The program analysis method according to claim 1.
更に、タイプ毎に当該タイプに属するデータ構造定義文を前記複数のプログラムから分離して共通ファイルに集約した場合に生じる前記プログラム資産の規模の変化を算出し、前記規模の変化を示す修正効果情報を出力する、
請求項1記載のプログラム分析方法。
Further, the modification effect information indicating the change in the scale by calculating the change in the scale of the program asset that occurs when the data structure definition statement belonging to the type is separated from the plurality of programs and aggregated into a common file for each type. Output,
The program analysis method according to claim 1.
同一のファイルにアクセスする複数のプログラムを含むプログラム資産を記憶する記憶部と、
前記プログラム資産からそれぞれが前記ファイルに格納されるデータの構造を示す複数のデータ構造定義文を抽出し、前記複数のデータ構造定義文の間の比較に基づいて前記複数のデータ構造定義文を複数のタイプに分類し、前記複数のタイプそれぞれについて前記複数のプログラムのうち当該タイプに属するデータ構造定義文を使用するプログラムの数をカウントし、前記複数のタイプの間の前記プログラムの数の分布を示す分布情報を出力する演算部と、
を有するプログラム分析装置。
A storage unit that stores program assets including a plurality of programs that access the same file;
A plurality of data structure definition statements each indicating the structure of data stored in the file are extracted from the program asset, and the plurality of data structure definition statements are extracted based on a comparison between the plurality of data structure definition statements. The number of programs that use data structure definition statements belonging to the type among the plurality of programs is counted for each of the plurality of types, and the distribution of the number of the programs among the plurality of types is calculated. A calculation unit that outputs distribution information indicating;
A program analysis apparatus.
コンピュータに、
同一のファイルにアクセスする複数のプログラムを含むプログラム資産から、それぞれが前記ファイルに格納されるデータの構造を示す複数のデータ構造定義文を抽出し、
前記複数のデータ構造定義文の間の比較に基づいて前記複数のデータ構造定義文を複数のタイプに分類し、前記複数のタイプそれぞれについて前記複数のプログラムのうち当該タイプに属するデータ構造定義文を使用するプログラムの数をカウントし、
前記複数のタイプの間の前記プログラムの数の分布を示す分布情報を出力する、
処理を実行させる分析プログラム。
On the computer,
From a program asset including a plurality of programs that access the same file, a plurality of data structure definition statements each indicating the structure of data stored in the file are extracted,
The plurality of data structure definition statements are classified into a plurality of types based on a comparison between the plurality of data structure definition statements, and a data structure definition statement belonging to the type among the plurality of programs for each of the plurality of types. Count the number of programs used,
Outputting distribution information indicating a distribution of the number of programs among the plurality of types;
An analysis program that executes processing.
JP2016155457A 2016-08-08 2016-08-08 Program analysis method, program analyzer and analysis program Pending JP2018025852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016155457A JP2018025852A (en) 2016-08-08 2016-08-08 Program analysis method, program analyzer and analysis program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016155457A JP2018025852A (en) 2016-08-08 2016-08-08 Program analysis method, program analyzer and analysis program

Publications (1)

Publication Number Publication Date
JP2018025852A true JP2018025852A (en) 2018-02-15

Family

ID=61193863

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016155457A Pending JP2018025852A (en) 2016-08-08 2016-08-08 Program analysis method, program analyzer and analysis program

Country Status (1)

Country Link
JP (1) JP2018025852A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021053373A1 (en) * 2019-09-19 2021-03-25 Aplas Pty Ltd Method and system for indexing and mapping software assets of business

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021053373A1 (en) * 2019-09-19 2021-03-25 Aplas Pty Ltd Method and system for indexing and mapping software assets of business

Similar Documents

Publication Publication Date Title
US10776569B2 (en) Generation of annotated computerized visualizations with explanations for areas of interest
CN112036736A (en) Workflow creating method and device
JP7054051B2 (en) Software robot definition information generation system, software robot definition information generation method, and program
US20150052157A1 (en) Data transfer content selection
WO2010058222A2 (en) Updating data within a business planning tool
WO2008147729A1 (en) Data visualization
WO2014054230A1 (en) Information system construction device, information system construction method, and storage medium
US20210326366A1 (en) Generation of lineage data subset based upon business role
JP2017045080A (en) Business flow specification regeneration method
US10678864B2 (en) Analysis model preparing system, programming apparatus, and analysis model preparing method
US8392892B2 (en) Method and apparatus for analyzing application
JP2019219848A (en) Source code analysis method and source code analysis device
JP2014123249A (en) Information processor, program, and information processing method
US10296496B2 (en) Data editing device and data editing method
JP2018025852A (en) Program analysis method, program analyzer and analysis program
JP6966289B2 (en) Information analyzers, programs and methods
US20070179922A1 (en) Apparatus and method for forecasting control chart data
CN106844218B (en) Evolution influence set prediction method based on evolution slices
US20060230080A1 (en) Apparatus for tracking work process and computer product
US10114916B1 (en) Method and system to accelerate visualization of waveform data
JP2019101829A (en) Software component management system, computor, and method
JP7082284B2 (en) Analysis support method and analysis support program
JP2016126532A (en) Calculation program, information processing apparatus, and calculation method
US20230401056A1 (en) Interactive code visualization system
JP2014164336A (en) Model analysis device, model analysis method and model analysis program