JPH02120931A - External file allocation system for sort - Google Patents

External file allocation system for sort

Info

Publication number
JPH02120931A
JPH02120931A JP63273693A JP27369388A JPH02120931A JP H02120931 A JPH02120931 A JP H02120931A JP 63273693 A JP63273693 A JP 63273693A JP 27369388 A JP27369388 A JP 27369388A JP H02120931 A JPH02120931 A JP H02120931A
Authority
JP
Japan
Prior art keywords
file
sorting
external
sort
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63273693A
Other languages
Japanese (ja)
Inventor
Yoichi Ueda
洋一 上田
Akira Takahashi
明 高橋
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.)
NEC Corp
NEC Solution Innovators Ltd
Original Assignee
NEC Corp
NEC Solution Innovators 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 NEC Corp, NEC Solution Innovators Ltd filed Critical NEC Corp
Priority to JP63273693A priority Critical patent/JPH02120931A/en
Publication of JPH02120931A publication Critical patent/JPH02120931A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To effectively utilize a sorting external file to be a system resource by providing the title system with a sorting external file control means for securing an external file when necessary. CONSTITUTION:Data are inputted from an input file 1 to a sort processing executing means 3, which sorts data while storing them. When the means is satisfied with data, the sorting external file control means 7 secures an external work file 9 and temporarily save sorting intermediate data stored in the means 3 in the file 9. As the result, the input data are stored in the file 9 as an intermediate result for sort. Since the external file is allocated only at the time of using the file for sorting, the allocation time of the external file occupied by sorting is reduced and, during the time the resource is utilized by other program. Thus, the resource is effectively utilized by the whole system.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、ソートの外部ファイル割り付け方式に関し、
特に、システム資源であるソート用の外部ファイルの有
効な割り付け方式に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to an external file allocation method for sorting,
In particular, it relates to an effective allocation method for external files for sorting, which are system resources.

〔従来の技術〕[Conventional technology]

従来のソートプログラムは、次の(1)〜(3)で実現
していた。
The conventional sorting program was realized by the following (1) to (3).

(1)ソート環境として必要と予想される資源(最小ワ
ークメモリ、入力ファイル、出力ファイル、外部ワーク
ファイル)は、ソート実行の前に全て割り付け済みか否
かをチエツクする。割り付けられていなければ処理を中
断する。
(1) Check whether all the resources (minimum work memory, input file, output file, external work file) expected to be necessary for the sort environment have been allocated before executing the sort. If it is not allocated, processing will be interrupted.

(2)割り付け済みの入力ファイルよりデータを入力し
、ワークメモリ内に格納しソートする、ワークメモリ内
にデータを格納しきれない時は、割り付け済みのワーク
ファイルに一旦ソートの中間データをセーブする。ワー
クメモリ内にデータを格納しきれる時は、割り付け済み
の外部ワークファイルへはソート済みデータを出力せず
、そのまま出力ファイルへソート済みデータを出力する
(2) Input data from the allocated input file, store it in the work memory, and sort it. If the data cannot be stored in the work memory, temporarily save the intermediate data for sorting in the allocated work file. . When all the data can be stored in the work memory, the sorted data is not output to the allocated external work file, but is output as is to the output file.

(3〉割り付け済みの外部ワークファイルに一旦ソート
の中間データをセーブした場合、その次には、外部ワー
クファイルとワークメモリを使用して、全入力データを
昇順/降順に並べ換えて出力ファイルへ出力する。
(3> Once the intermediate sort data is saved in the allocated external work file, the external work file and work memory are used to sort all input data in ascending/descending order and output it to the output file. do.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の外部ファイルの割り付け方式では、プロ
グラムの実行の始めに、ソート方式及びソート入出カフ
アイルへの入出力方式を決定する要素である外部ファイ
ル等のソート環境を検査するので、使用しない可能性の
ある外部ワークファイルも実行開始時から装着されてい
る必要があり、ソートした結果のデータを出力する時の
み装着されていればよい出力ファイルも実行開始から装
着されていなくてはならい。このように、使用していな
い資源を長時間占有してしまうという欠点があった。
In the conventional external file allocation method described above, at the beginning of program execution, the sort environment such as external files, which are the elements that determine the sort method and the input/output method to the sort input/output file, is checked, so there is a possibility that the external file will not be used. An external work file must also be installed from the start of execution, and an output file that only needs to be installed when outputting the sorted result data must also be installed from the start of execution. In this way, there is a drawback that unused resources are occupied for a long time.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のソートの外部ファイル割り付方式の構成は、指
定パラメータ及び割り付けられた入力ファイルや出力フ
ァイルのファイル属性を検査し、その入出力方式を決定
するソート環境制御手段と、このソート環境制御手段に
よって決定された入力方式で前記入力ファイルより1件
1件データを読み込み、全てそのデータを読み込んだ時
に前記入力ファイルを開放するソート入力処理手段と、
このソート入力処理手段により読み込まれた前記データ
を入力してデータをソートするソート実行制御手段と、
このソート実行制御手段により並べ換えられたデータを
1件1件前記ソート実行制御手段から受け収って前記ソ
ート環境制御手段によって決定された出力方式で、外部
ファイルが確保できない時に確保できるまで待つか中断
するかを指示しているファイル情報に従って確保した出
力ファイルへ1件1件データを出力するソート出力処理
手段と、前記ソート実行制御手段で使用する外部ファイ
ルの割り付け状況を管理し、前記外部ファイルが確保で
きない時は確保できるまで待つか中断するかの前記ファ
イル情報に従って必要な時に前記外部ファイルを確保す
るソート外部ファイル制御手段とを含んで構成される事
を特徴とする。
The configuration of the external file allocation method for sorting of the present invention includes a sort environment control means that inspects specified parameters and file attributes of allocated input files and output files, and determines the input/output method, and this sort environment control means. a sorting input processing means that reads data one by one from the input file using the input method determined by and releases the input file when all the data has been read;
sorting execution control means for inputting the data read by the sorting input processing means and sorting the data;
The data sorted by the sort execution control means is received one by one from the sort execution control means, and when an external file cannot be secured, the output method is determined by the sort environment control means. a sort output processing means that outputs data one by one to an output file secured according to file information instructing whether to The present invention is characterized in that it includes a sorting external file control means for securing the external file when necessary according to the file information, such as waiting until the external file can be secured or interrupting when the external file cannot be secured.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は、本発明の一実施例のブロック図であり、1は
入力データが格納されている入力ファイル、2は入力フ
ァイルより入力データを1件ずっ読み込んで、3のソー
ト実行部へデータを転送するソート入力処理手段、3は
2から転送されたデータをソートし、その中間結果を8
のワークファイル入出力処理手段を通して外部ワークフ
ァイルへ一旦セーブ(ここまでをプリソートと呼ぶ)し
たり、外部ワークファイルとワークメモリを使用してデ
ータをソートしていく(これをコレ−ジョンと呼ぶ)、
また、その最終結果を4のソート出力処理手段へ転送す
る(ラストパスと呼ぶ)ソート処理実行手段、4は3の
ソート処理実行手段から転送されてきたデータを5の出
力ファイルへ書き込むソート出力処理手段、6はソート
の外部ファイルやワークメモリ等の初期状態をチエツク
しソート方式を決定するソート環境制御手段、7はソー
トの外部ファイルの状況を管理し、外部ファイルの確保
ができなかった時に確保できるまで待つか中断するかを
指示しているファイル情報に従って、外部ファイルを必
要な時に確保するソート外部ファイル制御手段、8は外
部ワークファイルへの入出力を行うワークファイル入出
力処理手段、9は7のソート外部ファイル制御手段によ
って確保または予め割り当てられていた外部ワークファ
イルである。
FIG. 1 is a block diagram of an embodiment of the present invention, in which 1 is an input file in which input data is stored, 2 is an input file in which input data is read one by one, and the data is sent to a sort execution unit in 3. Sorting input processing means 3 sorts the data transferred from 2, and outputs the intermediate results to 8.
Data is temporarily saved to an external work file through the work file input/output processing means (this step is called presort), or data is sorted using the external work file and work memory (this is called collision). ,
Also, a sort processing execution means (referred to as last pass) transfers the final result to the sort output processing means 4, and a sort output processing means 4 writes the data transferred from the sort processing execution means 3 to the output file 5. , 6 is a sort environment control means that checks the initial state of external files for sorting, work memory, etc. and determines the sorting method, and 7 is a sorting environment control means that manages the status of external files for sorting and can be secured when an external file cannot be secured. 8 is a work file input/output processing means that performs input/output to an external work file; 9 is a 7 This is an external work file that has been secured or previously allocated by the external file control means.

大容量の入力データが磁気テープに格納されていて、ワ
ークメモリは、ある程度大きくは確保でき、外部ワーク
ファイルは磁気ディスクを使用し、ソート結果は磁気テ
ープに出力するという例を考える。
Consider an example in which a large amount of input data is stored on a magnetic tape, a reasonably large work memory can be secured, a magnetic disk is used for external work files, and the sort results are output to the magnetic tape.

ソート処理開始にあたり、環境として十分なワークメモ
リサイズと入力ファイルの装着を検査し、ソート方式の
決定に必要な残り情報(外部ファイルが確保できなかっ
た時のソートの処置、出力ファイルの情報)はプログラ
ムのパラメータとして入力しておく。こうして、ソート
実行の許可を6のソート環境制御手段より受領後、ソー
ト処理を開始する。
Before starting the sorting process, the environment checks whether the work memory size is sufficient and the input file is installed, and the remaining information necessary for determining the sorting method (sorting procedure when an external file cannot be secured, output file information) is Input it as a program parameter. In this manner, after receiving permission to execute the sort from the sorting environment control means 6, the sorting process is started.

入力ファイル1よりデータを3のソート処理実行手段内
へ入力する。ここでは、データを格納しながらソートし
ていく。ここが−杯になり格納できなくなった時点で、
7のソート外部ファイル制御手段がシステムから外部ワ
ークファイルの確保を行う。確保できたら7のソート処
理実行手段内のソート中間データを外部ワークファイル
ヘー旦セーブする。空いたワークメモリへ次のデータを
読み込んでソートを続ける。同じことを繰り返し、全入
力データについて入力処理を行う。
Data is input from the input file 1 into the sort processing execution means 3. Here, we will sort the data while storing it. When this becomes a cup and can no longer be stored,
The sort external file control means 7 secures an external work file from the system. Once secured, the sort intermediate data in the sort processing execution means in step 7 is saved to an external work file. Read the next data into the free work memory and continue sorting. Repeat the same process and perform input processing for all input data.

この結果、入力データは、ソートの中間結果として外部
ワークファイル9に格納される。入力ファイル1は指定
があれば、磁気テープ装置から取りはずすことができる
。外部ワークファイル9に格納されたデータを、外部ワ
ークファイルつと7のソート処理実行手段内のワークメ
モリを使用してソートを完了させる。7のソート外部フ
ァイル制御手段がシステムから出力ファイル用の磁気テ
ープ装置を確保する。確保できたら、出力用磁気テープ
を装着し、ソート結果を出力する。外部ワークファイル
の使用終了後、外部ワークファイルを解放しソートを終
了する。
As a result, the input data is stored in the external work file 9 as an intermediate result of sorting. Input file 1 can be removed from the magnetic tape device if specified. Sorting of the data stored in the external work file 9 is completed using the work memory in the sort processing execution means of the external work file 7. The sort external file control means 7 secures a magnetic tape device for output files from the system. Once secured, attach the output magnetic tape and output the sort results. After using the external work file, release the external work file and finish sorting.

〔発明の効果〕〔Effect of the invention〕

以上の説明から明らかな様に、本発明によれば、ソート
で使用する外部ファイルの割り付け状況を管理し、その
ファイル情報に従って必要な時に外部ファイルを確保す
るソート外部ファイル制御手段を設け、ソートで使用す
る時だけ外部ファイルを割り付けるので、ソートで占有
している外部ファイルの割り付け時間が少なくなり、そ
の間、他のプログラムがその資源を利用できるので、シ
ステム全体として資源を有効に利用できる効果がある。
As is clear from the above description, according to the present invention, there is provided a sort external file control means that manages the allocation status of external files used in sorting and secures external files when necessary according to the file information. Since external files are allocated only when they are used, the time taken up by sorting to allocate external files is reduced, and during this time other programs can use the resources, which has the effect of making more efficient use of resources for the system as a whole. .

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

第1図は、本発明の一実施例のブロック図である。 1・・入力ファイル、2・・・ソート入力処理手段、3
・・・ソート処理実行手段、4・・・ソート出力処理手
段、5・・・出力ファイル、6・・・ソート環境制御手
段、7・・・ソート外部ファイル制御手段、8・・・ワ
ークファイル入出力制御手段、9・・・外部ワークファ
イル。
FIG. 1 is a block diagram of one embodiment of the present invention. 1...Input file, 2...Sort input processing means, 3
...Sort processing execution means, 4.Sort output processing means, 5.Output file, 6.Sort environment control means, 7.Sort external file control means, 8.Work file input. Output control means, 9...external work file.

Claims (1)

【特許請求の範囲】[Claims] 指定パラメータ及び割り付けられた入力ファイルや出力
ファイルのファイル属性を検査し、その入出力方式を決
定するソート環境制御手段と、このソート環境制御手段
によって決定された入力方式で前記入力ファイルより1
件1件データを読み込み、全てそのデータを読み込んだ
時に前記入力ファイルを開放するソート入力処理手段と
、このソート入力処理手段により読み込まれた前記デー
タを入力してデータをソートするソート実行制御手段と
、このソート実行制御手段により並べ換えられたデータ
を1件1件前記ソート実行制御手段から受け取って前記
ソート環境制御手段によって決定された出力方式で、外
部ファイルが確保できない時に確保できるまで待つか中
断するかを指示しているファイル情報に従って確保した
出力ファイルへ1件1件データを出力するソート出力処
理手段と、前記ソート実行制御手段で使用する外部ファ
イルの割り付け状況を管理し、前記外部ファイルが確保
できない時は確保できるまで待つか中断するかの前記フ
ァイル情報に従って必要な時に前記外部ファイルを確保
するソート外部ファイル制御手段とを含んで構成される
事を特徴とするソートの外部ファイル割り付け方式。
A sorting environment control means that inspects specified parameters and file attributes of allocated input files and output files, and determines the input/output method;
sorting input processing means that reads data for one case and releases the input file when all the data is read; and sorting execution control means that inputs the data read by the sorting input processing means and sorts the data. , Receive data sorted by this sort execution control means one by one from the sort execution control means, and use the output method determined by the sort environment control means to wait until an external file can be secured or abort when an external file cannot be secured. a sort output processing means for outputting data one by one to an output file secured according to file information that instructs whether the external file is to be secured; A sorting external file allocation method comprising: a sorting external file control means for securing the external file when necessary according to the file information, such as waiting until the external file can be secured or interrupting when the external file cannot be secured.
JP63273693A 1988-10-28 1988-10-28 External file allocation system for sort Pending JPH02120931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63273693A JPH02120931A (en) 1988-10-28 1988-10-28 External file allocation system for sort

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63273693A JPH02120931A (en) 1988-10-28 1988-10-28 External file allocation system for sort

Publications (1)

Publication Number Publication Date
JPH02120931A true JPH02120931A (en) 1990-05-08

Family

ID=17531239

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63273693A Pending JPH02120931A (en) 1988-10-28 1988-10-28 External file allocation system for sort

Country Status (1)

Country Link
JP (1) JPH02120931A (en)

Similar Documents

Publication Publication Date Title
US7401335B2 (en) Single stack kernel
JPH02120931A (en) External file allocation system for sort
US7234142B1 (en) Task processing system
JPS63200257A (en) Program loading system for computer
JPH06282446A (en) Job schedule generating method
JP3456443B2 (en) Parallel sorting apparatus and recording medium recording program of the apparatus
CN117093345B (en) Task linked list execution method and device, terminal equipment and storage medium
JPS61251944A (en) Buffer area control system
JPH0376500B2 (en)
JP2957711B2 (en) Scheduling method
JPH10320201A (en) Computer system, information processing method and recording medium
JPH01258135A (en) Transaction execution control system
JPS6346861B2 (en)
JPH02127732A (en) Job control system
JPH0376499B2 (en)
JPH0311431A (en) Overlay system
JPH0689192A (en) Floating exclusive control system for online real time processing system
JPH05224941A (en) Application program control system
JPH03160547A (en) Input/output buffer control method for data processor
JPH0535444A (en) Sorting process system
JPH0376497B2 (en)
JPH02108145A (en) Transaction scheduling system
JPS63276629A (en) Sorting system for record in file
JPS63198129A (en) Input data processing system in procedure
JPH0376498B2 (en)