JP2010086218A - Computer system executing program including java (r) code converted from cobol code, its method, and computer program - Google Patents

Computer system executing program including java (r) code converted from cobol code, its method, and computer program Download PDF

Info

Publication number
JP2010086218A
JP2010086218A JP2008253637A JP2008253637A JP2010086218A JP 2010086218 A JP2010086218 A JP 2010086218A JP 2008253637 A JP2008253637 A JP 2008253637A JP 2008253637 A JP2008253637 A JP 2008253637A JP 2010086218 A JP2010086218 A JP 2010086218A
Authority
JP
Japan
Prior art keywords
data
variable
instruction
char array
char
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.)
Granted
Application number
JP2008253637A
Other languages
Japanese (ja)
Other versions
JP5147626B2 (en
Inventor
Toshio Suganuma
俊夫 菅沼
Hiroshi Arai
寛 新井
Noriaki Kono
紀昭 河野
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.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2008253637A priority Critical patent/JP5147626B2/en
Publication of JP2010086218A publication Critical patent/JP2010086218A/en
Application granted granted Critical
Publication of JP5147626B2 publication Critical patent/JP5147626B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a data structure for satisfying specifications of JAVA code, executing the JAVA code with high speed and efficiency; and to provide an execution method of the JAVA code using the data structure, since there is a great difference in language specifications between a COBOL language and a JAVA (R) language, and when converting a COBOL code into a JAVA code, how the JAVA code efficiently achieves processing described on the COBOL code greatly depends on the design of the data structure. <P>SOLUTION: A computer system executing a program including a JAVA code converted from a COBOL code includes a storage unit storing a program including a JAVA code having at least one declaration of an object of which the data type is a wrapper class that is declaration converted from each declaration of data items included in the COBOL code; and a CPU reading out the program from the storage unit to execute the program. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行するコンピュータ・システム、並びにその方法及びコンピュータ・プログラムに関する。   The present invention relates to a computer system that executes a program including JAVA ™ code converted from COBOL code, and a method and computer program therefor.

いわゆるレガシーマイグレーションとは、メインフレームにおいて構築されたシステムを、UNIX又はWindows(商標)などのプラットフォームに移植することをいう。レガシーマイグレーションの一つの態様として、COBOLからJAVA(商標)へのコード変換の需要が年々高まっている。COBOLからJAVA(商標)へのコード変換のために、開発者は、トランスレータと呼ばれる自動変換プログラムを使い、引き続き、変換後のコードに対して一部手動でチューニングなどを施すのが一般的である。よって、変換後のJAVA(商標)コードの実行性能は、トランスレータの変換コードの質及びその実行時ライブラリの性能に大きく依存する。   So-called legacy migration refers to porting a system built on the mainframe to a platform such as UNIX or Windows (trademark). As one aspect of legacy migration, the demand for code conversion from COBOL to JAVA (trademark) is increasing year by year. For code conversion from COBOL to JAVA (trademark), a developer generally uses an automatic conversion program called a translator, and subsequently performs some manual tuning on the converted code. . Therefore, the execution performance of the JAVA ™ code after conversion largely depends on the quality of the conversion code of the translator and the performance of the runtime library.

COBOLの特徴の一つは、データ項目の宣言とデータ領域とが関連付けられていることである。よって、データ項目及びメモリの管理をJAVA(商標)でどのように実装するかによって、変換後のJAVA(商標)コードの実行性能が大きく変わりうる。
従来のトランスレータでは、小数点を含まない数値データはint型又はlong型に変換され、小数点を含む数値データはBigDecimal型に変換され、及び文字データはString型に変換されてきた。また、階層的な集団データ項目(group data item)は、階層ごとに内部又は外部クラスのオブジェクトとして定義されてきた。
このような実装の問題点は、それぞれのデータ項目が個別のJAVA(商標)のデータ型として表現されることである。String型及びBigDecimal型といった作成後にその状態を変えることのできないデータ型のオブジェクトが用いられた場合、変数の代入又は表示などが実行されるたびに、大量のオブジェクトが新たに生成され、大量のコピー操作が行われてしまう。このような非効率なオブジェクトの生成又はコピー操作は、COBOLコードから変換され実用化されているJAVA(商標)コードを実装している大規模商用アプリケーションにおいても頻繁に見られる。このことは、変換後のJAVA(商標)コードの性能が低い大きな原因となっている。
One of the features of COBOL is that a data item declaration is associated with a data area. Therefore, the execution performance of the JAVA (trademark) code after conversion can vary greatly depending on how the management of data items and memory is implemented by JAVA (trademark).
In conventional translators, numeric data that does not include a decimal point has been converted to an int type or a long type, numeric data that includes a decimal point has been converted to a BigDecimal type, and character data has been converted to a String type. Hierarchical group data items have been defined as internal or external class objects for each hierarchy.
The problem with such an implementation is that each data item is represented as a separate JAVA ™ data type. When data type objects that cannot change their state after creation, such as String type and BigDecimal type, are used, a large number of objects are newly created each time a variable is assigned or displayed, and a large number of copies are made. The operation is performed. Such inefficient object generation or copy operations are frequently found in large-scale commercial applications that implement JAVA ™ code that has been converted from COBOL code and put into practical use. This is a major cause of poor performance of the JAVA ™ code after conversion.

COBOL言語とJAVA(商標)言語との間では、言語仕様の面で大きな隔たりがある。COBOLコードをJAVA(商標)コードに変換する場合に、COBOLコード上で記述されている処理をいかに効率的にJAVA(商標)コードで実現するかは、データ構造の設計によるところが大きい。従って、JAVA(商標)コードの仕様を満たし且つ高速で効率的な実行を可能とするデータ構造及び該データ構造を用いたJAVA(商標)コードの実行方法が求められている。   There is a large gap in terms of language specifications between the COBOL language and the JAVA (trademark) language. When a COBOL code is converted into a JAVA (trademark) code, how efficiently the processing described on the COBOL code is realized with the JAVA (trademark) code depends largely on the design of the data structure. Accordingly, there is a need for a data structure that satisfies the specifications of JAVA (trademark) code and enables high-speed and efficient execution, and a JAVA (trademark) code execution method using the data structure.

本発明は、COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行するコンピュータ・システムを提供する。該コンピュータ・システムは、
ラッパークラスをデータ型とするオブジェクトの少なくとも1の宣言を有するJAVA(商標)コードを含むプログラムを保持する記憶部であって、上記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言である、上記記憶部と、
上記プログラムを上記記憶部からメモリ内に読み出し、該プログラムを実行するCPUと
を含む。
The present invention provides a computer system for executing a program including JAVA ™ code converted from COBOL code. The computer system
A storage unit for holding a program including JAVA (trademark) code having at least one declaration of an object whose data type is a wrapper class, wherein each of the declarations is converted from a declaration of a data item included in the COBOL code. The above memory part,
A CPU that reads the program from the storage unit into the memory and executes the program.

本発明の1つの実施態様では、上記ラッパークラスは、COBOLコードにおいて宣言されているデータ項目のデータ(以下、第1のデータ)に対応するデータ(以下、第2のデータ)を管理する機能を有する。   In one embodiment of the present invention, the wrapper class has a function of managing data (hereinafter referred to as second data) corresponding to data (hereinafter referred to as first data) of a data item declared in the COBOL code. Have.

本発明の1つの実施態様では、上記ラッパークラスが、
上記第2のデータを格納する第1のchar配列と、
上記第2のデータの文字数を格納する変数と、
上記第2のデータが格納される位置を表すオフセット値を格納する変数と
を含む。
In one embodiment of the invention, the wrapper class is
A first char array for storing the second data;
A variable for storing the number of characters of the second data;
And a variable for storing an offset value representing a position where the second data is stored.

本発明の1つの実施態様では、上記ラッパークラスから生成されるオブジェクト(以下、第1のオブジェクト)が、
上記第2のデータに対応する第3のデータを管理し、及び
上記第1のchar配列に対応する第2のchar配列と、
上記第3のデータの文字数を格納する上記変数に対応する第1の変数と、
上記第3のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第2の変数と
を含む。
In one embodiment of the present invention, an object generated from the wrapper class (hereinafter referred to as a first object) is
Managing third data corresponding to the second data, and a second char array corresponding to the first char array;
A first variable corresponding to the variable for storing the number of characters of the third data;
And a second variable corresponding to the variable storing an offset value representing a position where the third data is stored.

本発明の1つの実施態様では、上記第2のchar配列が、
上記第3のデータを格納し、又は、
上記第1のオブジェクトの属する階層構造において上位階層にあり且つ上記ラッパークラスから生成されるところのオブジェクト(以下、第2のオブジェクト)に含まれる第3のchar配列についてのメモリ領域を共有し、
ここで、上記第2のオブジェクトは、上記第1のchar配列に対応する上記第3のchar配列を含み、及び上記第3のchar配列に対して上記メモリ領域が割り当てられている最も上位階層のオブジェクトであり、
上記第3のchar配列は、上記第3のデータが格納される上記メモリ領域を含む。
In one embodiment of the present invention, the second char array is
Storing the third data, or
In the hierarchical structure to which the first object belongs, share a memory area for a third char array included in an object (hereinafter referred to as a second object) that is higher in the hierarchy and is generated from the wrapper class,
Here, the second object includes the third char array corresponding to the first char array, and the highest layer in which the memory area is allocated to the third char array. Object
The third char array includes the memory area in which the third data is stored.

本発明の1つの実施態様では、上記第1の変数が、上記第3のデータの文字数を格納する。   In one embodiment of the present invention, the first variable stores the number of characters of the third data.

本発明の1つの実施態様では、上記第2の変数が、上記メモリ領域上で上記第3のデータが格納される位置を表すオフセット値を格納する。   In one embodiment of the present invention, the second variable stores an offset value representing a position where the third data is stored in the memory area.

本発明の1つの実施態様では、上記ラッパークラスが、
数値型データを格納する変数と、
上記数値型データと上記第1のchar配列上のデータとの相互変換を行うための0又は1のオブジェクト変数と、
上記数値型データを格納する変数の有効性を示すフラグと、
char配列表現の有効性を示すフラグと
をさらに含む。
In one embodiment of the invention, the wrapper class is
A variable that stores numeric data,
An object variable of 0 or 1 for performing mutual conversion between the numeric data and the data on the first char array;
A flag indicating the validity of the variable for storing the numeric data, and
and a flag indicating the validity of the char array representation.

本発明の1つの実施態様では、ラッパークラスから生成されるオブジェクト(第1のオブジェクト)が、
上記第2のデータに対応する第3のデータを管理し、及び
上記第1のchar配列に対応する第2のchar配列と、
上記第3のデータの文字数を格納する上記変数に対応する第1の変数と、
上記第3のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第2の変数と、
上記数値型データを格納する上記変数に対応する第3の変数と、
上記数値型データを格納する変数の有効性を示す上記フラグに対応する第1のフラグと、
上記char配列表現の有効性を示す上記フラグに対応する第2のフラグと
を含み、
上記ラッパークラスが上記相互変換を行うためのオブジェクトを含む場合、上記相互変換を行うためのオブジェクトに対応する第1の相互変換オブジェクトと
をさらに含む。
In one embodiment of the present invention, an object generated from a wrapper class (first object) is
Managing third data corresponding to the second data, and a second char array corresponding to the first char array;
A first variable corresponding to the variable for storing the number of characters of the third data;
A second variable corresponding to the variable storing an offset value representing a position where the third data is stored;
A third variable corresponding to the variable for storing the numeric data;
A first flag corresponding to the flag indicating the validity of a variable storing the numeric data;
A second flag corresponding to the flag indicating the validity of the char array representation, and
When the wrapper class includes an object for performing the mutual conversion, the wrapper class further includes a first mutual conversion object corresponding to the object for performing the mutual conversion.

本発明の1つの実施態様では、ラッパークラスが、上記第1のchar配列についてのメモリ領域を共有する命令をさらに含み、
上記第1のオブジェクトが、上記第1のchar配列に対応する第2のchar配列及び上記共有する命令を含み、
上記第1のオブジェクトの共有する命令が、
上記第2のchar配列についてのメモリ領域を、上記ラッパークラスから生成され且つ上記第1のchar配列に対応する第4のchar配列を有するところの第3のオブジェクトに含まれる上記第4のchar配列についてのメモリ領域と共有する命令
を含む。
In one embodiment of the present invention, the wrapper class further includes an instruction sharing a memory area for the first char array,
The first object includes a second char array corresponding to the first char array and the shared instruction;
The instruction shared by the first object is
The fourth char array included in the third object having a fourth char array generated from the wrapper class and corresponding to the first char array, the memory area for the second char array Instructions shared with the memory area for.

本発明の1つの実施態様では、上記第2のデータが、COBOLのREDEFINES句で宣言される第1のデータに対応するデータであり、
上記第1のオブジェクトの共有する命令が、上記第1のオブジェクトの生成において実行されるコンストラクタに含まれる。
In one embodiment of the present invention, the second data is data corresponding to the first data declared in the REDEFINES clause of COBOL,
The instruction shared by the first object is included in a constructor executed in the generation of the first object.

本発明の1つの実施態様では、上記ラッパークラスが、上記第1のオブジェクトの属する階層構造において下位階層にあり且つ上記ラッパークラスから生成されるところの少なくとも1のオブジェクト(以下、第4のオブジェクト)の定義をさらに含み、
上記CPUが下記命令をさらに実行し、該命令が、
上記第3のデータのセット又はゲットの命令を実行する命令と、
上記第2のchar配列についてのメモリ領域が割り当てられていない場合、
上記第2のchar配列に対してメモリ領域を割り当てる命令と、
上記第4のオブジェクトに含まれる第5のchar配列についてのメモリ領域を共有する命令であって、
上記第4のオブジェクトが、
上記第2のデータに対応する第4のデータを管理し、及び
上記第1のchar配列に対応する上記第5のchar配列と、
上記第4のデータの文字数を格納する上記変数に対応する第4の変数と、
上記第4のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第5の変数と
を含む、上記共有する命令と、
上記第5の変数に対して、上記第4のデータの上記第2のchar配列についての上記メモリ領域における位置を設定する命令と
を含む。
In one embodiment of the present invention, the wrapper class is at a lower level in the hierarchical structure to which the first object belongs and is generated from the wrapper class (hereinafter, fourth object). Further including the definition of
The CPU further executes the following instruction, and the instruction is:
An instruction to execute the third data set or get instruction;
If the memory area for the second char array is not allocated,
An instruction for allocating a memory area for the second char array;
An instruction for sharing a memory area for a fifth char array included in the fourth object,
The fourth object is
Managing the fourth data corresponding to the second data, and the fifth char array corresponding to the first char array;
A fourth variable corresponding to the variable storing the number of characters of the fourth data;
The shared instruction including: a fifth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
An instruction for setting a position in the memory area for the second char array of the fourth data with respect to the fifth variable.

本発明の1つの実施態様では、上記共有する命令が、
上記第5のchar配列に対してメモリ領域が割り当てられている場合に、上記第5のchar配列に格納された上記第4のデータを上記第2のchar配列にコピーする命令をさらに含む。
In one embodiment of the invention, the shared instruction is
When a memory area is allocated to the fifth char array, the CPU further includes an instruction to copy the fourth data stored in the fifth char array to the second char array.

本発明の1つの実施態様では、上記ラッパークラスが、上記第1のオブジェクトの属する階層構造において下位階層にあり且つ上記ラッパークラスから生成されるところの少なくとも1のオブジェクト(第4のオブジェクト)の定義をさらに含み、
上記CPUが下記命令をさらに実行し、該命令が、
上記第3のデータのセット又はゲットの命令を実行する命令と、
上記第2のchar配列についてのメモリ領域が割り当てられていない場合、
上記第2のchar配列に対してメモリ領域を割り当てる命令と、
上記第4のオブジェクトに含まれる第5のchar配列についてのメモリ領域を共有する命令であって、
上記第4のオブジェクトが、
上記第2のデータに対応する第4のデータを管理し、及び
上記第1のchar配列に対応する上記第5のchar配列と、
上記第4のデータの文字数を格納する上記変数に対応する第4の変数と、
上記第4のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第5の変数と、
上記数値型データを格納する上記変数に対応する第6の変数と、
上記相互変換を行うためのオブジェクトに対応する第2の相互変換オブジェクトと、
上記数値型データを格納する変数の有効性を示す上記フラグに対応する第3のフラグと、
上記char配列表現の有効性を示す上記フラグに対応する第4のフラグと
を含む、上記共有する命令と、
上記第5の変数に対して、上記第4のデータの上記第2のchar配列についての上記メモリ領域における位置を設定する命令と
を含む。
In one embodiment of the present invention, the wrapper class is defined in at least one object (fourth object) that is in a lower hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class. Further including
The CPU further executes the following instruction, and the instruction is:
An instruction to execute the third data set or get instruction;
If the memory area for the second char array is not allocated,
An instruction for allocating a memory area for the second char array;
An instruction for sharing a memory area for a fifth char array included in the fourth object,
The fourth object is
Managing the fourth data corresponding to the second data, and the fifth char array corresponding to the first char array;
A fourth variable corresponding to the variable storing the number of characters of the fourth data;
A fifth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
A sixth variable corresponding to the variable for storing the numeric data;
A second mutual conversion object corresponding to the object for performing the mutual conversion;
A third flag corresponding to the flag indicating the validity of the variable storing the numeric data;
The shared instruction comprising: a fourth flag corresponding to the flag indicating the validity of the char array representation;
An instruction for setting a position in the memory area for the second char array of the fourth data with respect to the fifth variable.

本発明の1つの実施態様では、上記共有する命令が、
上記第5のchar配列に対してメモリ領域が割り当てられている場合に、上記第5のchar配列に格納された上記第4のデータを上記第2のchar配列にコピーする命令をさらに含む。
In one embodiment of the invention, the shared instruction is
When a memory area is allocated to the fifth char array, the CPU further includes an instruction to copy the fourth data stored in the fifth char array to the second char array.

本発明の1つの実施態様では、上記コピーする命令が、
上記第4のオブジェクトの有する上記第3のフラグを無効に設定する命令
をさらに含む。
In one embodiment of the invention, the instruction to copy is
A command for invalidating the third flag of the fourth object;

本発明の1つの実施態様では、
セットされるデータとして数値型データが与えられた場合、上記CPUが下記命令をさらに実行し、該命令が、
上記第3の変数に上記数値型データをセットする命令と、
上記第2のフラグを無効に設定する命令と
を含む。
In one embodiment of the invention,
When numerical data is given as the data to be set, the CPU further executes the following command,
An instruction to set the numeric data in the third variable;
And an instruction for setting the second flag to be invalid.

本発明の1つの実施態様では、上記第3の変数に上記数値型データをセットする命令が、
上記第1のフラグを有効に設定する命令
をさらに含む。
In one embodiment of the present invention, an instruction to set the numeric data in the third variable is
Further included is an instruction for effectively setting the first flag.

本発明の1つの実施態様では、上記命令の実行がゲットの命令であり、
上記CPUが下記命令をさらに実行し、該命令が、
上記メモリ領域が共有された上記第5のchar配列から上記第4のデータを取り出す命令
を含む。
In one embodiment of the invention, execution of the instruction is a get instruction,
The CPU further executes the following instruction, and the instruction is:
An instruction for fetching the fourth data from the fifth char array sharing the memory area;

本発明の1つの実施態様では、上記命令の実行がゲットの命令であり、
上記CPUが下記命令をさらに実行し、該命令が、
上記第4のフラグを取得し、該取得した第4のフラグが有効に設定されていることを確認する命令
を含む。
In one embodiment of the invention, execution of the instruction is a get instruction,
The CPU further executes the following instruction, and the instruction is:
An instruction for acquiring the fourth flag and confirming that the acquired fourth flag is set to be valid is included.

本発明の1つの実施態様では、上記CPUが下記命令をさらに実行し、該命令が、
上記第3の変数から数値型データを取得する命令と、
上記第1の相互変換オブジェクトを用いて、上記取得したデータを文字型のデータに変換する命令と、
上記変換された文字型のデータを上記第2のchar配列に設定する命令と、
上記第2のフラグを有効に設定する命令と
を含む。
In one embodiment of the present invention, the CPU further executes the following instruction:
An instruction to obtain numeric data from the third variable;
An instruction for converting the acquired data into character type data using the first mutual conversion object;
An instruction to set the converted character type data in the second char array;
And an instruction for effectively setting the second flag.

本発明の1つの実施態様では、上記CPUが下記命令をさらに実行し、該命令が、
上記第2のchar配列から文字型のデータを取得する命令と、
上記第1の相互変換オブジェクトを用いて、上記取得した文字型のデータを数値型データに変換する命令と、
上記変換された数値型データを上記第3の変数に設定する命令と、
上記第1のフラグを有効に設定する命令と
を含む。
In one embodiment of the present invention, the CPU further executes the following instruction:
An instruction to obtain character type data from the second char array;
Using the first mutual conversion object, an instruction for converting the acquired character type data into numeric type data;
An instruction to set the converted numeric data to the third variable;
And an instruction for effectively setting the first flag.

本発明の1つの実施態様では、
ゲットするデータとして数値型データを取得する場合、上記CPUが下記命令をさらに実行し、該命令が
上記第1のフラグが有効に設定されていることを確認する命令と、
上記第3の変数から上記数値型データを取得する命令と
を含む。
In one embodiment of the invention,
When obtaining numerical data as data to be obtained, the CPU further executes the following instruction, and the instruction confirms that the first flag is set to be valid;
An instruction for obtaining the numeric data from the third variable.

本発明では、COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行する方法を提供する。該方法は、コンピュータ・システムに下記ステップを実行させることを含む。該ステップは、
ラッパークラスをデータ型とするオブジェクトの少なくとも1の宣言を有する上記プログラムを記憶部からメモリ内に読み出すステップであって、上記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言である、上記読み出すステップと、
上記読み出したプログラムを実行するステップと
を含む。
The present invention provides a method for executing a program including JAVA ™ code converted from COBOL code. The method includes causing a computer system to perform the following steps. The step is
Reading the program having at least one declaration of an object whose data type is a wrapper class from the storage unit into the memory, wherein each of the declarations is a declaration converted from each of the declarations of the data items included in the COBOL code. The step of reading out,
Executing the read program.

本発明の1つの実施態様では、上記ラッパークラスが、COBOLコードにおいて宣言されているデータ項目のデータ(第1のデータ)に対応するデータ(第2のデータ)を管理する機能を有し、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記第1のオブジェクトが生成されることに応じて、上記管理する機能が上記第1のオブジェクトに提供されるステップを含む。   In one embodiment of the present invention, the wrapper class has a function of managing data (second data) corresponding to data (first data) of a data item declared in the COBOL code, The method includes causing the computer system to further perform the following steps. The step includes the step of providing the managing function to the first object in response to the generation of the first object.

本発明の1つの実施態様では、上記ラッパークラスは、
上記第2のデータを格納する第1のchar配列と、
上記第2のデータの文字数を格納する変数と、
上記第2のデータが格納される位置を表すオフセット値を格納する変数と
を含み、
上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記ラッパークラスから生成されるオブジェクト(第1のオブジェクト)が生成されることに応じて、下記を上記第1のオブジェクトに提供するステップを含む:
上記第1のchar配列に対応する第2のchar配列;
上記第3のデータの文字数を格納する上記変数に対応する第1の変数;及び
上記第3のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第2の変数。
In one embodiment of the invention, the wrapper class is
A first char array for storing the second data;
A variable for storing the number of characters of the second data;
A variable for storing an offset value representing a position where the second data is stored, and
The method includes causing the computer system to further perform the following steps. The step is
In response to the generation of an object (first object) generated from the wrapper class, the method includes providing the first object with:
A second char array corresponding to the first char array;
A first variable corresponding to the variable storing the number of characters of the third data; and a second variable corresponding to the variable storing an offset value representing a position where the third data is stored.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記第2のchar配列に、
上記第3のデータを格納するステップ、又は、
上記第1のオブジェクトの属する階層構造において上位階層にあり且つ上記ラッパークラスから生成されるところのオブジェクト(第2のオブジェクト)に含まれる第3のchar配列についてのメモリ領域を共有するステップ
を含み、
ここで、上記第2のオブジェクトは、上記第1のchar配列に対応する上記第3のchar配列を含み、及び上記第3のchar配列に対して上記メモリ領域が割り当てられている最も上位階層のオブジェクトであり、
上記第3のchar配列は、上記第3のデータが格納される上記メモリ領域を含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes the second char array,
Storing the third data, or
Sharing a memory area for a third char array included in an object (second object) that is in an upper hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class,
Here, the second object includes the third char array corresponding to the first char array, and the highest layer in which the memory area is allocated to the third char array. Object
The third char array includes the memory area in which the third data is stored.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記第1の変数に、上記第3のデータの文字数を格納するステップを含む。   In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes a step of storing the number of characters of the third data in the first variable.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記第2の変数に、上記メモリ領域上で上記第3のデータが格納される位置を表すオフセット値を格納するステップを含む。   In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes a step of storing, in the second variable, an offset value representing a position where the third data is stored on the memory area.

本発明の1つの実施態様では、上記ラッパークラスは、
数値型データを格納する変数と、
上記数値型データと上記第1のchar配列上のデータとの相互変換を行うための0又は1のオブジェクトと、
上記数値型データを格納する変数の有効性を示すフラグと、
char配列表現の有効性を示すフラグと
をさらに含み、
上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記ラッパークラスから生成されるオブジェクト(第1のオブジェクト)が生成されることに応じて、下記を上記第1のオブジェクトに提供するステップを含む:
上記第1のchar配列に対応する第2のchar配列;
上記第3のデータの文字数を格納する上記変数に対応する第1の変数;
上記第3のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第2の変数;
上記数値型データを格納する上記変数に対応する第3の変数;
上記数値型データを格納する変数の有効性を示す上記フラグに対応する第1のフラグ;及び
上記char配列表現の有効性を示す上記フラグに対応する第2のフラグ。
また、上記第1のオブジェクトに提供するステップは、
上記ラッパークラスが上記相互変換を行うためのオブジェクトを含む場合、
上記相互変換を行うためのオブジェクトに対応する第1の相互変換オブジェクトを上記第1のオブジェクトに提供するステップ
をさらに含む。
In one embodiment of the invention, the wrapper class is
A variable that stores numeric data,
An object of 0 or 1 for performing mutual conversion between the numeric data and the data on the first char array;
A flag indicating the validity of the variable for storing the numeric data, and
a flag indicating the validity of the char array representation, and
The method includes causing the computer system to further perform the following steps. The step is
In response to the generation of an object (first object) generated from the wrapper class, the method includes providing the first object with:
A second char array corresponding to the first char array;
A first variable corresponding to the variable storing the number of characters of the third data;
A second variable corresponding to the variable storing an offset value representing a position where the third data is stored;
A third variable corresponding to the variable storing the numeric data;
A first flag corresponding to the flag indicating the validity of the variable storing the numerical data; and a second flag corresponding to the flag indicating the validity of the char array representation.
The step of providing to the first object includes:
When the wrapper class includes an object for performing the mutual conversion,
Providing the first object with a first interconversion object corresponding to the object for performing the interconversion.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記第1のオブジェクトに、上記第2のデータに対応する第3のデータを格納するステップを含む。   In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes a step of storing third data corresponding to the second data in the first object.

本発明の1つの実施態様では、上記ラッパークラスは、上記第1のchar配列についてのメモリ領域を共有する命令をさらに含み、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記ラッパークラスから生成されるオブジェクト(第1のオブジェクト)が生成されることに応じて、上記メモリ領域を共有する命令が上記第1のオブジェクトに提供されるステップを含む。
ここで、上記第1のオブジェクトは、上記第1のchar配列に対応する第2のchar配列及び上記共有する命令を含み、上記第1のオブジェクトの共有する命令は、上記第2のchar配列についてのメモリ領域を、上記ラッパークラスから生成され且つ上記第1のchar配列に対応する第4のchar配列を有するところの第3のオブジェクトに含まれる上記第4のchar配列についてのメモリ領域と共有する命令を含む。
In one embodiment of the invention, the wrapper class further includes instructions that share a memory area for the first char array, and the method further includes causing the computer system to perform the following steps. The step includes a step of providing an instruction for sharing the memory area to the first object in response to generation of an object (first object) generated from the wrapper class.
Here, the first object includes a second char array corresponding to the first char array and the shared instruction, and the shared instruction of the first object is related to the second char array. Is shared with the memory area for the fourth char array included in the third object that is generated from the wrapper class and has a fourth char array corresponding to the first char array. Includes instructions.

本発明の1つの実施態様では、上記第2のデータが、COBOLのREDEFINES句で宣言される第1のデータに対応するデータであり、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記第1のオブジェクトが生成されることに応じて、
上記第1のオブジェクトの共有する命令が、上記第1のオブジェクトの生成において実行されるコンストラクタに提供されるステップを含む。
In one embodiment of the present invention, the second data is data corresponding to the first data declared in the COBOL REDEFINES clause, and the method further causes the computer system to perform the following steps: including. The step is
In response to the generation of the first object,
Instructions shared by the first object are provided to a constructor that is executed in the creation of the first object.

本発明の1つの実施態様では、上記ラッパークラスが、上記第1のオブジェクトの属する階層構造において下位階層にあり且つ上記ラッパークラスから生成されるところの少なくとも1のオブジェクト(第4のオブジェクト)の定義をさらに含む。上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記第3のデータのセット又はゲットの命令を実行するステップと、
上記第2のchar配列についてのメモリ領域が割り当てられていない場合、
上記第2のchar配列に対してメモリ領域を割り当てるステップと、
上記第4のオブジェクトに含まれる第5のchar配列についてのメモリ領域を共有するステップであって、
上記第4のオブジェクトが、
上記第2のデータに対応する第4のデータを管理し、及び
上記第1のchar配列に対応する上記第5のchar配列と、
上記第4のデータの文字数を格納する上記変数に対応する第4の変数と、
上記第4のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第5の変数と
を含む、上記共有するステップと、
上記第5の変数に対して、上記第4のデータの上記第2のchar配列についての上記メモリ領域における位置を設定するステップと
を含む。
In one embodiment of the present invention, the definition of at least one object (fourth object) in which the wrapper class is in a lower hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class Further includes. The method includes causing the computer system to further perform the following steps. The step is
Executing the third data set or get instruction;
If the memory area for the second char array is not allocated,
Allocating a memory area to the second char array;
A step of sharing a memory area for a fifth char array included in the fourth object,
The fourth object is
Managing the fourth data corresponding to the second data, and the fifth char array corresponding to the first char array;
A fourth variable corresponding to the variable storing the number of characters of the fourth data;
The sharing step including: a fifth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
Setting a position in the memory area for the second char array of the fourth data for the fifth variable.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記共有するステップが、
上記第5のchar配列に対してメモリ領域が割り当てられている場合に、上記第5のchar配列に格納された上記第4のデータを上記第2のchar配列にコピーするステップをさらに含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes the step of sharing,
When a memory area is assigned to the fifth char array, the method further includes a step of copying the fourth data stored in the fifth char array to the second char array.

本発明の1つの実施態様では、上記ラッパークラスが、上記第1のオブジェクトの属する階層構造において下位階層にあり且つ上記ラッパークラスから生成されるところの少なくとも1のオブジェクト(第4のオブジェクト)の定義をさらに含む。上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記第3のデータのセット又はゲットの命令を実行するステップと、
上記第2のchar配列についてのメモリ領域が割り当てられていない場合、
上記第2のchar配列に対してメモリ領域を割り当てるステップと、
上記第4のオブジェクトに含まれる第5のchar配列についてのメモリ領域を共有するステップであって、
上記第4のオブジェクトが、
上記第2のデータに対応する第4のデータを管理し、及び
上記第1のchar配列に対応する上記第5のchar配列と、
上記第4のデータの文字数を格納する上記変数に対応する第4の変数と、
上記第4のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第5の変数と、
上記数値型データを格納する上記変数に対応する第6の変数と、
上記相互変換を行うためのオブジェクトに対応する第2の相互変換オブジェクトと、
上記数値型データを格納する変数の有効性を示す上記フラグに対応する第3のフラグと、
上記char配列表現の有効性を示す上記フラグに対応する第4のフラグと
を含む、上記共有するステップと、
上記第5の変数に対して、上記第4のデータの上記第2のchar配列についての上記メモリ領域における位置を設定するステップと
を含む。
In one embodiment of the present invention, the wrapper class is defined in at least one object (fourth object) that is in a lower hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class. Further includes. The method includes causing the computer system to further perform the following steps. The step is
Executing the third data set or get instruction;
If the memory area for the second char array is not allocated,
Allocating a memory area for the second char array;
Sharing a memory area for a fifth char array included in the fourth object,
The fourth object is
Managing the fourth data corresponding to the second data, and the fifth char array corresponding to the first char array;
A fourth variable corresponding to the variable storing the number of characters of the fourth data;
A fifth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
A sixth variable corresponding to the variable for storing the numeric data;
A second mutual conversion object corresponding to the object for performing the mutual conversion;
A third flag corresponding to the flag indicating the validity of the variable storing the numeric data;
The sharing step, including: a fourth flag corresponding to the flag indicating the validity of the char array representation;
Setting a position in the memory area for the second char array of the fourth data for the fifth variable.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記共有するステップが、
上記第5のchar配列に対してメモリ領域が割り当てられている場合に、上記第5のchar配列に格納された上記第4のデータを上記第2のchar配列にコピーするステップをさらに含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes the step of sharing,
When a memory area is assigned to the fifth char array, the method further includes a step of copying the fourth data stored in the fifth char array to the second char array.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記コピーするステップが、
上記第4のオブジェクトの有する上記第3のフラグを無効に設定するステップ
をさらに含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step includes the step of copying,
The method further includes the step of invalidating the third flag of the fourth object.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、セットされるデータとして数値型データが与えられた場合、
上記第3の変数に上記数値型データをセットするステップと、
上記第2のフラグを無効に設定するステップと
をさらに含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. When the numerical data is given as the data to be set,
Setting the numeric data in the third variable;
Setting the second flag to invalid.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、上記第3の変数に上記数値型データをセットするステップが、
上記第1のフラグを有効に設定するステップ
をさらに含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. In this step, the step of setting the numeric data in the third variable includes
The method further includes the step of effectively setting the first flag.

本発明の1つの実施態様では、上記第3のデータのセット又はゲットの命令を実行するステップにおいてゲットの命令を実行する。上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記メモリ領域が共有された上記第5のchar配列から上記第4のデータを取り出すステップ
をさらに含む。
In one embodiment of the invention, the get instruction is executed in the step of executing the third data set or get instruction. The method includes causing the computer system to further perform the following steps. The step is
The step of fetching the fourth data from the fifth char array sharing the memory area is further included.

本発明の1つの実施態様では、上記第3のデータのセット又はゲットの命令を実行するステップにおいてゲットの命令を実行する。上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記第4のフラグを取得し、該取得した第4のフラグが有効に設定されていることを確認するステップ
をさらに含む。
In one embodiment of the invention, the get instruction is executed in the step of executing the third data set or get instruction. The method includes causing the computer system to further perform the following steps. The step is
The method further includes the step of acquiring the fourth flag and confirming that the acquired fourth flag is set to be valid.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記第3の変数から数値型データを取得するステップと、
上記第1の相互変換オブジェクトを用いて、上記取得したデータを文字型のデータに変換するステップと、
上記変換された文字型のデータを上記第2のchar配列に設定するステップと、
上記第2のフラグを有効に設定するステップと
を含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step is
Obtaining numeric data from the third variable;
Converting the acquired data into character type data using the first mutual conversion object;
Setting the converted character type data in the second char array;
Setting the second flag valid.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
上記第2のchar配列から文字型のデータを取得するステップと、
上記第1の相互変換オブジェクトを用いて、上記取得した文字型のデータを数値型データに変換するステップと、
上記変換された数値型データを上記第3の変数に設定するステップと、
上記第1のフラグを有効に設定するステップと
を含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step is
Obtaining character type data from the second char array;
Using the first mutual conversion object, converting the acquired character type data into numeric type data;
Setting the converted numeric data to the third variable;
Setting the first flag valid.

本発明の1つの実施態様では、上記方法は、コンピュータ・システムに下記ステップをさらに実行させることを含む。該ステップは、
ゲットするデータとして数値型データを取得する場合、
上記第1のフラグが有効に設定されていることを確認するステップと、
上記第3の変数から上記数値型データを取得するステップと
を含む。
In one embodiment of the invention, the method includes causing the computer system to further perform the following steps. The step is
If you want to get numeric data as the data to get,
Confirming that the first flag is enabled;
Obtaining the numeric data from the third variable.

本発明は、COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行する方法を提供する。該方法は、コンピュータ・システムに下記ステップを実行させることを含む。該ステップは、
ラッパークラスをデータ型とするオブジェクトの少なくとも1の宣言を有するJAVA(商標)コードを含むプログラムを記憶部からメモリ内に読み出すステップであって、
上記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言であり、上記ラッパークラスは、COBOLコードにおいて宣言されているデータ項目のデータ(第1のデータ)に対応するデータ(第2のデータ)を管理する機能を有し、
上記ラッパークラスは、
上記第2のデータを格納する第1のchar配列と、
上記第2のデータの文字数を格納する変数と、
上記第2のデータが格納される位置を表すオフセット値を格納する変数と、
数値型データを格納する0又は1の変数と、
上記数値型データと上記第1のchar配列上のデータとの相互変換を行うための0又は1のオブジェクトと、
上記数値型データを格納する変数の有効性を示す0又は1のフラグと、
char配列表現の有効性を示す0又は1のフラグと、
上記ラッパークラスから生成される0以上のオブジェクトの定義と
を含み、
上記ラッパークラスから生成されるオブジェクト(第1のオブジェクト)は、
上記第2のデータに対応する第3のデータを管理し、及び
上記第1のchar配列に対応する第2のchar配列と、
上記第3のデータの文字数を格納する上記変数に対応する第1の変数と、
上記第3のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第2の変数と、
上記第1のオブジェクトの属する階層構造において下位階層にあり且つ上記ラッパークラスから生成されるところの少なくとも1のオブジェクト(下位階層のオブジェクト:ここで、該下位階層のオブジェクトは上記第4のオブジェクトに対応する)と
を含み、
上記下位階層のオブジェクトは、
上記第2のデータに対応する第4のデータを管理し、及び
上記第1のchar配列に対応する上記第3のchar配列と、
上記第4のデータの文字数を格納する上記変数に対応する第3の変数と、
上記第4のデータが格納される位置を表すオフセット値を格納する上記変数に対応する第4の変数と、
上記数値型データを格納する上記変数に対応する第5の変数と、
上記相互変換を行うためのオブジェクトに対応する第2の相互変換オブジェクトと、
上記数値型データを格納する変数の有効性を示す上記フラグに対応する第1のフラグと、
上記char配列表現の有効性を示す上記フラグに対応する第2のフラグと
を含む、
上記読み出すステップと、
上記第3のデータのセット又はゲットの命令を実行するステップと、
上記第2のchar配列についてのメモリ領域が割り当てられていない場合、
上記第2のchar配列に対してメモリ領域を割り当てるステップと、
上記下位階層のオブジェクトに含まれる第3のchar配列についてのメモリ領域を共有するステップと、
上記第4の変数に対して、上記第4のデータの上記第2のchar配列についての上記メモリ領域における位置を設定するステップと
を含む。
The present invention provides a method for executing a program including JAVA ™ code converted from COBOL code. The method includes causing a computer system to perform the following steps. The step is
Reading a program including JAVA (trademark) code having at least one declaration of an object whose data type is a wrapper class from a storage unit into a memory;
Each of the declarations is a declaration converted from each of the declarations of the data items included in the COBOL code, and the wrapper class includes data (first data) corresponding to data (first data) declared in the COBOL code. (Second data) management function,
The above wrapper class is
A first char array for storing the second data;
A variable for storing the number of characters of the second data;
A variable for storing an offset value representing a position where the second data is stored;
A variable of 0 or 1 that stores numeric data,
An object of 0 or 1 for performing mutual conversion between the numeric data and the data on the first char array;
A 0 or 1 flag indicating the validity of a variable for storing the numeric data;
a 0 or 1 flag indicating the validity of the char array representation;
Including zero or more object definitions generated from the wrapper class,
The object (first object) generated from the wrapper class is
Managing third data corresponding to the second data, and a second char array corresponding to the first char array;
A first variable corresponding to the variable for storing the number of characters of the third data;
A second variable corresponding to the variable storing an offset value representing a position where the third data is stored;
In the hierarchical structure to which the first object belongs, at least one object that is in the lower hierarchy and is generated from the wrapper class (lower hierarchy object: where the lower hierarchy object corresponds to the fourth object Including) and
The lower hierarchy objects are
Managing the fourth data corresponding to the second data, and the third char array corresponding to the first char array;
A third variable corresponding to the variable for storing the number of characters of the fourth data;
A fourth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
A fifth variable corresponding to the variable for storing the numeric data;
A second mutual conversion object corresponding to the object for performing the mutual conversion;
A first flag corresponding to the flag indicating the validity of a variable storing the numeric data;
A second flag corresponding to the flag indicating the validity of the char array representation, and
The reading step;
Executing the third data set or get instruction;
If the memory area for the second char array is not allocated,
Allocating a memory area to the second char array;
Sharing a memory area for a third char array included in the lower layer object;
Setting a position in the memory area for the second char array of the fourth data for the fourth variable.

本発明はさらに、COBOLコードから変換されたJAVA(商標)コードを含むコンピュータ・プログラムを提供する。該コンピュータ・プログラムは、コンピュータ・システムに、上記のいずれかに記載の方法の各ステップを実行させることを含む。   The present invention further provides a computer program including JAVA ™ code converted from COBOL code. The computer program includes causing a computer system to execute each step of the method described above.

本発明は、COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行する方法を提供する。該方法は、コンピュータ・システムに下記ステップを実行させることを含む。該ステップは、
COBOLコードからJAVA(商標)コードに変換するステップであって、該変換するステップは、
COBOLコードを保持する記憶部からCOBOLコードをメモリ内に読み出すステップと、
上記メモリ内に読み出したCOBOLコードにおいて、集団データ項目の宣言を、構造体についてのラッパークラスの宣言に置き換えるステップと、
上記集団データ項目の下位階層のデータ項目の宣言を、ラッパークラスの宣言に置き換えるステップと
を含む、上記変換するステップと、
上記変換されたJAVA(商標)コードを含むプログラムを記憶部からメモリ内に読み出すステップであって、上記プログラムはラッパークラスのオブジェクトの少なくとも1の宣言を有し、上記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言である、上記読み出すステップと、
上記読み出したプログラムを実行するステップと
を含む。
The present invention provides a method for executing a program including JAVA ™ code converted from COBOL code. The method includes causing a computer system to perform the following steps. The step is
Converting COBOL code to JAVA ™ code, the converting step comprising:
Reading the COBOL code into the memory from the storage unit holding the COBOL code;
Replacing the declaration of the group data item with the declaration of the wrapper class for the structure in the COBOL code read into the memory;
Converting the declaration of the data item in the lower hierarchy of the group data item with a declaration of the wrapper class, and converting the data,
Reading out the program including the converted JAVA (trademark) code from the storage unit into the memory, wherein the program has at least one declaration of an object of the wrapper class, and each of the declarations is included in the COBOL code. The above-mentioned reading step, which is a declaration converted from the declaration of each data item
Executing the read program.

本発明の実施態様によると、COBOLコードから変換されるJAVA(商標)コードの可読性及び保守性が向上する。また、COBOLの機能であるREDEFINES、階層型データ構造などの、データ本体を共有することができるデータ構造がJAVA(商標)コード上で実現される。該データ構造によって、無駄なコピー操作の発生が抑止され、またJAVA(商標)プログラムの実行時に、無駄なメモリ領域が確保されないため、実行性能が向上する。   According to the embodiment of the present invention, the readability and maintainability of JAVA ™ code converted from COBOL code is improved. In addition, a data structure capable of sharing a data body such as REDEFINES, which is a function of COBOL, and a hierarchical data structure is realized on the JAVA (trademark) code. With this data structure, generation of useless copy operations is suppressed, and execution performance is improved because a useless memory area is not secured when executing the JAVA (trademark) program.

本発明の実施態様において、「ラッパークラス」は、独自のデータ型を定義したクラスである。上記ラッパークラスは、COBOLコードで宣言されているデータ項目のデータをJAVA(商標)コード上で管理する機能を有する。上記データを管理する機能は、上記ラッパークラスをデータ型とするオブジェクトに提供される。上記ラッパークラスには、上記データ項目のデータをJAVA(商標)コード上で管理するためのメンバ変数及びメソッドが含まれる。上記ラッパークラスから生成されるオブジェクトは、上記データ項目のデータをJAVA(商標)コード上で管理する。
上記ラッパークラスは、文字データを格納するchar配列、データの文字数を格納する変数及び上記データが格納される位置を表すオフセット値を格納する変数をメンバ変数に持つ。これらのメンバ変数は、例えば共通の機能を提供するための共通クラスに定義される。ラッパークラスは、上記共通クラスを継承(extends)することで、上記メンバ変数を持つことができる。
上記ラッパークラスには、COBOLの文字列の定義に対応するラッパークラス、COBOLの小数点を含む数値の定義に対応するラッパークラス、COBOLの小数点を含まない数値の定義に対応するラッパークラス及びCOBOLの集団データ項目の定義に対応するラーパークラスがある。上記小数点を含む数値の定義に対応するラッパークラス及び小数点を含まない数値の定義に対応するラッパークラスは、数値型データを格納する変数、上記数値型データと上記char配列上のデータとの相互変換を行うためのオブジェクト、上記数値型データを格納する変数の有効性を示すフラグ及び上記char配列表現の有効性を示すフラグをメンバ変数に有する。また、COBOLのREDEFINES句で宣言されるデータ項目のデータをJAVA(商標)コード上で管理する機能を提供するラッパークラスは、上記char配列についてのメモリ領域を、上記ラッパークラスから生成される別のオブジェクトに含まれるchar配列についてのメモリ領域と共有するためのメソッドを有する。
上記ラッパークラスは、ライブラリとして提供されうる。
In the embodiment of the present invention, the “wrapper class” is a class that defines a unique data type. The wrapper class has a function of managing data of data items declared in the COBOL code on the JAVA (trademark) code. The function of managing the data is provided to an object whose data type is the wrapper class. The wrapper class includes member variables and methods for managing the data item data on JAVA (trademark) code. The object generated from the wrapper class manages the data item data on JAVA (trademark) code.
The wrapper class has, as member variables, a char array that stores character data, a variable that stores the number of characters of the data, and a variable that stores an offset value indicating a position where the data is stored. These member variables are defined in a common class for providing a common function, for example. The wrapper class can have the member variables by extending the common class.
The above wrapper class includes a wrapper class corresponding to the definition of the COBOL character string, a wrapper class corresponding to the definition of the numerical value including the decimal point of the COBOL, a wrapper class corresponding to the definition of the numerical value not including the decimal point of the COBOL, and the group of the COBOL. There is a wrapper class corresponding to the data item definition. The wrapper class corresponding to the definition of the numerical value including the decimal point and the wrapper class corresponding to the definition of the numerical value not including the decimal point are the mutual conversion between the variable storing the numerical data, the numerical data and the data on the char array. The member variable includes an object for performing the above, a flag indicating the validity of the variable storing the numerical data, and a flag indicating the validity of the char array expression. In addition, a wrapper class that provides a function for managing data of a data item declared in a COBOL REDEFINES clause on JAVA (trademark) code is a memory class for the char array, and is generated by another wrapper class generated from the wrapper class. It has a method for sharing with the memory area for the char array contained in the object.
The wrapper class can be provided as a library.

本発明の実施態様において、「データ項目」とは、COBOLにおいて、扱われるデータを一定期間記憶し、必要なときに利用できるようにするために、データを記憶するメモリ領域に固有の名前を与えたものである。データ項目は、JAVA(商標)における変数と対応する。本発明の実施態様では、データ項目毎に、上記ラッパークラスのオブジェクトが生成される。   In the embodiment of the present invention, a “data item” is a name given to a memory area for storing data so that the data handled in the COBOL is stored for a certain period and can be used when necessary. It is a thing. Data items correspond to variables in JAVA ™. In the embodiment of the present invention, an object of the wrapper class is generated for each data item.

本発明の実施態様において、「char配列」とは、char型の文字データを扱うための配列である。上記char配列は、ラッパークラスで定義される。上記char配列は、ラッパークラスから生成されるオブジェクトそれぞれが有する。上記ラッパークラスでサポートされるデータ型の内部メモリは、上記char配列で統一的に扱われる。また、char配列本体は、メモリ領域が独自に割り当てられている、又は割り当てられたメモリ領域がラッパークラスから生成される他のオブジェクトと共有されているchar配列である。char配列へのポインタは、上記char配列本体への参照である。   In the embodiment of the present invention, the “char array” is an array for handling char-type character data. The char array is defined by a wrapper class. Each of the objects generated from the wrapper class has the char array. The internal memory of the data type supported by the wrapper class is handled uniformly by the char array. The char array body is a char array in which a memory area is uniquely allocated, or the allocated memory area is shared with other objects generated from the wrapper class. The pointer to the char array is a reference to the char array body.

本発明の実施態様において、「データの文字数」とは、COBOLのデータ項目のデータに対応し且つラッパークラスのオブジェクトで管理されるところのデータの文字数である。上記データの文字数が格納される変数は、ラッパークラスで定義される。上記データの文字数が格納される変数は、ラッパークラスから生成されるオブジェクトそれぞれが有する。また、該文字数は、char型での文字数である。例えば、COBOLにおいて整数部が2桁であり且つ小数部が2桁である数字型のデータは、整数部に2文字、小数部に2文字、さらに小数点に1文字が必要であるので、データの文字数は5文字である。   In the embodiment of the present invention, the “number of characters of data” is the number of characters of data corresponding to the data of the COBOL data item and managed by the wrapper class object. The variable that stores the number of characters of the data is defined in the wrapper class. Each of the objects generated from the wrapper class has a variable in which the number of characters of the data is stored. The number of characters is the number of characters in the char type. For example, in COBOL, numeric data with an integer part of 2 digits and a decimal part of 2 digits requires 2 characters for the integer part, 2 characters for the decimal part, and 1 character for the decimal point. The number of characters is 5.

本発明の実施態様において、「データが格納される位置を表すオフセット値」は、該オフセット値を有するオブジェクトが共有しているchar配列本体上での、管理するデータの位置を表す値である。上記オフセット値が格納される変数は、ラッパークラスで定義される。上記オフセット値が格納される変数は、ラッパークラスから生成されるオブジェクトそれぞれが有する。該オフセット値は、例えば、char配列本体の要素番号である。   In the embodiment of the present invention, the “offset value indicating the position where data is stored” is a value indicating the position of data to be managed on the main body of the char array shared by objects having the offset value. The variable in which the offset value is stored is defined in the wrapper class. Each variable generated from the wrapper class has a variable in which the offset value is stored. The offset value is, for example, the element number of the char array body.

本発明の実施態様において、「階層構造」とは、COBOLの集団データ項目(Group Data Item)で多段に階層的に宣言されるデータ項目の構造を指す。本発明の実施態様では、ラッパークラスのオブジェクト(以下、オブジェクト1)で管理されるデータが、別のラッパークラスのオブジェクト(以下、オブジェクト2)で管理されるデータの一部分であるようなデータ構造として表現される。ここで、上記オブジェクト1及び2は、階層構造に属するオブジェクトである。そして、上記オブジェクト1は上記オブジェクト2からみて下位階層のオブジェクト、上記オブジェクト2は上記オブジェクト1からみて上位階層のオブジェクトである。
また、上記階層構造の階層は、2段以上49段以下にすることができる。例えば、上記オブジェクト2で管理されるデータが、さらに別のラッパークラスのオブジェクト(以下、オブジェクト3)で管理されるデータの一部分であってもよい。この場合、上記オブジェクト1〜3が、階層構造に属するオブジェクトである。そして、上記オブジェクト1は上記オブジェクト3からみて最も下位階層のオブジェクトであり、上記オブジェクト3は上記オブジェクト1からみて最も上位階層のオブジェクトである。
In the embodiment of the present invention, the “hierarchical structure” refers to a structure of data items that are hierarchically declared in multiple stages in a COBOL group data item (Group Data Item). In the embodiment of the present invention, the data managed by the wrapper class object (hereinafter referred to as object 1) is a data structure that is a part of the data managed by another wrapper class object (hereinafter referred to as object 2). Expressed. Here, the objects 1 and 2 are objects belonging to a hierarchical structure. The object 1 is an object in a lower hierarchy as viewed from the object 2, and the object 2 is an object in an upper hierarchy as viewed from the object 1.
Further, the hierarchy of the hierarchical structure can be in the range of 2 to 49. For example, the data managed by the object 2 may be a part of data managed by another wrapper class object (hereinafter, object 3). In this case, the objects 1 to 3 are objects belonging to a hierarchical structure. The object 1 is the object in the lowest hierarchy as viewed from the object 3, and the object 3 is the object in the highest hierarchy as viewed from the object 1.

本発明の実施態様において、「メモリ領域を共有する」とは、ラッパークラスのオブジェクトに管理されるデータを格納するchar配列に割り当てられたメモリ領域を、1以上の他のラッパークラスのオブジェクトから利用できるようにすることである。   In the embodiment of the present invention, “sharing a memory area” means that a memory area allocated to a char array storing data managed by an object of a wrapper class is used from one or more other wrapper class objects Is to be able to do it.

本発明の実施態様において、「数値型データを格納する変数」とは、ラッパークラスのオブジェクトに管理されるデータを数値型で格納するための変数である。上記数値型データを格納する変数は、数値型データを扱うラッパークラスで定義される。上記数値型データを格納する変数は、数値型データを扱うラッパークラスから生成されるオブジェクトそれぞれが有する。上記数値型データは、値を示すオブジェクトである値オブジェクト又はプリミティブ型のデータである。
本発明の実施態様において、COBOLの小数点を含む数値の定義に対応するラッパークラスは、上記数値型データを格納する変数として上記値オブジェクトを有する。値オブジェクトは、例えば、BigDecimalオブジェクトである。また、COBOLの小数点を含まない数値の定義に対応するラッパークラスであって、数値に変換された場合、プリミティブ型のデータのレンジ内である数値の定義に対応するラッパークラスは、上記数値型のデータを格納する変数として上記プリミティブ型のデータを格納する変数を有する。なお、COBOLにおける小数点を含まない数値データであって、上記プリミティブ型の変数に格納されるとレンジあふれをしてしまうような桁数の多い上記数値データを管理するラッパークラスのオブジェクトは、上記プリミティブ型のデータを格納する変数を有しない。COBOLにおけるデータの文字数が、上記プリミティブ型のデータを格納する変数のレンジ内であることが保証される場合のみ、COBOLの小数点を含まない数値の定義に対応するラッパークラスは、上記プリミティブ型のデータを格納する変数を有する。ここで、上記プリミティブ型のデータを格納する変数は、int型またはlong型の変数である。なお、上記プリミティブ型の変数に格納されるとレンジあふれをしてしまうような桁数の多い上記数値データを管理するラッパークラスのオブジェクトは、COBOLの小数点を含む数値の定義に対応するラッパークラスと同様に、値オブジェクトを有する。該値オブジェクトは、例えば、BigIntegerオブジェクトである。
In the embodiment of the present invention, the “variable for storing numerical data” is a variable for storing data managed by the wrapper class object in numerical form. The variable for storing the numeric data is defined by a wrapper class that handles numeric data. Each of the objects generated from the wrapper class that handles the numeric data has a variable for storing the numeric data. The numeric type data is a value object or primitive type data that is an object indicating a value.
In the embodiment of the present invention, the wrapper class corresponding to the definition of the numerical value including the decimal point of the COBOL has the value object as a variable for storing the numerical data. The value object is, for example, a BigDecimal object. In addition, a wrapper class corresponding to the definition of a numerical value that does not include a decimal point of COBOL, and when converted to a numerical value, the wrapper class corresponding to the definition of the numerical value within the range of the primitive type data is As a variable for storing data, a variable for storing the primitive type data is included. Note that the wrapper class object for managing the numeric data with a large number of digits that does not include a decimal point in COBOL and overflows the range when stored in the primitive type variable is the primitive. Does not have a variable to store type data. Only when it is guaranteed that the number of characters of data in the COBOL is within the range of the variable storing the primitive data, the wrapper class corresponding to the definition of the numerical value not including the decimal point of the COBOL is the data of the primitive type. Has a variable for storing. Here, the variable for storing the primitive type data is an int type or long type variable. Note that the wrapper class object that manages the numerical data with a large number of digits that would overflow the range when stored in the primitive type variable is a wrapper class corresponding to the definition of the numerical value including the decimal point of COBOL. Similarly, it has a value object. The value object is, for example, a BigInteger object.

本発明の実施態様において、「相互変換を行うためのオブジェクト」とは、char型配列のデータを数値型のデータに変換する又は数値型のデータをchar型配列のデータに変換するためのオブジェクトである。上記相互変換を行うためのオブジェクトは、小数点を含む数値型のデータを扱うラッパークラスで定義される。上記相互変換を行うためのオブジェクトは、小数点を含む数値型のデータを扱うラッパークラスから生成されるオブジェクトそれぞれが有する。上記相互変換を行うためのオブジェクトは、例えば、DecimalFormatのオブジェクトである。   In the embodiment of the present invention, the “object for performing mutual conversion” is an object for converting char-type array data into numeric-type data or converting numeric-type data into char-type array data. is there. An object for performing the above mutual conversion is defined by a wrapper class that handles numeric data including a decimal point. The objects for performing the above-described mutual conversion are included in each object generated from a wrapper class that handles numeric type data including a decimal point. The object for performing the mutual conversion is, for example, a DecimalFormat object.

本発明の実施態様において、「数値型データを格納する変数の有効性を示すフラグ」とは、上記数値型データを格納する変数に格納されたデータが有効であること又は無効であることを示すフラグである。また、「char配列表現の有効性を示すフラグ」とは、上記char配列本体に格納されているデータが有効であること又は無効であることを示すフラグである。上記2つのフラグは、数値型のデータを扱うラッパークラスで定義される。上記2つのフラグは、数値型のデータを扱うラッパークラスから生成されるオブジェクトそれぞれが有する。   In the embodiment of the present invention, the “flag indicating the validity of a variable for storing numerical data” indicates that the data stored in the variable for storing the numerical data is valid or invalid. Flag. The “flag indicating the validity of the char array representation” is a flag indicating that the data stored in the char array body is valid or invalid. The above two flags are defined in a wrapper class that handles numeric type data. Each of the two flags has an object generated from a wrapper class that handles numeric data.

本発明の実施態様において、「コンストラクタ」とは、オブジェクトが生成される場合に実行される命令である。   In an embodiment of the present invention, a “constructor” is an instruction that is executed when an object is created.

本発明の実施態様において、「セット又はゲットの命令」は、ラッパークラスのオブジェクトに管理されるデータを書き込む又は読み出す命令(メソッド)である。   In the embodiment of the present invention, the “set or get instruction” is an instruction (method) for writing or reading data managed in an object of the wrapper class.

本発明の実施態様において、「char配列についてのメモリ領域がアロケートされていない」とは、該char配列にメモリ領域が割り当てられていないことを示す。   In the embodiment of the present invention, “the memory area for the char array is not allocated” indicates that no memory area is allocated to the char array.

以下、図面に従って、本発明の実施態様を説明する。本実施態様は、本発明の好適な態様を説明するためのものであり、本発明の範囲をここで示すものに限定する意図はないことを理解されたい。また、以下の図を通して、特に断らない限り、同一の符号は、同一の対象を指す。   Embodiments of the present invention will be described below with reference to the drawings. It should be understood that this embodiment is for the purpose of illustrating a preferred embodiment of the invention and is not intended to limit the scope of the invention to what is shown here. Further, throughout the following drawings, the same reference numerals denote the same objects unless otherwise specified.

図1は、COBOLにおけるデータ部の記述の例を示す。
COBOLでは、プログラマーは、プログラムで使用するデータ項目を上記データ部にPICTURE句を使って宣言する。以下は、COBOL文(101)の2行目を例にした、COBOLにおける上記宣言の説明である。
COBOL文(101)の2行目1番目の項目(102)は、2行目で定義されるデータ項目の属する階層レベルが「02」であることを示す。該階層レベルについては後述する。
COBOL文(101)の2行目の2番目の項目(103)は、2行目で定義されるデータ項目の名前が「Name」であることを示す。
COBOL文(101)の2行目の3番目の項目(104)は、2行目で定義されるデータ項目が任意の10文字の文字列であることを示す。「PIC」は、PICTURE句を示す。PICに続く記述は、データ項目のデータ領域内のサイズ及びタイプを示す。Xは任意の文字列であり、Aはアルファベット文字であり、9は数値を示す。括弧内の記述は桁数を示す。また、Vは、小数点の位置を示す。例えば、該記述が999であるならば、データ項目は3桁の数値である。該記述がA(20)であるならば、データ項目は20文字のアルファベット文字である。該記述が9(10)V99であるならば、データ項目は、10桁で小数点以下2桁を含む数値である。
COBOL文(101)の2行目の4番目の項目(105)は、2行目で定義されるデータ項目に与えられた初期値がスペースであることを示す。「VALUE」は、VALUE句を示し初期値を表す。VALUE句は任意に指定可能である。上記指定がない場合は、文字データの場合はスペース、数値データの場合は0がセットされる。
FIG. 1 shows an example of the description of the data part in COBOL.
In COBOL, a programmer declares a data item to be used in a program in the data part using a PICTURE clause. The following is an explanation of the above declaration in COBOL, taking the second line of the COBOL statement (101) as an example.
The first item (102) on the second line of the COBOL statement (101) indicates that the hierarchical level to which the data item defined on the second line belongs is “02”. The hierarchical level will be described later.
The second item (103) on the second line of the COBOL statement (101) indicates that the name of the data item defined on the second line is “Name”.
The third item (104) on the second line of the COBOL statement (101) indicates that the data item defined on the second line is an arbitrary 10-character string. “PIC” indicates a PICTURE phrase. The description following the PIC indicates the size and type in the data area of the data item. X is an arbitrary character string, A is an alphabetic character, and 9 is a numerical value. The description in parentheses indicates the number of digits. V indicates the position of the decimal point. For example, if the description is 999, the data item is a three digit number. If the description is A (20), the data item is 20 alphabetic characters. If the description is 9 (10) V99, the data item is a numeric value with 10 digits and 2 digits after the decimal point.
The fourth item (105) on the second line of the COBOL statement (101) indicates that the initial value given to the data item defined on the second line is a space. “VALUE” indicates a VALUE phrase and represents an initial value. The VALUE clause can be arbitrarily specified. If there is no such designation, a space is set for character data and 0 is set for numeric data.

COBOLでは、配列はOCCURS句を使って定義される。例えば、COBOL文(101)の1行目は、40の要素を有する構造体配列StudentRecordを定義したものである。   In COBOL, an array is defined using an OCCURS clause. For example, the first line of the COBOL statement (101) defines a structure array StudentRecord having 40 elements.

COBOLコードをJAVA(商標)コードに変換する場合に、プログラムの性能に特に大きく影響を与えると考えられるCOBOLの仕様には、以下に示すものがある。   COBOL specifications that are considered to have a particularly large effect on program performance when converting COBOL code to JAVA (trademark) code include the following.

COBOLでは、PICTURE句で宣言されるいくつかの基本データ項目を集めて集団データ項目とすることができる。さらに、上記配列はまた、集団データ項目の1つである。該集団データ項目は、階層的なデータ構造として宣言される。例えば、COBOL文(101)において、1行目(106)の階層レベルは「01」であり、2〜5行目の階層レベルは「02」である。これは、2〜5行目で定義されるデータ項目であるName、MathScore、ScienceScore及びAvgScoreを集めた集団データ項目が、1行目で定義される構造体配列StudentRecordであることを示す。
上記集団データ項目の要素には、別の集団データ項目も含めることができる。例えば、COBOL文(101)において、2行目のデータ項目であるNameは、さらに、データ項目であるFamilyName及びPersonalNameを集めた集団データ項目に変更することができる。上記FamilyName及びPersonalNameは、階層レベルが「03」以上「49」以下のデータ項目として定義される。階層レベルの上限が「49」である理由は、COBOLにおいて、階層は最高49段まで重ねることができるからである。このように、階層的なデータ構造をなすデータ項目において、階層レベルの値が小さいデータ項目は上位階層のデータ項目となり、階層レベルの値が大きいデータ項目は下位階層のデータ項目となる。
COBOLにおいて、集団データ項目に対してのデータのセット及びゲットの操作は、集団データ項目の要素である全てのデータ項目に対して適用される。例えば、COBOL文(101)において、構造体配列StudentRecordのn要素目にデータ「ABCDEFGHIJ12345678901」がセットされたとする(MOVE DATA TO StudentRecord(n))。該セットの後に、構造体配列StudentRecordのn要素目のデータ項目MathScoreがゲットされた場合、得られるデータは「123」である。このように、COBOLでは、一括でセットされたデータの個々のデータ項目のデータが取得される。そして、該取得されたデータを使って処理が実行される。
また、上記構造体配列StudentRecordのn要素目のデータ項目MathScoreが「123」から「987」に変更されたとする。該変更の後に、構造体配列StudentRecordのn要素目がゲットされた場合、得られるデータは「ABCDEFGHIJ98745678901」である。このように、COBOLでは、個々のデータ項目に対してセットされたデータが、集団データ項目を使用してまとめて取得されうる。そして、該取得されたデータを使って、例えば、全体を集計する処理が実行される。
また、上記データのセット及びゲットの操作は、どの階層レベルのデータ項目に対しても実行できる。上記データのセット及びゲットの操作において、データのサイズが指定されている場合、サイズ分だけの操作が、データに適用される。
In COBOL, several basic data items declared in a PICTURE clause can be collected into a collective data item. Furthermore, the sequence is also one of the population data items. The collective data item is declared as a hierarchical data structure. For example, in the COBOL statement (101), the hierarchical level of the first line (106) is “01”, and the hierarchical level of the second to fifth lines is “02”. This indicates that the group data item obtained by collecting the data items Name, MathScore, ScienceScore, and AvgScore defined in the second to fifth lines is a structure array StudentRecord defined in the first line.
The element of the group data item may include another group data item. For example, in the COBOL statement (101), the name of the data item in the second line can be further changed to a collective data item that is a collection of the data items FamilyName and PersonalName. The FamilyName and PersonalName are defined as data items having a hierarchical level of “03” or more and “49” or less. The reason why the upper limit of the hierarchy level is “49” is that the hierarchy can be stacked up to 49 levels in COBOL. In this way, in data items having a hierarchical data structure, a data item having a small hierarchical level value is a higher hierarchical data item, and a data item having a large hierarchical level value is a lower hierarchical data item.
In COBOL, data set and get operations on collective data items are applied to all data items that are elements of the collective data item. For example, in the COBOL statement (101), data “ABCDEFGHIJ12345678901” is set to the n element of the structure array StudentRecord (MOVE DATA TO StudentRecord (n)). When the data item MathScore of the nth element of the structure array StudentRecord is obtained after the set, the obtained data is “123”. Thus, in COBOL, data of individual data items of data set in a batch is acquired. Then, processing is executed using the acquired data.
Further, it is assumed that the data item MathScore of the nth element of the structure array StudentRecord is changed from “123” to “987”. When the n-th element of the structure array StudentRecord is obtained after the change, the obtained data is “ABCDEFGHIJ98774567801”. In this way, in COBOL, data set for individual data items can be collectively acquired using a collective data item. Then, using the acquired data, for example, a process of totaling the whole is executed.
In addition, the above data set and get operations can be performed on data items at any hierarchical level. In the above data set and get operations, when the data size is specified, the operation corresponding to the size is applied to the data.

COBOLは、あるデータ項目に対して確保されたデータ領域を、他のデータ項目に対するデータ領域として共有させる機能を有する。該機能は、REDEFINES句を使って定義される。該共有の機能により、異なるデータ項目名を用いて同一のデータ領域にアクセスすることができる。
COBOL文(107)は、REDEFINES句の例を示す。COBOL文(107)の1行目は、36文字の文字列のデータ項目であるMonthDefを定義したものである。MonthDefに対するデータ領域には、初期値として「JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC」が設定されている。そして、上記MonthDefに対するデータ領域が、COBOL文(107)の2行目におけるREDEFINES句によって、MonthNameに対するデータ領域として共有されている。
COBOL文(107)の3行目は、MonthNameの下位階層に配列Monthを定義したものである。配列Monthは、3文字の文字列である。また、配列Monthの要素数は12である。ここで、MonthNameに対するデータ領域は、MonthDefに対するデータ領域と共有されている。そのため、MonthNameの下位階層のデータ項目である配列Monthに対するデータ領域もまた、MonthDefに対するデータ領域と共有されている。従って例えば、MonthNameの3番目の要素であるMonth(3)に対して“XXX”を代入し、データ項目であるMonthDefを表示する以下の命令、
MOVE “XXX” TO Month(3)
DISPLAY “MonthDef = ” MonthDef
が実行されると、表示されるMonthDefの値は、「JANFEBXXXAPRMAYJUNJULAUGSEPOCTNOVDEC」である。
The COBOL has a function of sharing a data area reserved for a certain data item as a data area for other data items. The function is defined using the REDEFINES clause. With the sharing function, the same data area can be accessed using different data item names.
The COBOL statement (107) shows an example of the REDEFINES phrase. The first line of the COBOL statement (107) defines MonthDef which is a data item of a character string of 36 characters. In the data area for MonthDef, “JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC” is set as an initial value. The data area for the MonthDef is shared as the data area for the MonthName by the REDEFINES phrase in the second line of the COBOL statement (107).
The third line of the COBOL statement (107) defines an array “Month” in the lower hierarchy of “MonthName”. The array Month is a three-character string. The number of elements in the array “Month” is 12. Here, the data area for MonthName is shared with the data area for MonthDef. Therefore, the data area for the array “Month”, which is a data item in the lower hierarchy of “MonthName”, is also shared with the data area for “MonthDef”. Thus, for example, the following command for substituting “XXX” for the third element of MonthName, “Month (3)”, and displaying the data item “MonthDef”:
MOVE “XXX” TO Month (3)
DISPLAY “MonthDef =” MonthDef
When Def is executed, the displayed value of MonthDef is “JANFEBXXXAPRMAYJUNJULAUGSEPOCTNOVDEC”.

本発明の実施態様では、上記COBOLの仕様である階層的なデータ構造に対応するデータ構造として、以下の構造が用いられる。   In the embodiment of the present invention, the following structure is used as a data structure corresponding to the hierarchical data structure that is the specification of the COBOL.

COBOLにおけるデータ項目のデータは、JAVA(商標)におけるchar配列のデータに変換されて使用される。階層が最上位のデータ項目であり且つ小数点を含まない数値のデータ以外のデータの定義に、JAVA(商標)のデータ型を直接用いない。ここで、JAVA(商標)のデータ型とは、String又はBigDecimalなどのあらかじめJAVA(商標)に用意されている基本データ型を指す。データ項目に対応するデータが定義される場合、該定義にはラッパークラスが用いられる。該ラッパークラスは、ライブラリとして提供されうる。該ラッパークラスは、char配列をフィールドに含む共通クラスを継承して作成される。該共通クラスは、以下の内部フィールドを有する。
public class COMMON_DATA {
private char [ ] _body; // 値のchar配列本体
private final int _length; // 文字数
private int _start; // char配列へのオフセット

共通クラスは、文字データを格納するchar配列(_body)、データの文字数を格納する変数(_length)及びデータが格納される位置を表すオフセット値を格納する変数(_start)をフィールドに有する。変数(_body)は、char配列へのポインタを格納するための領域である。変数(_length)は、データの文字数を格納するための領域である。変数(_start)は、char配列本体において、データが開始される位置を格納するための領域である。
The data item data in COBOL is used after being converted into char array data in JAVA (trademark). The data type of JAVA (trademark) is not directly used for the definition of data other than numerical data whose hierarchy is the highest data item and does not include a decimal point. Here, the data type of JAVA (trademark) refers to a basic data type prepared in advance in JAVA (trademark) such as String or BigDecimal. When data corresponding to a data item is defined, a wrapper class is used for the definition. The wrapper class can be provided as a library. The wrapper class is created by inheriting a common class including a char array in a field. The common class has the following internal fields:
public class COMMON_DATA {
private char [] _body; // char array body of the value
private final int _length; // number of characters
private int _start; // offset to char array}
The common class has a char array (_body) that stores character data, a variable (_length) that stores the number of characters of data, and a variable (_start) that stores an offset value indicating the position where the data is stored. The variable (_body) is an area for storing a pointer to the char array. The variable (_length) is an area for storing the number of characters of data. The variable (_start) is an area for storing the position where data is started in the char array body.

文字列のデータ項目のデータがJAVA(商標)コードにおいて定義される場合、該定義には、ラッパークラスCHARSが用いられる。ここで文字列のデータ項目とは、COBOLのPICTURE句において、タイプとして「X」又は「A」が指定されたデータ項目である。具体的には、COBOL文(図1、101及び107)における、Name、MonthDef及びMonthが該当する。
ラッパークラスCHARSは、上記共通クラスを継承したクラスとして実装される。ラッパークラスCHARSのフィールドは、共通クラスのフィールドのみで構成される。ラッパークラスCHARSから生成されるオブジェクトは、JAVA(商標)において文字列を表すデータ型を操作するStringオブジェクトと同様に、データ本体として内部に文字データを格納するchar配列、文字数を格納する変数及びオフセット値を格納する変数を有する。
When data of a character string data item is defined in JAVA (trademark) code, a wrapper class CHARS is used for the definition. Here, the data item of the character string is a data item in which “X” or “A” is designated as the type in the PICTURE clause of the COBOL. Specifically, “Name”, “MonthDef”, and “Month” in the COBOL statement (FIGS. 1, 101, and 107) are applicable.
The wrapper class CHARS is implemented as a class that inherits the common class. The field of the wrapper class CHARS is composed of only the common class field. The object generated from the wrapper class CHARS is a char array that stores character data internally as a data body, a variable that stores the number of characters, and an offset, similar to a String object that operates a data type representing a character string in JAVA (trademark). Has a variable that stores the value.

小数点を含む数値のデータ項目のデータがJAVA(商標)コードにおいて定義される場合、該定義には、ラッパークラスDECIMALが用いられる。ここで、小数点を含む数値のデータ項目とは、COBOLのPICTURE句において、タイプとして「9」が指定され「V」を含むデータ項目である。具体的には、COBOL文(図1、101及び107)における、AvgScoreが該当する。
ラッパークラスDECIMALは、共通クラスを継承したものとして実装される。該継承により、ラッパークラスDECIMALから生成されるオブジェクトは、小数点を含む数値を文字列として格納するためのchar配列、文字数を格納する変数及びオフセット値を格納する変数を有する。さらにラッパークラスDECIMALは、上記共通クラスのフィールドに加え、以下の内部フィールドを有する。
public class DECIMAL extends COMMON_DATA {
private BigDecimal _value; // 値オブジェクト
private DecimalFormat _format; //フォーマット
private boolean _validValue; /値オブジェクトの有効性フラグ
private boolean _validChar; //値のchar配列表現の有効性フラグ

ラッパークラスDECIMALは、上記共通クラスが有する変数に加え、値オブジェクト(_value)、相互変換オブジェクト(_format)、値オブジェクトの有効性フラグ(_validValue)及び値のchar配列表現の有効性フラグ(_validChar)をフィールドに有する。値オブジェクト(_value)は、数値型でデータ本体を有するための、BigDecimal型オブジェクトである。なお、BigDecimalは、JAVA(商標)言語において任意精度の符号付き10進小数を表すデータ型を操作するためのクラスである。相互変換オブジェクト(_format)は、数値と文字列とを相互に変換する機能を有するDecimalFormat型オブジェクトである。相互変換オブジェクト(_format)は、数値のフォーマット毎にスレッド単位で同じインスタンスであることが実行効率の点から望まれる。値オブジェクトの有効性フラグ(_validValue)は、値オブジェクト(_value)の有するデータが、char配列に設定されているデータの更新により、最新の状態ではなくなったことを示すフラグである。値のchar配列表現の有効性フラグ(_validChar)はchar配列に設定されているデータが、値オブジェクト(_value)の有するデータの更新により、最新の状態ではなくなったことを示すフラグである。
When data of a numerical data item including a decimal point is defined in JAVA (trademark) code, a wrapper class DECIMAL is used for the definition. Here, a numerical data item including a decimal point is a data item including “V” that is designated as “9” as a type in the PICTURE clause of COBOL. Specifically, AvgScore in the COBOL sentence (FIGS. 1, 101 and 107) corresponds.
The wrapper class DECIMAL is implemented as an inheritance of the common class. By the inheritance, the object generated from the wrapper class DECIMAL has a char array for storing a numerical value including a decimal point as a character string, a variable for storing the number of characters, and a variable for storing an offset value. Furthermore, the wrapper class DECIMAL has the following internal fields in addition to the fields of the common class.
public class DECIMAL extends COMMON_DATA {
private BigDecimal _value; // value object
private DecimalFormat _format; // format
private boolean _validValue; / Validity flag of the value object
private boolean _validChar; // Validity flag of char array representation of value}
The wrapper class DECIMAL has the value object (_value), the mutual conversion object (_format), the validity flag of the value object (_validValue), and the validity flag (_validChar) of the char array representation of the value in addition to the variables of the common class. Have in the field. The value object (_value) is a BigDecimal type object for having a data body with a numerical type. BigDecimal is a class for manipulating a data type representing an arbitrary-precision signed decimal number in the JAVA (trademark) language. The mutual conversion object (_format) is a DecimalFormat type object having a function of mutually converting a numerical value and a character string. It is desirable from the viewpoint of execution efficiency that the mutual conversion object (_format) is the same instance in units of threads for each numerical format. The validity flag (_validValue) of the value object is a flag indicating that the data held by the value object (_value) is no longer the latest state due to the update of the data set in the char array. The validity flag (_validChar) of the char array representation of the value is a flag indicating that the data set in the char array is no longer in the latest state due to the update of the data of the value object (_value).

下位階層のデータ項目であり且つ小数点を含まない数値のデータ項目のデータがJAVA(商標)コードにおいて定義される場合、該定義には、ラッパークラスINTが用いられる。ここで、小数点を含まない数値のデータ項目とは、COBOLのPICTURE句において、タイプとして「9」が指定され且つ「V」を含まないデータ項目である。具体的には、COBOL文(図1、101及び107)における、MathScore及びScienceScoreが該当する。
ラッパークラスINTは、共通クラスを継承したものとして実装される。該継承により、ラッパークラスINTのオブジェクトは、小数点を含まない数値を文字列として格納するためのchar配列、文字数を格納する変数及びオフセット値を格納する変数を有する。さらにラッパークラスINTは、上記共通クラスのフィールドに加え、以下の内部フィールドを有する。
public class INT extends COMMON_DATA {
private int _value; // 値
private boolean _validValue; //値の有効性フラグ
private boolean _validChar; //値のchar配列表現の有効性フラグ

ラッパークラスINTは、上記共通クラスの有する変数に加え、値変数(_value)、値の有効性フラグ(_validValue)及び値のchar配列表現の有効性フラグ(_validChar)をフィールドに有する。値変数(_value)は、数値型でデータ本体を有するための、int型変数である。値の有効性フラグ(_validValue)は、値変数(_value)の有するデータが、char配列に設定されているデータの更新により、最新の状態ではなくなったことを示すフラグである。値のchar配列表現の有効性フラグ(_validChar)はchar配列に設定されているデータが、値変数(_value)の有するデータの更新により、最新の状態ではなくなったことを示すフラグである。
When data of a numerical data item that is a lower-level data item and does not include a decimal point is defined in the JAVA (trademark) code, a wrapper class INT is used for the definition. Here, a numerical data item not including a decimal point is a data item in which “9” is specified as the type and does not include “V” in the PICTURE clause of COBOL. Specifically, MathScore and ScienceScore in the COBOL statement (FIGS. 1, 101, and 107) are applicable.
The wrapper class INT is implemented as an inheritance of the common class. By the inheritance, the object of the wrapper class INT has a char array for storing a numerical value not including a decimal point as a character string, a variable for storing the number of characters, and a variable for storing an offset value. Further, the wrapper class INT has the following internal fields in addition to the fields of the common class.
public class INT extends COMMON_DATA {
private int _value; // value
private boolean _validValue; // Value validity flag
private boolean _validChar; // Validity flag of char array representation of value}
The wrapper class INT has a value variable (_value), a value validity flag (_validValue), and a value char array representation validity flag (_validChar) in addition to the variables of the common class. The value variable (_value) is an int type variable for having a data body with a numeric type. The value validity flag (_validValue) is a flag indicating that the data in the value variable (_value) is no longer in the latest state due to the update of the data set in the char array. The validity flag (_validChar) of the char array representation of the value is a flag indicating that the data set in the char array is not in the latest state due to the update of the data of the value variable (_value).

階層が最上位のデータ項目であり且つ小数点を含まない数値のデータ項目に対応するデータが定義される場合、該定義には、符号付き整数を表すプリミティブデータ型であるintやlongが用いられる。なお、上記intの代わりにラッパークラスINTが用いられてもよい。   When data corresponding to a numerical data item whose hierarchy is the highest data item and does not include a decimal point is defined, int and long which are primitive data types representing signed integers are used for the definition. Note that a wrapper class INT may be used instead of the int.

集団データ項目に対応するデータが定義される場合、該定義には、ラッパークラスSTRUCTが用いられる。
ラッパークラスSTRUCTは、上記共通クラスを継承した内部又は外部クラスとして実装される。ラッパークラスSTRUCTのオブジェクトは、下位の階層のデータを一括して表現するため、内部に文字データを格納するchar配列、文字数を格納する変数及びオフセット値を格納する変数を有する。さらにラッパークラスSTRUCTは、上記共通クラスのフィールドに加え、以下の内部フィールドを有する。
public class STRUCT extends COMMON_DATA {
private Object[] _fields; // 下位階層データオブジェクト

ラッパークラスSTRUCTは、上記共通クラスが有する変数に加え、下位階層データオブジェクト(_fields)をフィールドに有する。下位階層データオブジェクト(_fields)は、直属の下位階層のデータオブジェクトを配列として保持するものである。なお、本明細書においてラッパークラスSTRUCTは、階層クラスともいう。
When data corresponding to a group data item is defined, a wrapper class STRUCT is used for the definition.
The wrapper class STRUCT is implemented as an internal or external class that inherits the common class. An object of the wrapper class STRUCT has a char array for storing character data, a variable for storing the number of characters, and a variable for storing an offset value in order to collectively represent lower layer data. Furthermore, the wrapper class STRUCT has the following internal fields in addition to the fields of the common class.
public class STRUCT extends COMMON_DATA {
private Object [] _fields; // Lower layer data object}
The wrapper class STRUCT has a lower layer data object (_fields) in the field in addition to the variables of the common class. The lower hierarchy data object (_fields) holds the data objects of the directly lower hierarchy as an array. In the present specification, the wrapper class STRUCT is also referred to as a hierarchical class.

上記ラッパークラスから生成されるオブジェクトのコンストラクタでは、基本的に共通クラスのフィールド上の変数(_length)のみに、COBOLのPICTURE句で指定された値が設定される。また、COBOLコードのVALUE句において初期値が明示的に与えられているとき以外は、上記char配列の実体であるchar配列本体、値オブジェクトは生成されない。JAVA(商標)言語では、変数に初期値を与えない場合、文字列変数には空白文字、数値変数には0が暗黙的に設定される。例えばnullのchar配列本体に対してデータが取得される場合、該取得の時点でchar配列本体は遅延的に(Lazy)に生成され、空白文字が返される。   In the constructor of the object generated from the wrapper class, basically, only the variable (_length) on the field of the common class is set with the value specified by the PICTURE clause of the COBOL. Further, except when the initial value is explicitly given in the VALUE clause of the COBOL code, the char array body and the value object which are the entities of the char array are not generated. In the JAVA (trademark) language, when an initial value is not given to a variable, a blank character is implicitly set for a character string variable and 0 is implicitly set for a numeric variable. For example, when data is acquired for a null char array body, the char array body is generated lazily at the time of acquisition, and a blank character is returned.

階層型データ構造に対応するデータ領域が共有されるのは、JAVA(商標)コードが実行され、階層を有する集団データ項目に対応するデータのセット・ゲットが行なわれた時点である。該階層を有する集団データ項目に対応する階層クラスがchar配列をまだポイントしていない場合、新たにchar配列本体が生成され上記データのセットが行われる。更に該集団データ項目の下位階層の全てのデータ項目とchar配列の共有が行われる。すなわち下位レベルの階層のラッパークラスのオブジェクトでは、与えられたchar配列がポイントされ、各項目の文字数分位置をずらしながらオフセット値がセットされる。下位レベルの階層において既にchar配列本体が生成されていたら、上記値のゲットの場合は、新しいchar配列にデータがコピーされる。メモリ領域は、上位階層のデータついてのみ確保される。下位階層のデータについては、独自のメモリ領域は確保されない。
また、DECIMALクラスに対してchar配列のセットが行われた場合、対応するBigDecimalオブジェクトにおいて、使用できないことを示すフラグがセットされる(_validValue = false)。該フラグは、値の有効性フラグである。数値のデータが必要になった場合、最新のchar配列にセットされている文字列とDecimalFormatオブジェクトから、新たに数値型でデータを格納するためのBigDecimalが生成される。
INTクラスに対してchar配列のセットが行われた場合、対応するINTオブジェクトにおいて、使用できないことを示すフラグがセットされる(_validValue = false)。該フラグは、値の有効性フラグである。数値のデータが必要になった場合、最新のchar配列にセットされている文字列から、JAVA(商標)の標準ライブラリ関数を使用して、新たにint型の数値データが生成される。
また逆に、DECIMALクラスの値オブジェクト又はINTクラスの値のデータ(_value)が更新された場合、対応するchar配列が無効であることを示すフラグがセットされる(_validChar = false)。該フラグは、値のchar配列表現の有効性フラグである。上位階層からデータが取得される際は、下位階層の全てのDECIMALオブジェクト及びINTオブジェクトのchar配列が有効であることが確認されなければならない。
The data area corresponding to the hierarchical data structure is shared when the JAVA (trademark) code is executed and the data corresponding to the group data item having the hierarchy is set / getted. If the hierarchical class corresponding to the group data item having the hierarchy has not yet pointed to the char array, a new char array body is generated and the above data is set. Further, the char array is shared with all data items in the lower hierarchy of the group data item. That is, in the object of the wrapper class in the lower level hierarchy, the given char array is pointed, and the offset value is set while shifting the position by the number of characters of each item. If the char array body has already been generated in the lower level hierarchy, if the above value is obtained, the data is copied to the new char array. The memory area is reserved only for upper layer data. A unique memory area is not secured for lower-layer data.
When a char array is set for the DECIMAL class, a flag indicating that the corresponding BigDecimal object cannot be used is set (_validValue = false). The flag is a value validity flag. When numeric data is required, BigDecimal for storing data in the numeric type is newly generated from the character string set in the latest char array and the DecimalFormat object.
When the char array is set for the INT class, a flag indicating that the corresponding INT object cannot be used is set (_validValue = false). The flag is a value validity flag. When numeric data is required, new int type numeric data is generated from a character string set in the latest char array using a standard library function of JAVA (trademark).
Conversely, when the DECIMAL class value object or INT class value data (_value) is updated, a flag indicating that the corresponding char array is invalid is set (_validChar = false). This flag is a validity flag of the char array representation of the value. When data is acquired from an upper layer, it must be confirmed that the char arrays of all DECIMAL objects and INT objects in the lower layer are valid.

また、COBOLにおいてREDEFINES句を使ってデータ領域が共有されているデータ項目に対応するデータを管理するラッパークラスのオブジェクトは、該オブジェクトの生成時にデータ領域であるchar配列が共有される。該共有を実現するために、各ラッパークラスのコンストラクタにメソッドredefine()が実装される。redefine()は、共有元のオブジェクトにおいて用意されるchar配列をポイントさせることを行うメソッドである。   In addition, a wrapper class object that manages data corresponding to a data item whose data area is shared by using the REDEFINES clause in COBOL is shared with a char array that is a data area when the object is generated. In order to realize the sharing, a method redefine () is implemented in the constructor of each wrapper class. redefine () is a method that points to the char array prepared in the sharing source object.

一旦char配列が共有されると、その後は集団データ項目又はREDEFINESされたデータ構造に対するデータのゲット・セットの操作で、新たなオブジェクトが作られることなく、必要な部分のchar配列データの更新だけで処理を完了することができる。以上の方式により、無駄なオブジェクト生成及び複数のコピー操作などの無駄な処理を避けることができ、大幅な性能改善、ヒープ使用量の削減が達成される。   Once the char array has been shared, the data get set operation on the collective data item or REDEFINES data structure does not create a new object, but only updates the required part of the char array data. Processing can be completed. With the above method, useless processing such as useless object generation and a plurality of copy operations can be avoided, and a significant performance improvement and a reduction in heap usage can be achieved.

基本データ項目に対応するデータのセットは、該データが文字データの場合char配列に対して実行される。
該データがDECIMALクラスで扱われる数値データの場合、数値型のフォーマットのデータが値オブジェクト(_value)に格納される。また、数値データがchar配列で与えられた場合、相互変換オブジェクト(_format)によって文字列で与えられた数値データが数値型に変換され、値オブジェクト(_value)に格納されてもよい。
該データがINTクラスで扱われる数値データの場合、数値型のフォーマットのデータが値変数(_value)に格納される。また、数値データがchar配列で与えられた場合、JAVA(商標)の標準ライブラリ関数によって文字列で与えられた数値データが数値型に変換され、値変数(_value)に格納されてもよい。
なお、上記値オブジェクト(_value)又は上記値変数(_value)に新しくデータが格納された場合、数値型データを格納する変数の有効性フラグが有効に設定され、値のchar配列表現の有効性フラグが無効に設定される。
ゲットされるデータが数値データならば、変数の有効性フラグが無効に設定されていた場合、char配列データから数値データを生成し直し、値オブジェクト(_value)又は値変数(_value)にセットする必要がある。上記値オブジェクト(_value)又は値変数(_value)からデータが取得されるためには、数値型データを格納する変数の有効性フラグが有効に設定されている必要がある。
The data set corresponding to the basic data item is executed on the char array when the data is character data.
When the data is numeric data handled by the DECIMAL class, numeric format data is stored in the value object (_value). When the numerical data is given in a char array, the numerical data given as a character string by the mutual conversion object (_format) may be converted into a numeric type and stored in the value object (_value).
If the data is numeric data handled by the INT class, numeric format data is stored in the value variable (_value). When the numerical data is given in a char array, the numerical data given as a character string by a standard library function of JAVA (trademark) may be converted into a numerical type and stored in a value variable (_value).
When new data is stored in the value object (_value) or the value variable (_value), the validity flag of the variable storing the numeric type data is set to valid, and the validity flag of the char array representation of the value Is disabled.
If the data to be obtained is numeric data, if the validity flag of the variable is set to invalid, it is necessary to regenerate the numeric data from the char array data and set it to the value object (_value) or value variable (_value) There is. In order to acquire data from the value object (_value) or the value variable (_value), it is necessary that the validity flag of the variable for storing the numerical data is set to be valid.

図2Aは、本発明の実施態様である、階層クラスのオブジェクトへのセットの命令が実行された場合のフローの例を示す。
プログラム実行時において、階層を有する集団データ項目に対応するデータへのセットの命令が実行されると、該データを格納するためのchar配列がポイントされているかの判定が行われる(ステップ201)。
上記char配列がポイントされていない場合、上記char配列のメモリ領域は確保されていない。よって、上記データが格納される領域を確保するため、char配列本体が生成される(ステップ202)。ここで生成されるchar配列本体のサイズは、階層クラスの下位階層の全てのラッパークラスのオブジェクトの変数にセットされている文字数の合計サイズである。
次に、char配列本体に上記データがセットされる(ステップ203)。
次に、下位階層の全てのラッパークラスのオブジェクトについて、以下の処理が実行される(ステップ204)。
下位階層の全てのラッパークラスのオブジェクトのchar配列は、階層クラスのオブジェクトの上記char配列本体と共有される。まず、上記下位階層全てのラッパークラスのオブジェクトにおいて、上記char配列本体がポイントされる(ステップ205)。また、各項目の指定長だけ位置をずらしながらオフセット値がセットされる(ステップ206)。上記指定長は、例えば下位階層のオブジェクトの変数にセットされた文字数を順に加えていくことで求められる。
次に、下位階層ラッパークラスのオブジェクトのデータが数値型データの場合、数値型データを格納する変数の有効性フラグが無効に設定され、char配列表現の有効性フラグが有効に設定される(ステップ208)。なお上記2つのフラグは、ラッパークラスのオブジェクトにおいて、既に数値型でデータが保持されている場合に設定される。また、下位階層のラッパークラスのオブジェクトがSTRUCT型の場合は、上記の処理(ステップ205〜208)が再帰的に実行される。
下位階層の全てのラッパークラスのオブジェクトについて、上記ステップ205〜208が終了すると、階層クラスのオブジェクトにおけるセットの処理は終了する。
FIG. 2A shows an example of a flow when a set instruction to an object of a hierarchical class is executed according to an embodiment of the present invention.
When the program is executed, when an instruction to set data corresponding to a group data item having a hierarchy is executed, it is determined whether or not a char array for storing the data is pointed (step 201).
When the char array is not pointed to, the memory area of the char array is not secured. Therefore, a char array body is generated to secure an area for storing the data (step 202). The size of the char array body generated here is the total size of the number of characters set in the variables of all the wrapper class objects in the lower hierarchy of the hierarchy class.
Next, the data is set in the char array body (step 203).
Next, the following processing is executed for all the wrapper class objects in the lower hierarchy (step 204).
The char array of all the wrapper class objects in the lower hierarchy is shared with the above char array body of the hierarchy class object. First, the char array body is pointed to in the wrapper class objects of all the lower layers (step 205). Further, the offset value is set while shifting the position by the designated length of each item (step 206). The specified length is obtained, for example, by sequentially adding the number of characters set in the variable of the object in the lower hierarchy.
Next, if the data of the object of the lower layer wrapper class is numeric data, the validity flag of the variable storing the numeric data is set to invalid, and the validity flag of the char array representation is set to valid (step) 208). The above two flags are set when the wrapper class object already holds data of a numerical type. When the lower-level wrapper class object is a STRUCT type, the above processing (steps 205 to 208) is recursively executed.
When the above steps 205 to 208 are completed for all the wrapper class objects in the lower hierarchy, the processing of the set in the hierarchy class object is completed.

図2Bは、本発明の実施態様である、階層クラスのオブジェクトへのゲットの命令が実行された場合のフローの例を示す。
プログラム実行時において、階層を有する集団データ項目に対応するデータへのゲットの命令が実行されると、該データを取得するためのchar配列がポイントされているかの判定が行われる(ステップ221)。
上記char配列がポイントされている場合、上記char配列のメモリ領域は確保されている。よってchar配列本体からデータがゲットされ(ステップ228)、処理は終了する。なお、該取得において、下位階層の全ての数値型のラッパークラスのオブジェクトが有するchar配列表現の有効性フラグが確認されなければならない。該フラグが無効ならば、上記ラッパークラスのオブジェクトの有する数値型データを格納する変数からchar型の配列に変換し、有効とする必要がある。
上記char配列がポイントされていない場合、上記char配列のメモリ領域は確保されていない。よって、上記データが格納される領域を確保するため、char配列本体が生成される(ステップ222)。ここで生成されるchar配列本体のサイズは、階層クラスの下位階層の全てのラッパークラスのオブジェクトの変数にセットされている文字数の合計サイズである。
次に、下位階層の全てのラッパークラスのオブジェクトについて、以下の処理が実行される(ステップ223)。
下位階層の全てのラッパークラスのオブジェクトのchar配列は、階層クラスのオブジェクトの上記char配列本体と共有される。まず、上記下位階層全てのラッパークラスのオブジェクトにおいて、上記char配列本体がポイントされる(ステップ224)。また、各項目の指定長だけ位置をずらしながらオフセット値がセットされる(ステップ225)。上記指定長は、例えば下位階層のオブジェクトの変数にセットされた文字数を順に加えていくことで求められる。
さらに、下位階層のラッパークラスのオブジェクトにおいて、既にchar配列が生成されていた場合、ステップ222において生成されたchar配列本体に、下位階層のラッパークラスのオブジェクトが有するデータがコピーされる。(ステップ227)。ここで、該下位階層のラッパークラスのオブジェクトが数値型の場合、char配列表現の有効性フラグがチェックされる。該フラグが無効に設定されているならば、数値データから変換された文字データがコピーされる。また、char配列表現の有効性フラグが有効に設定される。なお、上記コピーされるデータのchar配列本体上での位置は、下位階層のラッパークラスのオブジェクトが有するオフセット値から求められる。また、上記数値データから文字データへの変換は、INTクラスのオブジェクトでは、JAVA(商標)の標準ライブラリ関数によって実現され、DECIMALクラスのオブジェクトでは、相互変換オブジェクトによって実現される。なお、下位階層のオブジェクトについてのchar配列本体は解放されてもよい。
下位階層の全てのラッパークラスのオブジェクトについて、上記ステップ224〜227が終了するとchar配列本体からデータがゲットされ(ステップ228)、階層クラスのオブジェクトにおけるゲットの処理は終了する。
FIG. 2B shows an example of a flow in the case where a get instruction to an object of a hierarchical class, which is an embodiment of the present invention, is executed.
When a get instruction for data corresponding to a group data item having a hierarchy is executed during program execution, it is determined whether or not a char array for acquiring the data is pointed (step 221).
When the char array is pointed, the memory area of the char array is secured. Therefore, data is obtained from the char array body (step 228), and the process ends. In the acquisition, the validity flag of the char array expression included in all numerical wrapper class objects in the lower hierarchy must be confirmed. If the flag is invalid, it is necessary to convert the variable that stores the numerical data held by the wrapper class object into a char type array and validate it.
When the char array is not pointed to, the memory area of the char array is not secured. Therefore, a char array body is generated to secure an area for storing the data (step 222). The size of the char array body generated here is the total size of the number of characters set in the variables of all the wrapper class objects in the lower hierarchy of the hierarchy class.
Next, the following processing is executed for all the wrapper class objects in the lower hierarchy (step 223).
The char array of all the wrapper class objects in the lower hierarchy is shared with the above char array body of the hierarchy class object. First, the char array body is pointed to in all the wrapper class objects in the lower hierarchy (step 224). The offset value is set while shifting the position by the designated length of each item (step 225). The specified length is obtained, for example, by sequentially adding the number of characters set in the variable of the object in the lower hierarchy.
Furthermore, if a char array has already been generated in the lower-level wrapper class object, the data of the lower-level wrapper class object is copied to the char array body generated in step 222. (Step 227). Here, if the lower-level wrapper class object is a numerical type, the validity flag of the char array representation is checked. If the flag is set to invalid, character data converted from numerical data is copied. In addition, the validity flag of the char array expression is set to valid. The position of the copied data on the char array body is obtained from the offset value of the lower-level wrapper class object. The conversion from numerical data to character data is realized by a JAVA (trademark) standard library function for an INT class object, and by a mutual conversion object for a DECIMAL class object. It should be noted that the char array body for the lower layer object may be released.
For all wrapper class objects in the lower hierarchy, when the above steps 224 to 227 are completed, data is obtained from the char array body (step 228), and the processing of the get in the hierarchical class object is completed.

図2Cは、本発明の実施態様である、構造体配列の例であるCOBOL文(図1、101)を、JAVA(商標)コードに変換した例を示す。
COBOL文(図1、101)で表わされる構造体配列は、JAVA(商標)コード(231)で表わされる構造体配列に変換される。該構造体に対して、char配列が共有されると、内部的には、オブジェクト構造(232)に示す構造となる。オブジェクト構造(232)において、CHARS、INT及びDECIMALの各オブジェクトは、char配列へのポインタとオフセット値を用いて、各自の領域をポイントしている。char配列の共有は、上位階層クラスのオブジェクトStudentRecord[x]の単位でアクセスされたときに初めて行われる。よって、それ以前に下位階層のオブジェクトが直接更新されていた場合、図の点線で描かれた部分のように、以前のデータ領域は捨てられる。そして、新しくポインタがすげ替えられる。また、必要ならばデータのコピーが行なわれる。
FIG. 2C shows an example in which a COBOL statement (FIG. 1, 101) as an example of a structure array, which is an embodiment of the present invention, is converted into a JAVA (trademark) code.
The structure array represented by the COBOL statement (FIG. 1, 101) is converted into a structure array represented by the JAVA (trademark) code (231). When the char array is shared for the structure, the structure is internally shown in the object structure (232). In the object structure (232), each object of CHARS, INT, and DECIMAL points to its own area using a pointer to a char array and an offset value. The char array is shared only when it is accessed in units of the upper-level class object StudentRecord [x]. Therefore, if the object in the lower hierarchy has been directly updated before that, the previous data area is discarded as shown by the dotted line in the figure. Then, the pointer is replaced with a new one. In addition, data is copied if necessary.

図2Dは、REDEFINES句の例であるCOBOL文を、JAVA(商標)コードに変換した例を示す。
REDEFINES句の例であるCOBOL文(図1、107)は、JAVA(商標)コード(241)に変換される。
データ領域が共有される側のオブジェクトであるmonthDefは、ラッパークラスCHARSのオブジェクトとして生成される。該オブジェクトの生成において、初期値が指定されている。よって、char配列もアロケートされ、データ「JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC」が設定される。
データ領域を共有する側のオブジェクトであるmonthNameは、ラッパークラスSTRUCTを継承するクラスであるMonthNameのオブジェクトとして生成される。該クラスの定義において、配列monthを格納するための配列は定義されるが、データは設定されない。代わりに、該オブジェクト生成時に実行されるコンストラクタにおいて、データ領域が共有される側のオブジェクトであるmonthDefがredefine()メソッドに渡される。上記メソッドによって、char配列が共有される。
オブジェクト構造(242)は、monthName及びmonthDefとchar配列との関係を示す。
monthDefは、char配列をポイントしている。
monthNameは、12のmonthで構成される。monthは、char配列の対応する個所をポイントしている。対応する個所とは、char配列の0番目の要素、3番目の要素、・・・33番目の要素である。これは、monthは、文字数が3の配列だからである。また、ポイントするとは、共通クラスのフィールドに含まれるchar配列へのポインタ及びオフセットを用いて、char配列の要素を指すことである。
FIG. 2D shows an example in which a COBOL statement that is an example of a REDEFINES phrase is converted into a JAVA (trademark) code.
A COBOL statement (FIG. 1, 107), which is an example of a REDEFINES phrase, is converted into a JAVA (trademark) code (241).
MonthDef, which is an object on the side where the data area is shared, is generated as an object of the wrapper class CHARS. An initial value is specified in the generation of the object. Therefore, the char array is also allocated, and the data “JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC” is set.
A monthName that is an object sharing the data area is generated as an object of a MonthName that is a class that inherits the wrapper class STRUCT. In the definition of the class, an array for storing the array month is defined, but no data is set. Instead, in the constructor executed when the object is generated, monthDef that is an object on the side where the data area is shared is passed to the redefine () method. A char array is shared by the above methods.
The object structure (242) indicates the relationship between monthName and monthDef and the char array.
monthDef points to a char array.
The monthName is composed of 12 months. month points to the corresponding location in the char array. Corresponding locations are the 0th element, the 3rd element,..., The 33rd element of the char array. This is because month is an array with 3 characters. Pointing means pointing to an element of the char array using a pointer and offset to the char array included in the common class field.

JAVA(商標)コード上で、階層型のデータ構造の本体はchar配列として表現される。また、COBOLコードにおけるREDEFINES句及び階層型のデータ構造によるデータの共有は、JAVA(商標)コードにおいて実現される。よって、該JAVA(商標)コードにおいて、無駄なオブジェクト生成及びデータのコピー操作を省くことができる。結果として、ヒープメモリ消費を節約した高性能な実装が可能となる。   The body of the hierarchical data structure is expressed as a char array on the JAVA (trademark) code. Further, sharing of data by the REDEFINES clause and the hierarchical data structure in the COBOL code is realized in the JAVA (trademark) code. Therefore, useless object generation and data copy operations can be omitted in the JAVA (trademark) code. As a result, a high-performance implementation that saves heap memory consumption is possible.

char配列の共有は、集団データ項目に対するデータがゲット又はセットされるタイミングで行われる。これは、プログラム中で必ずしも構造体に含まれる全てのデータがアクセスされるとは限らないためである。特にCOBOLは、copy文を使うことによって、外部のソースプログラム及びデータ構造の宣言をコードに取り込む(include)機能を有する。該取り込みの機能は、複数のプログラムでよく利用されるデータ構造を定義するときなどに、使われる機能である。しかし、該取り込まれたデータ構造のごく一部だけが使用されるというのが一般的であり、宣言されたデータ構造に対応するメモリ領域を最初に全て確保するのはメモリの使用効率が良くない。大規模商用アプリケーションにおいて、COBOLのコードをJAVA(商標)のコードに変換する場合に、実際は使用されないメモリ領域を確保するような変換を行ったことによって、大きく性能を落としている例がある。メモリが効率よく使用されるために、データ本体を管理するためのラッパークラスのオブジェクトのchar配列の生成がまた、該データのゲット又はセットを通して行われるようになっている。よって、該データへのアクセスがあったときに遅延的に(lazy)にインスタンスが作られる。   The sharing of the char array is performed at a timing when data for the collective data item is obtained or set. This is because not all data included in the structure is accessed in the program. In particular, COBOL has a function of including an external source program and a data structure declaration into code by using a copy statement. The import function is a function used when defining a data structure often used in a plurality of programs. However, it is general that only a part of the fetched data structure is used, and it is not efficient to use the memory to secure all the memory areas corresponding to the declared data structure first. . In a large-scale commercial application, when converting a COBOL code to a JAVA (trademark) code, there is an example in which performance is greatly reduced by performing a conversion that secures a memory area that is not actually used. In order to make efficient use of memory, the generation of a char array of wrapper class objects for managing the data body is also performed through the get or set of data. Therefore, when the data is accessed, an instance is created in a lazy manner.

また、最適化の例として、事前にCOBOLコード又は変換後JAVA(商標)コードに対してデータフロー解析などのプログラム解析を行う方法も考えられうる。該解析により、階層型データ構造の上位階層のデータへアクセスする処理が実行パスに含まれることが判明した場合、変換されるJAVA(商標)コードにおいて、初めに該上位階層のオブジェクトのメンバであるchar配列を先に定義する命令を挿入する。これによって、下位レベルの変数に対して先にchar配列を取ることなく、オブジェクト生成の無駄を更に削減することができる。   As an example of optimization, a method of performing program analysis such as data flow analysis on the COBOL code or the converted JAVA (trademark) code in advance may be considered. If it is found from the analysis that the execution path includes a process for accessing upper-layer data in the hierarchical data structure, the JAVA (trademark) code to be converted is first a member of the upper-layer object. Inserts an instruction that defines a char array first. As a result, waste of object generation can be further reduced without taking a char array for lower-level variables first.

図3は、本発明の実施態様における、COBOLコードのデータ定義部分をJAVA(商標)コードに変換する例を示す。
上記COBOLコードにおいてデータ項目が定義される個所が、JAVA(商標)コードに変換されうる。以下に該変換の手順を示す。
まず、上記COBOLコードにおいて、データ項目が定義されるセクションである「WORKING-STORAGE SECTION.」が検索される(ステップ301)。上記「WORKING-STORAGESECTION.」が発見されると、上記COBOLコードは、1行ずつ精査される。該精査は、精査されている現在の行(以下、第1の行)の次の行(以下、第2の行)に、階層型データ構造の特徴である「階層レベル」が含まれなくなるまで行われる(ステップ302)。該精査において、まず、上記第1の行と上記第2の行の「階層レベル」の値が比較される。(ステップ303)。
・上記第1の行の「階層レベル」の値が、上記第2の行の「階層レベル」の値より小さい場合、上記第1の行で定義されたデータ項目は、集団データ項目である。よって、上記第1の行は、ラッパークラスSTRUCTのオブジェクトを定義する行に変換される(ステップ304)。該変換は、例えば、次のような変換である。
public class (データ項目の名前) extends STRUCT{
次に、上記第1の行に「REDEFINE」が含まれるかどうかが調べられる(ステップ305)。上記「REDEFINE」が含まれる場合、メソッドredefine()を出力するための情報がスタックに格納される(ステップ306)。該情報は、例えば、コンストラクタの部分を作成する為に必要な、データ項目の名前である。次に、構造体を閉じるために必要な情報が格納される(ステップ307)。該情報は、第1の行の階層レベル及びオブジェクトを定義し生成するために必要なデータ項目の名前である。また、データ項目が配列に対応するならば、配列の要素数も該情報に含まれる。
・上記第1の行の「階層レベル」の値が、上記第2の行の「階層レベル」の値以上の値である場合、上記第1の行で定義されたデータ項目は、下位階層のデータ項目を持たないデータ項目である。よって、上記第1の行は、データ項目のタイプに対応したラッパークラスのオブジェクトを定義し生成する行に変換される(ステップ308)。該変換は、例えば、次のような変換である。
private ラッパークラス(データ項目の名前)= new ラッパークラス(文字数);
ここで、COBOLのPICTURE句において、タイプとして「X」又は「A」が指定されたデータ項目に対応するオブジェクトは、ラッパークラスCHARSによって定義される。また、COBOLのPICTURE句において、タイプとして「9」が指定され「V」を含むデータ項目に対応するオブジェクトは、ラッパークラスDECIMALによって定義される。COBOLのPICTURE句において、タイプとして「9」が指定され且つ「V」を含まないデータ項目に対応するオブジェクトは、ラッパークラスINTによって定義される。
次に、構造体の後処理(ステップ309)が実行される。該後処理では、上記第1の行と上記第2の行の階層レベルと、スタックに格納されている構造体に変換された行の階層レベルが比較される。そして、
上記第2の階層レベル=<スタックに格納された階層レベル
の条件を満たす数分の閉じ括弧及び構造体オブジェクトの生成処理が出力される。また、メソッドredefine()を出力するための情報が格納されている場合は、該情報も出力される。
精査する行が残り1行になると、最後の1行を精査する処理(ステップ311)が実行される。該処理では、データ項目のタイプに対応したラッパークラスのオブジェクトを定義し生成する処理(ステップ308)及び構造体の後処理(ステップ309)が実行される。
FIG. 3 shows an example of converting the data definition portion of the COBOL code into a JAVA (trademark) code in the embodiment of the present invention.
A location where a data item is defined in the COBOL code can be converted into a JAVA (trademark) code. The conversion procedure is shown below.
First, “WORKING-STORAGE SECTION.”, Which is a section in which a data item is defined, is searched in the COBOL code (step 301). When the “WORKING-STORAGESECTION.” Is found, the COBOL code is scrutinized line by line. The scrutiny is performed until the current row being scrutinized (hereinafter referred to as the first row) does not include the “hierarchy level” that is characteristic of the hierarchical data structure in the next row (hereinafter referred to as the second row). Performed (step 302). In the scrutiny, first, the “hierarchy level” values of the first row and the second row are compared. (Step 303).
When the “hierarchy level” value in the first row is smaller than the “hierarchy level” value in the second row, the data item defined in the first row is a collective data item. Therefore, the first line is converted into a line that defines an object of the wrapper class STRUCT (step 304). The conversion is, for example, the following conversion.
public class (name of data item) extends STRUCT {
Next, it is checked whether or not “REDEFINE” is included in the first row (step 305). When the “REDEFINE” is included, information for outputting the method redefine () is stored in the stack (step 306). The information is, for example, the name of a data item necessary for creating the constructor part. Next, information necessary for closing the structure is stored (step 307). The information is the name of the data item required to define and generate the hierarchy level and object of the first row. If the data item corresponds to an array, the number of elements in the array is also included in the information.
When the value of the “hierarchy level” in the first row is equal to or greater than the value of the “hierarchy level” in the second row, the data item defined in the first row is A data item that does not have a data item. Therefore, the first line is converted into a line for defining and generating a wrapper class object corresponding to the type of the data item (step 308). The conversion is, for example, the following conversion.
private wrapper class (data item name) = new wrapper class (number of characters);
Here, the object corresponding to the data item in which “X” or “A” is specified as the type in the PICTURE PICTURE clause is defined by the wrapper class CHARS. Further, in the PICTURE PICTURE clause, an object corresponding to a data item in which “9” is specified as the type and includes “V” is defined by the wrapper class DECIMAL. In the PICTURE clause of COBOL, an object corresponding to a data item in which “9” is specified as a type and does not include “V” is defined by the wrapper class INT.
Next, post-processing of the structure (step 309) is executed. In the post-processing, the hierarchical level of the first row and the second row is compared with the hierarchical level of the row converted into the structure stored in the stack. And
Second parent level = <Number of closed parenthesis and structure object generation processes that satisfy the condition of the hierarchical level stored in the stack are output. In addition, when information for outputting the method redefine () is stored, the information is also output.
When the number of lines to be scrutinized is one remaining line, a process of scrutinizing the last line (step 311) is executed. In the processing, processing for defining and generating an object of the wrapper class corresponding to the data item type (step 308) and post-processing of the structure (step 309) are executed.

図4A〜Cは、本発明の実施態様に従い変換されたJAVA(商標)コードについての効果を測定するために用いたサンプルプログラムの例を示す。   4A-C show examples of sample programs used to measure the effect on JAVA ™ code converted according to an embodiment of the present invention.

図4Aは、JAVA(商標)コードへの変換対象であるCOBOLサンプルプログラムを示す。
COBOLプログラム(401)は、製品工場の製品番号ごとに製品を集計するプログラムである、該プログラムは、製品番号でソートされたデータをファイルから読み込んで、製品番号ごとの集計結果を出力する。
FIG. 4A shows a COBOL sample program to be converted into JAVA ™ code.
The COBOL program (401) is a program that counts products for each product number of a product factory. The program reads data sorted by product number from a file and outputs a count result for each product number.

図4Bは、図4AのCOBOLプログラム(401)を従来の方法により変換したJAVA(商標)コード(402)の例を示す。
従来の方法とは、COBOLにおけるデータ型を対応するJAVA(商標)のデータ型に変換させる方法である。具体的には、PIC X(*)は、String型に変換する。PIC 9(*)は、BigDecimal型又はint型に変換する。また、階層構造は、独自に内部クラスを作成し、該内部クラスを用いて定義される構造体に変換される。該構造体に含まれるデータ領域は、構造体の外にも重複して定義される。なお、JAVA(商標)プログラム(402)においてgetdata()メソッドの行う処理である入力読み込み処理は、測定時においてインライン処理として実行されている。
FIG. 4B shows an example of the JAVA ™ code (402) obtained by converting the COBOL program (401) of FIG. 4A by a conventional method.
The conventional method is a method of converting a COBOL data type into a corresponding JAVA (trademark) data type. Specifically, PIC X (*) is converted to a String type. PIC 9 (*) converts to BigDecimal type or int type. In addition, the hierarchical structure is converted into a structure defined by using an internal class created independently. The data area included in the structure is defined redundantly outside the structure. Note that the input reading process, which is the process performed by the getdata () method in the JAVA (trademark) program (402), is executed as an inline process at the time of measurement.

図4Cは、図4AのCOBOLプログラム(401)を本発明の実施態様により変換したJAVA(商標)コード(403)の例を示す。   FIG. 4C shows an example of the JAVA ™ code (403) obtained by converting the COBOL program (401) of FIG. 4A according to the embodiment of the present invention.

図4Dは、本発明の実施態様に従うJAVA(商標)プログラム(402、403)の検証結果を示す。
検証者は、該検証に100,000件のレコードを使用し、ヒープメモリ使用量及び実行時間を計測した。また、該測定にIBM(商標)JAVA(商標)5.0が使用された。JITコンパイル時間及びGC(ガーベージコレクション)時間を排除するために、検証者は、main()メソッドに手を加え、JAVA(商標)プログラム(402、403)の実行において、初めにウォームアップランとして同じ入力サイズのレコードを使用してプログラムの実行を10回繰り返した。また、検証者は、上記繰り返しの後、ガーベージコレクションを実行する命令であるSystem.gc()を実施し、その後、上記計測を開始した。また、検証者は、JAVA(商標)の実行オプションに、-Xjit:optLevel=hot,count=3 -Xms512m -Xmx512mを指定した。また、検証者は、測定中にGCが発生していないことを確認した。
表(404)は、上記検証の結果を示す。
本発明の実施態様による変換コードを用いた場合、実行時間は218ミリ秒であり、ヒープメモリの使用量は131.3メガバイトであった。
従来の方法による変換コードを用いた場合、実行時間は282ミリ秒であり、ヒープメモリの使用量は192.2メガバイトであった。
上記結果より、本発明の実施態様による変換コードを用いた場合、従来の方法による変換コードを用いた場合と比べて、20%以上の実行時間が短縮され、且つ30%以上のヒープメモリ使用量が削減された。
FIG. 4D shows the verification result of the JAVA ™ program (402, 403) according to the embodiment of the present invention.
The verifier used 100,000 records for the verification, and measured heap memory usage and execution time. In addition, IBM (trademark) JAVA (trademark) 5.0 was used for the measurement. To eliminate JIT compilation time and GC (garbage collection) time, the verifier modifies the main () method, and in the execution of the JAVA ™ program (402, 403), the same as the warm-up run first. The execution of the program was repeated 10 times using the input size record. Further, the verifier implemented System.gc (), which is an instruction for executing garbage collection, after the repetition, and then started the measurement. Further, the verifier specified -Xjit: optLevel = hot, count = 3 -Xms512m -Xmx512m as an execution option of JAVA (trademark). The verifier also confirmed that no GC occurred during the measurement.
A table (404) shows the result of the verification.
When the conversion code according to the embodiment of the present invention was used, the execution time was 218 milliseconds and the usage of the heap memory was 131.3 megabytes.
When the conversion code according to the conventional method is used, the execution time is 282 milliseconds and the usage of the heap memory is 192.2 megabytes.
From the above results, when the conversion code according to the embodiment of the present invention is used, the execution time is reduced by 20% or more and the heap memory usage amount is 30% or more compared with the case of using the conversion code by the conventional method. Was reduced.

図5は、本発明の実施態様であるシステム構成の例を示す。
コンピュータ・システム(501)は、CPU(502)及びメモリ(503)を含む。メモリ(503)は、プログラム(504)を保持する。プログラム(504)は、JAVA(商標)コードを含む。該JAVAコードはラッパークラスのオブジェクトに含まれるセット又はゲットの命令を含み、上記オブジェクトの扱うデータはCOBOL言語におけるデータ項目に対応する。
CPU(502)は、メモリ(503)に保持されたプログラム(504)を読み出して実行する。CPU(502)は、プログラム内のラッパークラスのオブジェクトを呼び出す。CPU(502)は、該オブジェクトのアクセスの対象であるchar配列の上位階層のchar配列が生成されている場合、上記上位階層のchar配列を指すポインタ、文字数及びオフセットを保持する。CPU(502)は、該オブジェクトのアクセスの対象であるchar配列の上位階層のchar配列が生成されていない場合、上記オブジェクトのアクセスの対象である上記char配列を生成する。さらにCPU(502)は、上記オブジェクトのアクセスの対象である上記char配列の下位階層のchar配列にアクセスするためのそれぞれのオブジェクトに、上記char配列を指すポインタ、文字数及びオフセットを保持させる。
FIG. 5 shows an example of a system configuration that is an embodiment of the present invention.
The computer system (501) includes a CPU (502) and a memory (503). The memory (503) holds the program (504). The program (504) includes JAVA (trademark) code. The JAVA code includes a set or get instruction included in the wrapper class object, and data handled by the object corresponds to a data item in the COBOL language.
The CPU (502) reads and executes the program (504) held in the memory (503). The CPU (502) calls the wrapper class object in the program. When a higher-order char array of the char array to be accessed by the object is generated, the CPU (502) holds a pointer, the number of characters, and an offset indicating the upper-layer char array. The CPU (502) generates the char array that is the access target of the object when the char array of the upper layer of the char array that is the access target of the object has not been generated. Further, the CPU (502) causes each object for accessing the char array in the lower hierarchy of the char array that is the access target of the object to hold a pointer, the number of characters, and an offset indicating the char array.

図6A〜図6Eは、特許請求の範囲に記載の発明の理解を容易にするための図である。
図6Aは、COBOLコード、ラッパークラス及び第1〜4の各オブジェクトの関係を示す。
図6Bは、ラッパークラスと第1のオブジェクトとの関係を示す。請求項4及び9の各構成要素は、請求項3の各構成要素に対応する。請求項9の各構成要素はまた、請求項8の各構成要素に対応する。
図6Cは、ラッパークラスと第2のオブジェクトとの関係を示す。請求項5の各構成要素は、請求項3の各構成要素に対応する。
図6Dは、ラッパークラスと第3のオブジェクトとの関係を示す。請求項10及び11の各構成要素は、請求項3の構成要素に対応する。
図6Eは、ラッパークラスと第4のオブジェクトとの関係を示す。請求項12及び14の各構成要素は、請求項3の各構成要素に対応する。請求項14の各構成要素はまた、請求項8の各構成要素に対応する。
6A to 6E are diagrams for facilitating the understanding of the invention described in the claims.
FIG. 6A shows the relationship between the COBOL code, the wrapper class, and the first to fourth objects.
FIG. 6B shows the relationship between the wrapper class and the first object. The constituent elements of claims 4 and 9 correspond to the constituent elements of claim 3. Each component of claim 9 corresponds to each component of claim 8.
FIG. 6C shows the relationship between the wrapper class and the second object. Each component of claim 5 corresponds to each component of claim 3.
FIG. 6D shows the relationship between the wrapper class and the third object. The constituent elements of claims 10 and 11 correspond to the constituent elements of claim 3.
FIG. 6E shows the relationship between the wrapper class and the fourth object. Each component of claims 12 and 14 corresponds to each component of claim 3. Each component of claim 14 corresponds to each component of claim 8.

図7は、上記システム構成をさらに詳述したブロック図を示す。
コンピュータ・システム(701)は、CPU(703)とメイン・メモリ(702)と含み、これらはバス(714)に接続されている。CPU(703)は好ましくは、32ビット又は64ビットのアーキテクチャに基づくものであり、例えば、インテル社のXeon(商標)シリーズ、Core(商標)シリーズ、Atom(商標)シリーズ、Pentium(商標)シリーズ、Celeron(商標)シリーズ、AMD社のPhenom(商標)シリーズ、Athlon(商標)シリーズ、Turion(商標)シリーズ及びSempron(商標)などを使用することができる。バス(714)には、ディスプレイ・コントローラ(707)を介して、LCDモニタなどのディスプレイ(712)が接続される。ディスプレイ(712)は、コンピュータ・システムの管理のために、通信回線を介してネットワークに接続されたコンピュータ・システムについての情報と、そのコンピュータ・システム上で動作中のソフトウェアについての情報を、適当なグラフィック・インターフェースで表示するために使用される。バス(714)にはまた、IDE又はSATAコントローラ(704)を介して、ハードディスク又はシリコン・ディスク(705)と、CD−ROM、DVDドライブ又はBDドライブ(706)が接続される。
FIG. 7 shows a block diagram further detailing the system configuration.
The computer system (701) includes a CPU (703) and a main memory (702), which are connected to a bus (714). The CPU (703) is preferably based on a 32-bit or 64-bit architecture, such as Intel's Xeon (TM) series, Core (TM) series, Atom (TM) series, Pentium (TM) series, The Celeron (TM) series, AMD's Phenom (TM) series, Athlon (TM) series, Turion (TM) series, and Empron (TM) can be used. A display (712) such as an LCD monitor is connected to the bus (714) via a display controller (707). The display (712) appropriately displays information about a computer system connected to a network via a communication line and information about software running on the computer system for management of the computer system. Used for display with a graphic interface. A hard disk or silicon disk (705) and a CD-ROM, DVD drive or BD drive (706) are also connected to the bus (714) via an IDE or SATA controller (704).

ハードディスクには、オペレーティング・システム、J2EEなどのJava処理環境を提供するプログラム、その他のプログラム及びデータが、メイン・メモリにロード可能に記憶されている。   The hard disk stores an operating system, a program that provides a Java processing environment such as J2EE, and other programs and data that can be loaded into the main memory.

CD−ROM、DVD又はBDドライブ(706)は、必要に応じて、CD−ROM、DVD−ROM又はBDからプログラムをハードディスクに追加導入するために使用される。バス(714)には更に、キーボード・マウスコントローラ(709)を介して、キーボード(710)及びマウス(711)が接続されている。   The CD-ROM, DVD or BD drive (706) is used for additionally introducing a program from the CD-ROM, DVD-ROM or BD to the hard disk as necessary. Further, a keyboard (710) and a mouse (711) are connected to the bus (714) via a keyboard / mouse controller (709).

通信インタフェース(713)は、例えばイーサネット(商標)・プロトコルに従う。通信インタフェース(713)は、通信コントローラ(708)を介してバス(714)に接続され、コンピュータ・システム及び通信回線(715)を物理的に接続する役割を担い、コンピュータ・システムのオペレーティング・システムの通信機能のTCP/IP通信プロトコルに対して、ネットワーク・インターフェース層を提供する。なお、通信回線は、有線LAN環境、或いは例えばIEEE802.11a/b/g/nなどの無線LAN接続規格に基づく無線LAN環境であってもよい。   The communication interface (713) follows, for example, the Ethernet (trademark) protocol. The communication interface (713) is connected to the bus (714) via the communication controller (708), and plays a role of physically connecting the computer system and the communication line (715), and is an operating system of the computer system. A network interface layer is provided for the TCP / IP communication protocol of the communication function. The communication line may be a wired LAN environment or a wireless LAN environment based on a wireless LAN connection standard such as IEEE802.11a / b / g / n.

COBOLにおけるデータ部の記述の例を示す。The example of the description of the data part in COBOL is shown. 本発明の実施態様である、階層クラスのオブジェクトへのセットの命令が実行された場合のフローの例を示す。The example of the flow when the instruction of the set to the object of the hierarchy class which is the embodiment of the present invention is executed is shown. 本発明の実施態様である、階層クラスのオブジェクトへのゲットの命令が実行された場合のフローの例を示す。An example of a flow when a get instruction to an object of a hierarchical class, which is an embodiment of the present invention, is executed is shown. 本発明の実施態様である、構造体配列の例であるCOBOL文を、JAVAコードに変換した例を示す。The example which converted the COBOL sentence which is an example of a structure array which is the embodiment of this invention into the JAVA code | cord | chord is shown. 本発明の実施態様である、REDEFINES句の例であるCOBOL文を、JAVAコードに変換した例を示す。The example which converted the COBOL sentence which is an example of REDEFINES clause which is the embodiment of this invention into the JAVA code is shown. 本発明の実施態様における、COBOLコードをJAVAコードに変換する例を示す。An example of converting a COBOL code into a JAVA code in the embodiment of the present invention will be described. JAVAコードへの変換対象であるCOBOLサンプルプログラムを示す。A COBOL sample program to be converted into JAVA code is shown. 図4AのCOBOLプログラムを従来の方法により変換したJAVAコードの例を示す。An example of JAVA code obtained by converting the COBOL program of FIG. 4A by a conventional method is shown. 図4AのCOBOLプログラムを本発明の実施態様により変換したJAVAコードの例を示す。4B shows an example of JAVA code obtained by converting the COBOL program of FIG. 4A according to the embodiment of the present invention. 本発明の実施態様に従うJAVAプログラムの検証結果を示す。The verification result of the JAVA program according to the embodiment of the present invention is shown. 本発明の実施態様であるシステム構成の例を示す。The example of the system configuration which is an embodiment of the present invention is shown. COBOLコード、ラッパークラス及び第1〜4のオブジェクトの関係を示す。The relationship between the COBOL code, the wrapper class, and the first to fourth objects is shown. ラッパークラスと第1のオブジェクトの関係を示す。The relationship between the wrapper class and the first object is shown. ラッパークラスと第2のオブジェクトの関係を示す。The relationship between the wrapper class and the second object is shown. ラッパークラスと第3のオブジェクトの関係を示す。The relationship between the wrapper class and the third object is shown. ラッパークラスと第4のオブジェクトの関係を示す。The relationship between the wrapper class and the fourth object is shown. 図5のシステム構成をさらに詳述したブロック図を示す。FIG. 6 shows a block diagram further detailing the system configuration of FIG. 5.

Claims (25)

COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行するコンピュータ・システムであって、
ラッパークラスをデータ型とするオブジェクトの少なくとも1の宣言を有するJAVAコードを含むプログラムを保持する記憶部であって、前記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言である、前記記憶部と、
前記プログラムを前記記憶部からメモリ内に読み出し、該プログラムを実行するCPUと
を含む、前記コンピュータ・システム。
A computer system for executing a program including JAVA (trademark) code converted from COBOL code,
A storage unit for holding a program including JAVA code having at least one declaration of an object whose data type is a wrapper class, wherein each of the declarations is a declaration converted from each of the declarations of data items included in the COBOL code. A storage unit;
The computer system, comprising: a CPU that reads the program from the storage unit into a memory and executes the program.
前記ラッパークラスが、COBOLコードにおいて宣言されているデータ項目のデータ(以下、第1のデータ)に対応するデータ(以下、第2のデータ)を管理する機能を有する、請求項1に記載のコンピュータ・システム。   The computer according to claim 1, wherein the wrapper class has a function of managing data (hereinafter, second data) corresponding to data of a data item (hereinafter, first data) declared in the COBOL code. ·system. 前記ラッパークラスが、
前記第2のデータを格納する第1のchar配列と、
前記第2のデータの文字数を格納する変数と、
前記第2のデータが格納される位置を表すオフセット値を格納する変数と
を含む、請求項2に記載のコンピュータ・システム。
The wrapper class is
A first char array for storing the second data;
A variable for storing the number of characters of the second data;
The computer system according to claim 2, further comprising: a variable that stores an offset value that represents a position where the second data is stored.
前記ラッパークラスから生成されるオブジェクト(以下、第1のオブジェクト)が、
前記第2のデータに対応する第3のデータを管理し、及び
前記第1のchar配列に対応する第2のchar配列と、
前記第3のデータの文字数を格納する前記変数に対応する第1の変数と、
前記第3のデータが格納される位置を表すオフセット値を格納する前記変数に対応する第2の変数と
を含む、請求項3に記載のコンピュータ・システム。
An object generated from the wrapper class (hereinafter referred to as a first object)
Managing third data corresponding to the second data; and a second char array corresponding to the first char array;
A first variable corresponding to the variable storing the number of characters of the third data;
The computer system according to claim 3, further comprising: a second variable corresponding to the variable that stores an offset value that represents a position where the third data is stored.
前記第2のchar配列が、
前記第3のデータを格納し、又は、
前記第1のオブジェクトの属する階層構造において上位階層にあり且つ前記ラッパークラスから生成されるところのオブジェクト(以下、第2のオブジェクト)に含まれる第3のchar配列についてのメモリ領域を共有し、
ここで、前記第2のオブジェクトは、前記第1のchar配列に対応する前記第3のchar配列を含み、及び前記第3のchar配列に対して前記メモリ領域が割り当てられている最も上位階層のオブジェクトであり、
前記第3のchar配列は、前記第3のデータが格納される前記メモリ領域を含む、請求項4に記載のコンピュータ・システム。
The second char array is
Storing the third data, or
Sharing a memory area for a third char array included in an object (hereinafter referred to as a second object) that is in an upper hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class;
Here, the second object includes the third char array corresponding to the first char array, and the highest layer in which the memory area is allocated to the third char array. Object
The computer system according to claim 4, wherein the third char array includes the memory area in which the third data is stored.
前記第1の変数が、前記第3のデータの文字数を格納する、請求項4に記載のコンピュータ・システム。   The computer system according to claim 4, wherein the first variable stores the number of characters of the third data. 前記第2の変数が、前記メモリ領域上で前記第3のデータが格納される位置を表すオフセット値を格納する、請求項5に記載のコンピュータ・システム。   The computer system according to claim 5, wherein the second variable stores an offset value representing a position where the third data is stored on the memory area. 前記ラッパークラスが、
数値型データを格納する変数と、
前記数値型データと前記第1のchar配列上のデータとの相互変換を行うための0又は1のオブジェクトと、
前記数値型データを格納する変数の有効性を示すフラグと、
char配列表現の有効性を示すフラグと
をさらに含む、請求項3に記載のコンピュータ・システム。
The wrapper class is
A variable that stores numeric data,
An object of 0 or 1 for performing mutual conversion between the numeric data and the data on the first char array;
A flag indicating the validity of a variable for storing the numeric data;
The computer system according to claim 3, further comprising: a flag indicating the validity of the char array representation.
前記ラッパークラスから生成されるオブジェクト(以下、第1のオブジェクト)が、
前記第2のデータに対応する第3のデータを管理し、及び
前記第1のchar配列に対応する第2のchar配列と、
前記第3のデータの文字数を格納する前記変数に対応する第1の変数と、
前記第3のデータが格納される位置を表すオフセット値を格納する前記変数に対応する第2の変数と、
前記数値型データを格納する前記変数に対応する第3の変数と、
前記数値型データを格納する変数の有効性を示す前記フラグに対応する第1のフラグと、
前記char配列表現の有効性を示す前記フラグに対応する第2のフラグと
を含み、
前記ラッパークラスが前記相互変換を行うためのオブジェクトを含む場合、前記相互変換を行うためのオブジェクトに対応する第1の相互変換オブジェクトと
をさらに含む、請求項8に記載のコンピュータ・システム。
An object generated from the wrapper class (hereinafter referred to as a first object)
Managing third data corresponding to the second data; and a second char array corresponding to the first char array;
A first variable corresponding to the variable storing the number of characters of the third data;
A second variable corresponding to the variable storing an offset value representing a position where the third data is stored;
A third variable corresponding to the variable storing the numeric data;
A first flag corresponding to the flag indicating the validity of a variable for storing the numeric data;
A second flag corresponding to the flag indicating the validity of the char array representation,
The computer system according to claim 8, further comprising: a first mutual conversion object corresponding to the object for performing the mutual conversion when the wrapper class includes an object for performing the mutual conversion.
前記ラッパークラスが、前記第1のchar配列についてのメモリ領域を共有する命令をさらに含み、
前記ラッパークラスから生成されるオブジェクト(以下、第1のオブジェクト)が、前記第1のchar配列に対応する第2のchar配列及び前記共有する命令を含み、
前記第1のオブジェクトの共有する命令が、
前記第2のchar配列についてのメモリ領域を、前記ラッパークラスから生成され且つ前記第1のchar配列に対応する第4のchar配列を有するところの第3のオブジェクトに含まれる前記第4のchar配列についてのメモリ領域と共有する命令
を含む、請求項3に記載のコンピュータ・システム。
The wrapper class further includes an instruction sharing a memory area for the first char array;
An object generated from the wrapper class (hereinafter referred to as a first object) includes a second char array corresponding to the first char array and the shared instruction;
The instruction shared by the first object is:
The fourth char array included in the third object having a fourth char array generated from the wrapper class and corresponding to the first char array, the memory area for the second char array The computer system of claim 3 comprising instructions for sharing with a memory region.
前記第2のデータが、COBOLのREDEFINES句で宣言される第1のデータに対応するデータであり、
前記第1のオブジェクトの共有する命令が、前記第1のオブジェクトの生成において実行されるコンストラクタに含まれる、請求項10に記載のコンピュータ・システム。
The second data is data corresponding to the first data declared in the REDEFINES clause of COBOL;
The computer system according to claim 10, wherein the instruction shared by the first object is included in a constructor executed in generation of the first object.
前記ラッパークラスが、前記第1のオブジェクトの属する階層構造において下位階層にあり且つ前記ラッパークラスから生成されるところの少なくとも1のオブジェクト(以下、第4のオブジェクト)の定義をさらに含み、
前記CPUが下記命令をさらに実行し、該命令が、
前記第3のデータのセット又はゲットの命令を実行する命令と、
前記第2のchar配列についてのメモリ領域が割り当てられていない場合、
前記第2のchar配列に対してメモリ領域を割り当てる命令と、
前記第4のオブジェクトに含まれる第5のchar配列についてのメモリ領域を共有する命令であって、
前記第4のオブジェクトが、
前記第2のデータに対応する第4のデータを管理し、及び
前記第1のchar配列に対応する前記第5のchar配列と、
前記第4のデータの文字数を格納する前記変数に対応する第4の変数と、
前記第4のデータが格納される位置を表すオフセット値を格納する前記変数に対応する第5の変数と
を含む、前記共有する命令と、
前記第5の変数に対して、前記第4のデータの前記第2のchar配列についての前記メモリ領域における位置を設定する命令と
を含む、請求項4に記載のコンピュータ・システム。
The wrapper class further includes a definition of at least one object (hereinafter referred to as a fourth object) that is in a lower hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class;
The CPU further executes the following instruction, the instruction:
An instruction to execute the third data set or get instruction;
If no memory area is allocated for the second char array,
An instruction for allocating a memory area to the second char array;
An instruction for sharing a memory area for a fifth char array included in the fourth object,
The fourth object is
Managing fourth data corresponding to the second data, and the fifth char array corresponding to the first char array;
A fourth variable corresponding to the variable storing the number of characters of the fourth data;
The shared instruction comprising: a fifth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
The computer system according to claim 4, further comprising: an instruction for setting a position in the memory area for the second char array of the fourth data with respect to the fifth variable.
前記共有する命令が、
前記第5のchar配列に対してメモリ領域が割り当てられている場合に、前記第5のchar配列に格納された前記第4のデータを前記第2のchar配列にコピーする命令をさらに含む、請求項12に記載のコンピュータ・システム。
The shared instruction is
The memory device further includes an instruction to copy the fourth data stored in the fifth char array to the second char array when a memory area is allocated to the fifth char array. Item 13. The computer system according to Item 12.
前記ラッパークラスが、前記第1のオブジェクトの属する階層構造において下位階層にあり且つ前記ラッパークラスから生成されるところの少なくとも1のオブジェクト(以下、第4のオブジェクト)の定義をさらに含み、
前記CPUが下記命令をさらに実行し、該命令が、
前記第3のデータのセット又はゲットの命令を実行する命令と、
前記第2のchar配列についてのメモリ領域が割り当てられていない場合、
前記第2のchar配列に対してメモリ領域を割り当てる命令と、
前記第4のオブジェクトに含まれる第5のchar配列についてのメモリ領域を共有する命令であって、
前記第4のオブジェクトが、
前記第2のデータに対応する第4のデータを管理し、及び
前記第1のchar配列に対応する前記第5のchar配列と、
前記第4のデータの文字数を格納する前記変数に対応する第4の変数と、
前記第4のデータが格納される位置を表すオフセット値を格納する前記変数に対応する第5の変数と、
前記数値型データを格納する前記変数に対応する第6の変数と、
前記相互変換を行うためのオブジェクトに対応する第2の相互変換オブジェクトと、
前記数値型データを格納する変数の有効性を示す前記フラグに対応する第3のフラグと、
前記char配列表現の有効性を示す前記フラグに対応する第4のフラグと
を含む、前記共有する命令と、
前記第5の変数に対して、前記第4のデータの前記第2のchar配列についての前記メモリ領域における位置を設定する命令と
を含む、請求項9に記載のコンピュータ・システム。
The wrapper class further includes a definition of at least one object (hereinafter referred to as a fourth object) that is in a lower hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class;
The CPU further executes the following instruction, the instruction:
An instruction to execute the third data set or get instruction;
If no memory area is allocated for the second char array,
An instruction for allocating a memory area to the second char array;
An instruction for sharing a memory area for a fifth char array included in the fourth object,
The fourth object is
Managing fourth data corresponding to the second data, and the fifth char array corresponding to the first char array;
A fourth variable corresponding to the variable storing the number of characters of the fourth data;
A fifth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
A sixth variable corresponding to the variable storing the numeric data;
A second mutual conversion object corresponding to the object for performing the mutual conversion;
A third flag corresponding to the flag indicating the validity of a variable for storing the numeric data;
The shared instruction comprising: a fourth flag corresponding to the flag indicating the validity of the char array representation;
The computer system according to claim 9, further comprising: an instruction for setting a position in the memory area for the second char array of the fourth data with respect to the fifth variable.
前記共有する命令が、
前記第5のchar配列に対してメモリ領域が割り当てられている場合に、前記第5のchar配列に格納された前記第4のデータを前記第2のchar配列にコピーする命令をさらに含む、請求項14に記載のコンピュータ・システム。
The shared instruction is
The memory device further includes an instruction to copy the fourth data stored in the fifth char array to the second char array when a memory area is allocated to the fifth char array. Item 15. The computer system according to Item 14.
前記コピーする命令が、
前記第4のオブジェクトの有する前記第3のフラグを無効に設定する命令
をさらに含む、請求項15に記載のコンピュータ・システム。
The instruction to copy is
The computer system according to claim 15, further comprising an instruction to set the third flag of the fourth object to invalid.
セットされるデータとして数値型データが与えられた場合、前記CPUが下記命令をさらに実行し、該命令が、
前記第3の変数に前記数値型データをセットする命令と、
前記第2のフラグを無効に設定する命令と
を含む、請求項9に記載のコンピュータ・システム。
When numerical data is given as the data to be set, the CPU further executes the following instruction,
An instruction to set the numeric data in the third variable;
The computer system according to claim 9, further comprising: an instruction to set the second flag to invalid.
前記第3の変数に前記数値型データをセットする命令が、
前記第1のフラグを有効に設定する命令
をさらに含む、請求項17に記載のコンピュータ・システム。
An instruction to set the numeric data in the third variable is
The computer system according to claim 17, further comprising an instruction to set the first flag to be valid.
前記命令の実行がゲットの命令であり、
前記CPUが下記命令をさらに実行し、該命令が、
前記メモリ領域が共有された前記第5のchar配列から前記第4のデータを取り出す命令
を含む、請求項14に記載のコンピュータ・システム。
The execution of the instruction is a get instruction,
The CPU further executes the following instruction, the instruction:
The computer system according to claim 14, further comprising: an instruction for retrieving the fourth data from the fifth char array in which the memory area is shared.
前記命令の実行がゲットの命令であり、
前記CPUが下記命令をさらに実行し、該命令が、
前記第4のフラグを取得し、該取得した第4のフラグが有効に設定されていることを確認する命令
を含む、請求項19に記載のコンピュータ・システム。
The execution of the instruction is a get instruction,
The CPU further executes the following instruction, the instruction:
The computer system according to claim 19, further comprising: an instruction for acquiring the fourth flag and confirming that the acquired fourth flag is set to be valid.
前記CPUが下記命令をさらに実行し、該命令が、
前記第3の変数から数値型データを取得する命令と、
前記第1の相互変換オブジェクトを用いて、前記取得したデータを文字型のデータに変換する命令と、
前記変換された文字型のデータを前記第2のchar配列に設定する命令と、
前記第2のフラグを有効に設定する命令と
を含む、請求項9に記載のコンピュータ・システム。
The CPU further executes the following instruction, the instruction:
An instruction for obtaining numerical data from the third variable;
An instruction for converting the acquired data into character type data using the first mutual conversion object;
An instruction to set the converted character type data in the second char array;
The computer system according to claim 9, further comprising: an instruction for effectively setting the second flag.
前記CPUが下記命令をさらに実行し、該命令が、
前記第2のchar配列から文字型のデータを取得する命令と、
前記第1の相互変換オブジェクトを用いて、前記取得した文字型のデータを数値型データに変換する命令と、
前記変換された数値型データを前記第3の変数に設定する命令と、
前記第1のフラグを有効に設定する命令と
を含む、請求項9に記載のコンピュータ・システム。
The CPU further executes the following instruction, the instruction:
An instruction to obtain character type data from the second char array;
Using the first mutual conversion object, an instruction for converting the acquired character type data into numeric type data;
An instruction to set the converted numeric data to the third variable;
The computer system according to claim 9, further comprising: an instruction to set the first flag to be valid.
COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行する方法において、コンピュータ・システムに下記ステップを実行させる方法であって、
ラッパークラスをデータ型とするオブジェクトの少なくとも1の宣言を有する前記プログラムを記憶部からメモリ内に読み出すステップであって、前記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言である、前記読み出すステップと、
前記読み出したプログラムを実行するステップと
を含む、前記方法。
A method for executing a program including JAVA (trademark) code converted from COBOL code, wherein the computer system performs the following steps:
Reading the program having at least one declaration of an object whose data type is a wrapper class from a storage unit into a memory, wherein each of the declarations is a declaration converted from a declaration of a data item included in a COBOL code Said reading step;
Executing the read program.
COBOLコードから変換されたJAVA(商標)コードを含むプログラムを実行する方法において、コンピュータ・システムに下記ステップを実行させる方法であって、
ラッパークラスをデータ型とするオブジェクトの少なくとも1の宣言を有するJAVAコードを含むプログラムを記憶部からメモリ内に読み出すステップであって、
前記宣言夫々は、COBOLコードに含まれるデータ項目の宣言夫々から変換された宣言であり、前記ラッパークラスは、COBOLコードにおいて宣言されているデータ項目のデータ(以下、第1のデータ)に対応するデータ(以下、第2のデータ)を管理する機能を有し、
前記ラッパークラスは、
前記第2のデータを格納する第1のchar配列と、
前記第2のデータの文字数を格納する変数と、
前記第2のデータが格納される位置を表すオフセット値を格納する変数と、
数値型データを格納する0又は1の変数と、
前記数値型データと前記第1のchar配列上のデータとの相互変換を行うための0又は1のオブジェクトと、
前記数値型データを格納する変数の有効性を示す0又は1のフラグと、
char配列表現の有効性を示す0又は1のフラグと、
前記ラッパークラスから生成される0以上のオブジェクトの定義と
を含み、
前記ラッパークラスから生成されるオブジェクト(以下、第1のオブジェクト)は、
前記第2のデータに対応する第3のデータを管理し、及び
前記第1のchar配列に対応する第2のchar配列と、
前記第3のデータの文字数を格納する前記変数に対応する第1の変数と、
前記第3のデータが格納される位置を表すオフセット値を格納する前記変数に対応する第2の変数と、
前記第1のオブジェクトの属する階層構造において下位階層にあり且つ前記ラッパークラスから生成されるところの少なくとも1のオブジェクト(以下、下位階層のオブジェクト)と
を含み、
前記下位階層のオブジェクトは、
前記第2のデータに対応する第4のデータを管理し、及び
前記第1のchar配列に対応する前記第3のchar配列と、
前記第4のデータの文字数を格納する前記変数に対応する第3の変数と、
前記第4のデータが格納される位置を表すオフセット値を格納する前記変数に対応する第4の変数と、
前記数値型データを格納する前記変数に対応する第5の変数と、
前記相互変換を行うためのオブジェクトに対応する第2の相互変換オブジェクトと、
前記数値型データを格納する変数の有効性を示す前記フラグに対応する第1のフラグと、
前記char配列表現の有効性を示す前記フラグに対応する第2のフラグと
を含む、
前記読み出すステップと、
前記第3のデータのセット又はゲットの命令を実行するステップと、
前記第2のchar配列についてのメモリ領域が割り当てられていない場合、
前記第2のchar配列に対してメモリ領域を割り当てるステップと、
前記下位階層のオブジェクトに含まれる第3のchar配列についてのメモリ領域を共有するステップと、
前記第4の変数に対して、前記第4のデータの前記第2のchar配列についての前記メモリ領域における位置を設定するステップと
を含む、前記方法。
A method for executing a program including JAVA (trademark) code converted from COBOL code, wherein the computer system performs the following steps:
Reading a program including a JAVA code having at least one declaration of an object whose data type is a wrapper class from a storage unit into a memory;
Each of the declarations is a declaration converted from each of the declarations of the data items included in the COBOL code, and the wrapper class corresponds to data of the data items declared in the COBOL code (hereinafter referred to as first data). Has a function of managing data (hereinafter referred to as second data),
The wrapper class is
A first char array for storing the second data;
A variable for storing the number of characters of the second data;
A variable for storing an offset value representing a position where the second data is stored;
A variable of 0 or 1 that stores numeric data,
An object of 0 or 1 for performing mutual conversion between the numeric data and the data on the first char array;
A 0 or 1 flag indicating the validity of a variable storing the numeric data;
a 0 or 1 flag indicating the validity of the char array representation;
Including zero or more object definitions generated from the wrapper class,
An object generated from the wrapper class (hereinafter referred to as a first object) is
Managing third data corresponding to the second data; and a second char array corresponding to the first char array;
A first variable corresponding to the variable storing the number of characters of the third data;
A second variable corresponding to the variable storing an offset value representing a position where the third data is stored;
And at least one object (hereinafter referred to as an object in a lower hierarchy) that is in a lower hierarchy in the hierarchical structure to which the first object belongs and is generated from the wrapper class,
The lower layer object is:
Managing fourth data corresponding to the second data, and the third char array corresponding to the first char array;
A third variable corresponding to the variable storing the number of characters of the fourth data;
A fourth variable corresponding to the variable storing an offset value representing a position where the fourth data is stored;
A fifth variable corresponding to the variable storing the numeric data;
A second mutual conversion object corresponding to the object for performing the mutual conversion;
A first flag corresponding to the flag indicating the validity of a variable for storing the numeric data;
A second flag corresponding to the flag indicating the validity of the char array representation,
Said reading step;
Executing the third data set or get instructions;
If no memory area is allocated for the second char array,
Allocating a memory area for the second char array;
Sharing a memory area for a third char array included in the lower layer object;
Setting the position in the memory area for the second char array of the fourth data for the fourth variable.
コンピュータに、請求項23〜24のいずれか一項に記載の方法の各ステップを実行させるコンピュータ・プログラム。   A computer program that causes a computer to execute the steps of the method according to any one of claims 23 to 24.
JP2008253637A 2008-09-30 2008-09-30 Computer system for executing program including JAVA (registered trademark) code converted from COBOL code, and method and computer program thereof Expired - Fee Related JP5147626B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008253637A JP5147626B2 (en) 2008-09-30 2008-09-30 Computer system for executing program including JAVA (registered trademark) code converted from COBOL code, and method and computer program thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008253637A JP5147626B2 (en) 2008-09-30 2008-09-30 Computer system for executing program including JAVA (registered trademark) code converted from COBOL code, and method and computer program thereof

Publications (2)

Publication Number Publication Date
JP2010086218A true JP2010086218A (en) 2010-04-15
JP5147626B2 JP5147626B2 (en) 2013-02-20

Family

ID=42250130

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008253637A Expired - Fee Related JP5147626B2 (en) 2008-09-30 2008-09-30 Computer system for executing program including JAVA (registered trademark) code converted from COBOL code, and method and computer program thereof

Country Status (1)

Country Link
JP (1) JP5147626B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013045247A (en) * 2011-08-23 2013-03-04 Nec System Technologies Ltd Compilation support device, compilation support method, and program
JP2016115070A (en) * 2014-12-12 2016-06-23 Tis株式会社 Program conversion system
JP6458196B1 (en) * 2018-09-27 2019-01-23 Tis株式会社 Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method
JP6475888B1 (en) * 2018-10-05 2019-02-27 Tis株式会社 Program conversion system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006011756A (en) * 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
JP2007265030A (en) * 2006-03-28 2007-10-11 Nomura Research Institute Ltd Job management apparatus and job management method
US7386840B1 (en) * 2004-09-09 2008-06-10 Lockheed Martin Corporation Method, apparatus, and program for source code translation from COBOL to object-oriented code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006011756A (en) * 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
US7386840B1 (en) * 2004-09-09 2008-06-10 Lockheed Martin Corporation Method, apparatus, and program for source code translation from COBOL to object-oriented code
JP2007265030A (en) * 2006-03-28 2007-10-11 Nomura Research Institute Ltd Job management apparatus and job management method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013045247A (en) * 2011-08-23 2013-03-04 Nec System Technologies Ltd Compilation support device, compilation support method, and program
JP2016115070A (en) * 2014-12-12 2016-06-23 Tis株式会社 Program conversion system
JP6458196B1 (en) * 2018-09-27 2019-01-23 Tis株式会社 Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method
JP6475888B1 (en) * 2018-10-05 2019-02-27 Tis株式会社 Program conversion system

Also Published As

Publication number Publication date
JP5147626B2 (en) 2013-02-20

Similar Documents

Publication Publication Date Title
Gremme et al. GenomeTools: a comprehensive software library for efficient processing of structured genome annotations
Miller et al. An overview of the CellML API and its implementation
JP5851396B2 (en) Processing method
US8479155B2 (en) Hypergraph implementation
Treichler et al. Language support for dynamic, hierarchical data partitioning
TWI442235B (en) Memory transaction grouping
US8225276B1 (en) Shared code management
US20080016108A1 (en) Storing and loading data in an array-based computing environment
RU2571592C2 (en) Method and system for managing static data structures of legacy software in dynamic class loader environments
JPH0836494A (en) Method and device for type-safe framework for dynamic expandable object
Güld et al. A generic concept for the implementation of medical image retrieval systems
Verwaest et al. Flexible object layouts: enabling lightweight language extensions by intercepting slot access
Dou et al. Scientific workflow design 2.0: Demonstrating streaming data collections in Kepler
CN114930297A (en) Lock-free reading of sets of unit values
JP5147626B2 (en) Computer system for executing program including JAVA (registered trademark) code converted from COBOL code, and method and computer program thereof
Braibant et al. Implementing and reasoning about hash-consed data structures in Coq
CN114830099A (en) Markup integrating references and secondary objects
JP4754004B2 (en) Method for converting program code of program operating on multithread to program code with less lock collision, and computer program and computer system thereof
Li Java: data structures and programming
US20060130008A1 (en) Model-to-model transformation by kind
Hirschowitz et al. Compilation of extended recursion in call-by-value functional languages
Zakowski et al. Verifying a concurrent garbage collector using a rely-guarantee methodology
JP5600301B2 (en) System representation and handling technology
Bancila Modern C++ Programming Cookbook: Master C++ core language and standard library features, with over 100 recipes, updated to C++ 20
Panyala et al. On the use of term rewriting for performance optimization of legacy HPC applications

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110816

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121010

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121011

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20121011

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121101

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20121101

RD14 Notification of resignation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7434

Effective date: 20121101

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121127

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151207

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees