JPH0334029A - Designating system for input/output of index - Google Patents

Designating system for input/output of index

Info

Publication number
JPH0334029A
JPH0334029A JP16700889A JP16700889A JPH0334029A JP H0334029 A JPH0334029 A JP H0334029A JP 16700889 A JP16700889 A JP 16700889A JP 16700889 A JP16700889 A JP 16700889A JP H0334029 A JPH0334029 A JP H0334029A
Authority
JP
Japan
Prior art keywords
read
exists
record
key
specifier
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
JP16700889A
Other languages
Japanese (ja)
Other versions
JP2507809B2 (en
Inventor
Nobuko Imamoto
今本 伸子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP16700889A priority Critical patent/JP2507809B2/en
Publication of JPH0334029A publication Critical patent/JPH0334029A/en
Application granted granted Critical
Publication of JP2507809B2 publication Critical patent/JP2507809B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To obtain a simple and multi-functional user program by deciding whether a specific designator is included in an index READ sentence of FORTRAN or not and then decided whether a read key is included in another record or not when the designator is included in the index READ sentence. CONSTITUTION:When a READ sentence of a FORTRAN program exists, a single record is inputted. Then it is decided whether a CONTKEY designator is designated in the READ sentence or not. If so, the following record is read. Then it is decided whether a key equal to that read previously exists or not. Thus it is possible to obtain an index input/output designating system where a simple and multi-functional user program is obtained.

Description

【発明の詳細な説明】 〔概   要〕 高級言語の入出力処理を行う索引入出力の指定方式に関
し、 ユーザプログラムが簡単であり、かつ多機能とする索引
入出力の指定方式を目的とし、l/コード単位でキーが
設けられたファイルをアクセスして読み出したキーが他
のレコードに存在するか否かの判定を指示する指定子が
、FORTRANの索引READ文中に存在するかを判
別し、前記指定子が存在するときに読み出したキーが他
のレコードに存在するか否かの判定を行うように構成す
る。
[Detailed Description of the Invention] [Summary] Regarding an index input/output specification method for high-level language input/output processing, the present invention aims to provide an index input/output specification method that allows user programs to be simple and multifunctional. / Determine whether a specifier that instructs to determine whether the key read by accessing a file in which keys are provided in code units exists in another record exists in the FORTRAN index READ statement, and It is configured to determine whether the key read when the specifier exists exists in another record.

〔産業上の利用分野〕[Industrial application field]

本発明は、FORTRAN等の高級言語を実行するコン
ピュータシステムに係り、さらに詳しくは、高級言語の
入出力処理を行う索引入出力の指定方式に関する。
The present invention relates to a computer system that executes a high-level language such as FORTRAN, and more particularly to a method for specifying index input/output for performing high-level language input/output processing.

〔従来の技術〕[Conventional technology]

近年、コンピュータシステムの多様化に伴い、多機能を
備えた処理プログラムが要求されている。
In recent years, with the diversification of computer systems, there has been a demand for processing programs with multiple functions.

特に、高級言語において処理がどのように?!雑であっ
ても、その処理をプログラムによって実現できるように
したインタプリタやコンパイラが要求されている。しか
し、FORTRANのインタプリタやコンパイラにおい
ては、複数レコードに同一のキーが存在するようなデー
タは処理することはできなかった。例えば0PEN文に
よってファイルを指定するとともに、キーフィールドや
アクセスを指定してオープンした後、READ文によっ
て指定されたキーを読み取る場合、その読み取ったキー
が他のレコードに存在するか否かを判別することはでき
なかった。
In particular, how is it processed in high-level languages? ! There is a demand for interpreters and compilers that can perform even complex processing through programs. However, FORTRAN interpreters and compilers cannot process data where the same key exists in multiple records. For example, after specifying a file with the 0PEN statement, specifying the key field and access, and then opening it, when reading the key specified with the READ statement, determine whether the read key exists in another record or not. I couldn't do that.

〔発明が解決しようとする課題〕 このため、例えば複数レコードにわたって同一キーが存
在したような場合には、目的の処理を行うことができな
いという問題を有していた。
[Problems to be Solved by the Invention] Therefore, there has been a problem in that, for example, when the same key exists across multiple records, the desired process cannot be performed.

従来においてはこのような問題を発生しないために、人
力時に他のレコードに同一キーが存在しないようにチエ
ツクしていた。しかしながらこのチエツクは人手による
ものであり、チエツクに多くの時間を有するという問題
があった。
In the past, in order to avoid such problems, a check was made manually to ensure that the same key did not exist in other records. However, this check is done manually, and there is a problem in that it takes a lot of time.

本発明は、ユーザプログラムが簡単であり、かつ多機能
とする索引入出力の指定方式を目的とする。
The object of the present invention is to provide a method for specifying index input/output that allows a user program to be simple and multifunctional.

〔課題を解決するための手段および作用〕FORTRA
N言語においで、READ文中にレコード単位でキーが
設けられたファイルをアクセスして読み出したキーが他
のレコードに存在するか否かの判定を指示する指定子を
設ける。ユーザプログラムを例えばインタプリタで実行
する場合には、前述のレコード単位でキーが設けられた
ファイルをアクセスして読み出したキーが他のレコード
に存在するか否かの判定を指示する指定子がREAD文
中に存在するかを判別し、存在する場合にはその判定を
行いユーザプログラムにその結果を渡す。またコンパイ
ラであるならば、前記指定子が存在するか否かを判別し
、存在するときには読み出したキーが他のレコードに存
在するか否かの判定を行う処理プログラムを発生し、オ
ブジェクトプログラムに加える。このコンパイラによっ
て得られたオブジェクトプログラムには、READ文に
対応した処理を実行して1レコード読み取った後に、続
く1レコードをも読み取って前記1レコードに存在する
キーが前記続くレコードに存在するかを判別する処理が
組み込まれる。前記指定子は例えばC0NTKEY等の
簡単な指定でよく、簡単な指定子によって索引入出力に
おける連続したキーの判別を行うことができる。
[Means and actions for solving problems] FORTRA
In the N language, a specifier is provided in a READ statement to instruct whether or not a key read by accessing a file in which keys are provided for each record exists in another record. For example, when a user program is executed using an interpreter, a specifier is included in the READ statement that instructs whether or not the key read by accessing the file in which the keys are provided for each record described above exists in another record. If so, it is determined and the result is passed to the user program. Also, if it is a compiler, it will determine whether the specifier exists or not, and if it does, it will generate a processing program that determines whether the read key exists in another record and add it to the object program. . In the object program obtained by this compiler, after executing the process corresponding to the READ statement and reading one record, it also reads the following record and determines whether the key that exists in the previous record exists in the following record. Processing to determine this is included. The specifier may be a simple designation such as C0NTKEY, and consecutive keys in index input/output can be determined by the simple specifier.

〔実  施  例〕〔Example〕

以下、図面を用いて本発明の詳細な説明する。 Hereinafter, the present invention will be explained in detail using the drawings.

第1図は本発明の実施例のコンパイラにおけるREAD
文の処理フローチャート、第2図は本発明の実施例のシ
ステム図である。
FIG. 1 shows READ in the compiler of the embodiment of the present invention.
Statement processing flowchart, FIG. 2 is a system diagram of an embodiment of the present invention.

第2図におけるFORTRANプログラムのREAD文
(READ(10,C0NTKEY=C[lNT、、、
、) )が存在した場合、例えばVSAMのアクセス処
理によって1レコードの入力を行う(SL)。この処理
(S1)はREAD文における1レコードの読み出しの
処理であり、第2図には書かれていないが、例えばキー
変数等への格納はこの処理によってなされる。基本的な
READ文の実行の処理(S1)の後、このREAD文
中C0NTKEY指定子の指定があるか否かを判別する
(S2)。判別(S2)においてC0NTKEY指定子
が存在しない場合(No)にはそのREAD文での実行
を終了(END)する。一方判別(S2)において存在
すると判別した時(YES)には、続くレコードを読み
取り、先に読み取ったキーと同一のキ−が存在するかを
判別する(S3)。本発明の実施例においては、FOR
TRANライブラリ内で一致しているか否かを判別し、
一致している時にはマクロ詳細コードをX゛08″ と
する。よって、処理S3ではマクロ詳細コードがX’0
8’ であるかを判別する。例えばこのマクロ詳細コー
ドはC0NTKEY指定に対する処理プログラムのコー
ドである。
The READ statement of the FORTRAN program in Figure 2 (READ (10, C0NTKEY=C[lNT, ,
, ) ) exists, one record is input by, for example, VSAM access processing (SL). This process (S1) is a process of reading one record in a READ statement, and although it is not shown in FIG. 2, storage in, for example, a key variable is performed by this process. After the basic READ statement execution processing (S1), it is determined whether or not the C0NTKEY specifier is specified in this READ statement (S2). If the C0NTKEY specifier does not exist in the determination (S2) (No), the execution of the READ statement is ended (END). On the other hand, when it is determined in the determination (S2) that the key exists (YES), the subsequent record is read and it is determined whether the same key as the previously read key exists (S3). In an embodiment of the invention, FOR
Determine whether there is a match in the TRAN library,
If they match, the macro detail code is set to X'08''. Therefore, in process S3, the macro detail code is set to X'0.
8'. For example, this macro detail code is a code of a processing program for C0NTKEY specification.

このコードを判別しX″08’ である時(YES)に
は、C0NTKEY指定子に真の値を返却する(S4)
。またX”08゛ でない時にはC○NTKEY指定子
に偽の値を返却する(S5)。
Determine this code and if it is X″08’ (YES), return a true value to the C0NTKEY specifier (S4)
. If it is not X"08", a false value is returned to the C○NTKEY specifier (S5).

そしてRE AD文における処理を終了する。前述の実
施例においてはコンパイラで説明したが、これに限るも
のではなく、インタプリタにおいても同様である。
Then, the processing in the RE AD statement ends. Although the above embodiment has been explained using a compiler, the present invention is not limited to this, and the same applies to an interpreter.

また、第1の実施例においてはコンパイラで説明したが
これに限るものではない。例えば第2図に示すように、
FORTRANプログラムをコンパイルし、オブジェク
トをプログラムを作成した時点において、あらかじめコ
ンパイル時にREAD文に存在するC0NTKEY指定
子を判別し、C0NTKEY指定子が存在するならばオ
ブジェクトプログラム中にC0NTKEY指定子に対応
する処理を挿入するか、或いはFORTRANライブラ
リ中のC0NTKEY指定子に対する処理と結合する。
Furthermore, although the first embodiment has been described using a compiler, the present invention is not limited to this. For example, as shown in Figure 2,
When a FORTRAN program is compiled and an object program is created, the C0NTKEY specifier that exists in the READ statement is determined in advance during compilation, and if the C0NTKEY specifier exists, the process corresponding to the C0NTKEY specifier is executed in the object program. Insert or combine with processing for the C0NTKEY specifier in the FORTRAN library.

なお、この結合とは、オブジェクトプログラムとFOR
TRANライブラリ中のC0NTKEY指定子とのリン
クである。
Note that this combination refers to the object program and the FOR
This is a link with the C0NTKEY specifier in the TRAN library.

第3図は本発明の実施例のプログラム例図、第4図は本
発明の実施例のフローチャートである。
FIG. 3 is a program example diagram of an embodiment of the present invention, and FIG. 4 is a flowchart of the embodiment of the present invention.

あらかじめキャラクタ(CHARACTER)でBKE
YIが2文字のデータ、AKEYlが4文字のデータ、
DATAIが10文字のデータであり、さらにロジカル
LOGICALによって4桁であると指定する。そして
ファイル名がA、DATAなるファイルをOPEN文(
OPEN(10,FILE=’ A、DATA’ 、 
KEYFIELD= (1:2.3:6) 、 ACC
ESS=’ KEYFD’ ) )によってオープンし
、アクセス可能とする(S7)なおOPEN文中のKE
YF I ELDは各1レコード内でのキーフィールド
を指示しており、ACCESSによってそのアクセスの
種類を指定している。このOPEN文によってファイル
がオープンできているので、続いてREAD文(REA
D(10゜FMT=’ (2A、4A、A) ’ 、 
KEY=’ C00O’ 、 KEYID=2.C0N
TKEY=CONT)BKEYI、AKEYI、DAT
AI)を実行する(S8)。
BKE with character (CHARACTER) in advance
YI is 2 character data, AKEYl is 4 character data,
Specify that DATAI is 10 character data, and that it is 4 digits by LOGICAL. Then, use the OPEN statement (
OPEN(10,FILE='A,DATA',
KEYFIELD= (1:2.3:6), ACC
ESS='KEYFD' )) to open and make it accessible (S7) Note that the KE in the OPEN statement
YF I ELD indicates a key field within each record, and ACCESS specifies the type of access. Since the file has been opened with this OPEN statement, the READ statement (REA
D(10°FMT=' (2A, 4A, A) ',
KEY='C00O', KEYID=2. C0N
TKEY=CONT) BKEYI, AKEYI, DAT
AI) is executed (S8).

この実行においてはC0NTKEY指定子によって結果
をC0NTに格納するよう指示しであるので、このRE
AD文を実行したときには、次のレコードをも読み、同
一のキーが存在した時には変数C0NTKEYに真の値
を、存在していない時には偽の値を加え処理を終了する
In this execution, the C0NTKEY specifier instructs to store the result in C0NT, so this RE
When the AD statement is executed, the next record is also read, and if the same key exists, a true value is added to the variable C0NTKEY, and if it does not exist, a false value is added to the variable C0NTKEY, and the process ends.

ユーザプログラムにおいては同一であった場合とない場
合とでその処理を変更しなくてはならないので、続いて
IF文(IF THEN ELSE)によって変数C0
NTがTRUE (真)あるかを判別する(S9)、T
RUEであった場合(YES)にはGOTO100文に
よって文番号100にジャンプし、TRUEでなかった
場合(No)にはGOTO200によって文番号200
にジャンプする。
In the user program, the process must be changed depending on whether or not they are the same, so next, use the IF statement (IF THEN ELSE) to change the variable C0.
Determine whether NT is TRUE (S9), T
If it is RUE (YES), jump to statement number 100 with GOTO100 statement, and if it is not TRUE (No), jump to statement number 200 with GOTO200.
Jump to.

第3図においては、100番地、200番地はともにC
0NT I NUE文であるが、このCoNTINUE
文には図示しないがそれぞれに対応する処理がプログラ
ムしである。
In Figure 3, addresses 100 and 200 are both C
0NT I NUE statement, but this CoNTINUE
Although not shown in the text, the corresponding processes are programmed.

前述した動作によって例えば第5図のデータ構成を読み
出した場合、レコード(3)からレコード(5)間のキ
ーがC001と同一であり、第3図におけるREAD文
で実行した場合、レコード(3)をREAD文によって
読み取った時に真(TRUE)となり、100番地から
の実行となる。
For example, if the data structure in Figure 5 is read by the above operation, the key between record (3) and record (5) is the same as C001, and if executed with the READ statement in Figure 3, record (3) When read by the READ statement, it becomes true (TRUE) and execution starts from address 100.

第3図、第4図においてはユーザプログラムにおける処
理を説明したが、本発明の実施例ではインタプリタなら
ばREAD文中のC0NTKEYが存在するかを判別し
存在した時に続くレコードを読み取るとともに同一キー
が存在するかを判別するものである。またコンパイラで
あるならば、コンパイル時にのみREAD文中にC0N
TKEY指定子が存在するかを判別し、存在する時のみ
、続く1レコードを読みC0NTKEY指定に対する処
理プログラムいわゆる読み出したキーが一致しているか
否かのの判別を行う処理をオブジェクトプログラムに挿
入するものである。そしてコンパイラによって得られた
オブジェクトプログラム中では1個のREA、D文に対
応した入出力におけるファイルの1レコードの読み出し
処理と続くレコードの第2番目の読み出し処理、さらに
読み出したキーの判別処理が挿入される。
Although the processing in the user program has been explained in FIGS. 3 and 4, in the embodiment of the present invention, the interpreter determines whether C0NTKEY exists in the READ statement, reads the following record when it exists, and reads the record if the same key exists. This is to determine whether the Also, if it is a compiler, C0N is written in the READ statement only at compile time.
Determines whether the TKEY specifier exists, and only when it does exist, reads the next record.Processing program for the C0NTKEY specification.Inserts into the object program a process that determines whether the read keys match or not. It is. Then, in the object program obtained by the compiler, processing for reading one record of the file in input/output corresponding to one REA and D statement, processing for reading the second record of the following record, and processing for determining the read key are inserted. be done.

以上本発明の実施例をインタプリタ並びにコンパイラに
ついて説明したが、これに限らず同一キーが存在する場
合、特定の指定子によって続くレコードも読み取りその
読み取ったレコードと前に読み取ったレコード内のキー
を比較するものであればこれに限るものではない。
The embodiments of the present invention have been described above with respect to an interpreter and a compiler, but the invention is not limited to this. If the same key exists, the following record is also read using a specific specifier, and the keys in the read record and the previously read record are compared. However, it is not limited to this.

〔発明の効果] 以上述べたように、本発明によれば、簡単なキー指定に
よって複雑な処理を行うことができ、プログラムの開発
が簡単化する。さらにプログラムが簡単化するので、作
成の時間、さらにはデバッグの時間をも短縮することが
できる。
[Effects of the Invention] As described above, according to the present invention, complex processing can be performed by simple key designation, and program development is simplified. Furthermore, since the program is simplified, the creation time and even debugging time can be shortened.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の実施例の処理フローチャート、第2図
は本発明の実施例のシステム図、第3図は本発明の実施
例のプログラム例図、第4図は本発明の実施例のフロー
チャート、第5図はデータ構成図である。
Fig. 1 is a processing flowchart of an embodiment of the present invention, Fig. 2 is a system diagram of an embodiment of the present invention, Fig. 3 is a program example diagram of an embodiment of the present invention, and Fig. 4 is a diagram of an example of a program of an embodiment of the present invention. The flowchart and FIG. 5 are data configuration diagrams.

Claims (1)

【特許請求の範囲】 1)レコード単位でキーが設けられたファイルをアクセ
スして読み出したキーが他のレコードに存在するか否か
の判定を指示する指定子が、FORTRANの索引RE
AD文中に存在するかを判別し、前記指定子が存在する
ときに読み出したキーが他のレコードに存在するか否か
の判定を行うことを特徴とする索引入出力の指定方式。 2)レコード単位でキーが設けられたファイルをアクセ
スして読み出したキーが他のレコードに存在するか否か
の判定を指示する指定子が、FORTRANの索引RE
AD文中に存在するかを判別し、前記指定子が存在する
ときに読み出したキーが他のレコードに存在するか否か
の判定を行う処理を発生することを特徴とする索引入出
力の指定方式。 3)READ文中に対応した処理を実行して1レコード
読み取ったときに、続く1レコードをも読み取って前記
1レコードに存在するキーが前記続く1レコードに存在
するかを判別することを特徴とする索引入出力の指定方
式。
[Claims] 1) A specifier that instructs to determine whether or not a key read by accessing a file in which keys are provided for each record exists in another record is a FORTRAN index RE.
An index input/output designation method characterized by determining whether a key exists in an AD sentence and determining whether a key read when the specifier exists exists in another record. 2) The specifier that instructs to determine whether the key read by accessing a file in which keys are provided for each record exists in other records is the FORTRAN index RE.
An index input/output specification method characterized by determining whether a key exists in an AD sentence and determining whether a read key exists in another record when the specifier exists. . 3) When one record is read by executing the process corresponding to the READ statement, the next record is also read to determine whether the key that exists in the one record exists in the next record. Index input/output specification method.
JP16700889A 1989-06-30 1989-06-30 Index input / output specification method Expired - Fee Related JP2507809B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16700889A JP2507809B2 (en) 1989-06-30 1989-06-30 Index input / output specification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16700889A JP2507809B2 (en) 1989-06-30 1989-06-30 Index input / output specification method

Publications (2)

Publication Number Publication Date
JPH0334029A true JPH0334029A (en) 1991-02-14
JP2507809B2 JP2507809B2 (en) 1996-06-19

Family

ID=15841671

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16700889A Expired - Fee Related JP2507809B2 (en) 1989-06-30 1989-06-30 Index input / output specification method

Country Status (1)

Country Link
JP (1) JP2507809B2 (en)

Also Published As

Publication number Publication date
JP2507809B2 (en) 1996-06-19

Similar Documents

Publication Publication Date Title
US5146593A (en) Procedure call interface
CA1159151A (en) Cellular network processors
US6138273A (en) Programmable interpretive virtual machine
EP0537309A1 (en) System and method for preserving source instruction atomicity in translated program code
JPH01306923A (en) System for connecting different languages
US5692196A (en) System and method for conditionally compiling a software compilation unit
US5581769A (en) Multipurpose program object linkage protocol for upward compatibility among different compilers
US5519860A (en) Central processor index sort followed by direct record sort and write by an intelligent control unit
JPS6212529B2 (en)
JPH0334029A (en) Designating system for input/output of index
Mossin Partial evaluation of general parsers
US5671431A (en) Method for processing user program on a parallel computer system by inserting a tag during compiling
JPS59123936A (en) Movement control system
JP2507676B2 (en) Index I / O statement execution processing method
JP3428253B2 (en) Sequencer
JP2601541B2 (en) FORTRAN input / output list processing method
JPS63269229A (en) Compiling system for character string operation system instruction
US7627859B2 (en) Method for configuring non-script language library files to be run as scripts
JPH02110636A (en) Debugging device for tag architecture machine and its compiler
JPS6365530A (en) Code optimizing system
JPH02231638A (en) Message processing method for object directivity data base control system
WO1997007452A1 (en) Programmable compiler
Montuelle CUFOM: the CERN Universal Format for Object Modules
JPH04102125A (en) Symbol processing system for assembler
JPH03103928A (en) Compiler processing method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees