JPH01220036A - File retrieving system - Google Patents

File retrieving system

Info

Publication number
JPH01220036A
JPH01220036A JP63046517A JP4651788A JPH01220036A JP H01220036 A JPH01220036 A JP H01220036A JP 63046517 A JP63046517 A JP 63046517A JP 4651788 A JP4651788 A JP 4651788A JP H01220036 A JPH01220036 A JP H01220036A
Authority
JP
Japan
Prior art keywords
record
file
key
application program
library
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
JP63046517A
Other languages
Japanese (ja)
Inventor
Hiroshi Yamada
浩志 山田
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 JP63046517A priority Critical patent/JPH01220036A/en
Publication of JPH01220036A publication Critical patent/JPH01220036A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To retrieve a file from the position of a minimum key or a maximum key only with a simple coding by allowing an application program not to be conscious of a key value by retrieving the file from a record where positioning is performed by a specific library. CONSTITUTION:The title system is equipped with a library 2 to find the record having the minimum key or the maximum key in the file and to perform the positioning to this based on the head designation or the last designation of the file from an application program 1. The file can be retrieved from the record where the positioning is performed by the library 2. Thus, the positioning is performed to the record having the minimum key or the maximum key and the file can be retrieved corresponding to the leading designation or the last designation by allowing the application program 1 not to be conscious of the key value.

Description

【発明の詳細な説明】 〔概要〕 索引ファイルをキーを用いて検索するファイル検索方式
に関し、 応用プログラムがキー値を意識することなく、先頭指定
あるいは最後指定に対応して、最小キーあるいは最大キ
ーを持つレコードに自動的に位置づけてファイルを検索
することを目的とし、応用プログラムからのファイルの
先頭指定あるいは最後指定に基づいて、最小キーあるい
は最大キーを持つファイル中のレコードを見つけ、これ
に位置づけるライブラリを備え、このライブラリによっ
て位置づけられたレコードからファイルを検索し得るよ
うに構成する。
[Detailed Description of the Invention] [Summary] Regarding a file search method that searches an indexed file using a key, an application program can search for the minimum key or maximum key in response to the first or last specification without being aware of the key value. The purpose of this method is to automatically locate the record in the file that has the minimum key or maximum key and locate the record in the file based on the beginning or end specification of the file from the application program. A library is provided and the file is configured to be searchable from records located by the library.

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

本発明は、索引ファイルをキーを用いて検索するファイ
ル検索方式に関するものである。
The present invention relates to a file search method for searching index files using keys.

〔従来の技術と発明が解決しようとする問題点〕従来、
索引ファイル例えばC0BOLにおける索引ファイルに
おいて、ファイル処理中にファイルの先頭レコードへ位
置付けるためには、そのレコードのキーを指定して位置
付けしなければならなかった、このため、ファイル中の
先頭レコード(最後レコード)に位置付けて昇順(降順
)に検索しようとする場合、先頭レコード(最後レコー
ド)のキーをC0BOLを用いて記述した応用プログラ
ム中で認識して記述する必要があり、プログラムによる
処理が煩雑となってしまい、コーディングが面倒である
という問題点があった。
[Problems to be solved by conventional technology and invention] Conventionally,
Index file For example, in an index file in C0BOL, in order to position to the first record of the file during file processing, it was necessary to specify the key of that record. ) and search in ascending (descending) order, it is necessary to recognize and write the key of the first record (last record) in an application program written using C0BOL, which makes the processing by the program complicated. The problem was that the coding was troublesome.

本発明は、応用プログラムがキー値を意識することなく
、先頭指定あるいは最後指定に対応して、最小キーある
いは最大キーを持つレコードに自動的に位置づけてファ
イルを検索することを目的としている。
An object of the present invention is for an application program to search a file by automatically locating the record having the minimum key or maximum key in accordance with the beginning designation or the end designation, without being aware of the key value.

〔問題点を解決するための手段〕[Means for solving problems]

第1図を参照して問題点を解決するための手段を説明す
る。
Means for solving the problem will be explained with reference to FIG.

第1図において、応用プログラムlは、ファイル検索な
どを行うプログラムである。
In FIG. 1, an application program l is a program that performs file searches and the like.

ライブラリ2は、先頭指定あるいは最後指定に対応して
、最小キーあるいは最大キーを持つレコードに位置付け
るものである。
The library 2 positions records with the minimum key or maximum key in accordance with the first or last designation.

〔作用〕 本発明は、第1図に示すように、応用プログラムlから
の先頭指定あるいは最後指定に対応して、ライブラリ2
がファイルを検索して最小キーあるいは最大キーを持つ
レコードに位置付けるようにしている。
[Operation] As shown in FIG.
searches the file and locates the record with the lowest or highest key.

従って、応用プログラムlはキー値を意識することな(
、先頭指定あるいは最後指定という簡単なコーディング
のみにより、ライブラリ2によって自動的にそのキーの
レコードに位置付けられ、この位置から昇順あるいは降
順などの態様で順次検索することが可能となる。
Therefore, the application program l does not need to be aware of the key value (
, by simply specifying the beginning or the end, the library 2 automatically positions the record of that key, and it becomes possible to sequentially search from this position in ascending or descending order.

〔実施例〕〔Example〕

次に、第1図および第2図を用いて本発明の1実施例の
構成および動作を順次詳細に説明する。
Next, the configuration and operation of one embodiment of the present invention will be explained in detail using FIGS. 1 and 2.

第1図において、図中[F]は、本実施例に係わる先頭
レコードへの位置っけのためのコーディング5TART
 FILEI FIR5T、”を示す、応用プログラム
l中でこの簡単な記述のコーディングを行うことにより
、ライブラリ2が自動的に図中■、■、■の処理によっ
て最小キーを持つレコードをファイル(ファイルl 、
 FILf!1)中から見つけ出し、このレコードに位
置付けるようにしている。
In FIG. 1, [F] is the coding 5TART for positioning to the first record according to this embodiment.
By coding this simple description in the application program ``FILEI FIR5T,'' the library 2 automatically saves the record with the minimum key to a file (File 1,
FILf! 1) I try to find it from among them and position it in this record.

図中■は、最小物理アドレスをもつレコードを求める。■ in the figure searches for the record with the minimum physical address.

これは、例えば第2図(ロ)に示すファイル(FILI
!1)から最小物理アドレス“100“をもつレコード
Dを検索して見つけることを意味している。
This is, for example, the file (FILI) shown in Figure 2 (b).
! This means that the record D having the minimum physical address "100" is searched and found from 1).

図中■は、物理アドレス順に、最小のレコードキーを持
つレコードを見つける。これは、第2図(ロ)ファイル
を物理アドレスの小さい方から大きい方に向かってレコ
ードのキー領域(Kf!Yl)に格納されているレコー
ドキーの値を順次読み出し、最小のレコードキーを持つ
レコード、例えば最小レコードキー“10”を持つレコ
ードAを見つけることを意味している。
■ in the figure finds the record with the smallest record key in the order of physical addresses. This is done by sequentially reading out the record key values stored in the record key area (Kf!Yl) from the file in Figure 2 (b) from the smaller physical address to the larger one, and selecting the one with the smallest record key. This means finding a record, for example, record A with the minimum record key "10".

図中■は、最小レコードキーに位置付ける。これは、図
中■で見つけた最小レコードキー“10゛を持つレコー
ドAに位置付けることを意味している。
■ in the figure is positioned at the minimum record key. This means that the record A with the minimum record key "10" found at ■ in the figure is positioned.

以上の処理によって、応用プログラム1が単に5TAR
T FILEI FIR5T、”という簡単なコーディ
ングを行うことにより、ライブラリ2が最小キーを持つ
レコードに位置づけるようにしている。そして、図中■
で応用プログラムlがその位置づけられた最小レコード
キーのレコード、即ちファイルの先頭から処理例えば昇
順に検索処理を行うことが可能となる。
By the above processing, application program 1 is simply 5TAR.
By performing a simple coding such as "T FILEI FIR5T," library 2 is positioned at the record with the minimum key.
This allows the application program I to perform processing, for example, search processing in ascending order from the record with the positioned minimum record key, that is, from the beginning of the file.

また、上記例は、5TART FILII!I FIR
5T、”という先頭指定のコーディングに対応して、ラ
イブラリ2が最小キーを持つレコードに位置付け、応用
プログラムlがこの位置からファイルを検索(例えば昇
順に検索)するようにしていたが、5TARTFILE
I LAST、’ という最後指定のコーディングに対
応して、ライブラリ2が最大キーを持つレコードに位置
付け、応用プログラム1がこの位置から検索(例えば降
順に検索)するようにしてもよい。
Also, the above example is 5TART FILII! I FIR
5T,", library 2 positions the record with the smallest key, and the application program 1 searches for files from this position (for example, in ascending order), but 5TARTFILE
In response to the last designated coding I LAST,', the library 2 may position the record with the largest key, and the application program 1 may search from this position (for example, search in descending order).

尚、第1図に記述した動作を以下簡単に説明する。図中
■、■、■、■、■、■、■、■の処理は、ファイル中
の特定のキー例えば”20″を持つレコードが複数存在
する場合に、ライブラリ2がこれら複数のレコードを識
別するための識別子として物理アドレスを付与して応用
プログラム1に通知して、当該応用プログラム1が各レ
コードを識別するための手順を記述したものである。
The operation described in FIG. 1 will be briefly explained below. The processes indicated by ■, ■, ■, ■, ■, ■, ■, ■ in the figure are performed when there are multiple records with a specific key such as "20" in the file, and the library 2 identifies these multiple records. This describes a procedure for the application program 1 to identify each record by assigning a physical address as an identifier to the application program 1 and notifying the application program 1 of the physical address.

図中■は、ファイル1をオーブンする。■ in the figure ovens file 1.

図中■は、図中■の記述に対応して、C0BOLライブ
ラリ2がレコードキー20に位置付ける。
■ in the figure corresponds to the description of ■ in the figure, and the C0BOL library 2 positions the record key 20.

図中Oは、応用プログラム1がREAD FILEl、
”を発行する。
O in the figure indicates that the application program 1 is READ FILEl,
” is issued.

図中■は、C0BOLライブラリ2が例えば第2図(イ
)ファイル(FIELI)から、レコードキー20を持
つレコード(例えば先頭から検索して最初に見つかった
レコードであるレコード=B)を読み込む、このとき、
応用プログラムlに対して、当該レコードBを認識させ
るため、P−PTR(PO5ITIONING POI
NTER)のデータ項目の物理アドレス=200をレコ
ードとともに通知する。
■ in the figure indicates that the C0BOL library 2 reads a record with record key 20 (for example, record = B, which is the first record found by searching from the beginning) from the file (FIELI) in Figure 2 (A). When,
In order to make the application program l recognize the record B, P-PTR (PO5ITIONING POI
The physical address of the data item (NTER) = 200 is notified along with the record.

図中■は、P−PTRからレコード=200なので、応
用プログラムlがレコードBとして認識し、このレコー
ドBに対応する処理を行う。
In the figure, since the record = 200 from the P-PTR, the application program 1 recognizes it as record B and performs processing corresponding to this record B.

図中■は、応用プログラム1が、図中Oと同様に、RE
AD FILEl、”を発行する。
■ in the figure indicates that application program 1 is RE
AD FILEl,” is issued.

図中■は、C0BOLライブラリ2が第2図(イ)ファ
イルから、レコードキー20を持つ次のレコード(例え
ば先頭から検索して第2番目に見つかったレコードであ
るレコード=C)を読み込む。このとき、応用プログラ
ム1に対して、当該レコードCを認識させるため、P−
PTHのデータ項目の物理アドレス=300をレコード
とともに通知する。
In the figure, the C0BOL library 2 reads the next record having the record key 20 (for example, record = C, which is the second record found after searching from the beginning) from the file in FIG. 2 (A). At this time, in order to make the application program 1 recognize the record C, P-
The physical address of the PTH data item = 300 is notified along with the record.

図中■は、P−PTRからレコード−300なので、応
用プログラムlがレコードCとして認識し、このレコー
ドCに対応する処理を行う。
Since ■ in the figure is record -300 from the P-PTR, the application program I recognizes it as record C and performs processing corresponding to this record C.

第2図(イ)は、論理的なファイルの見え方を模式的に
示したものである。これは、レコードのキー領域に格納
されたレコードキーの小さい順に上から下に向かってレ
コードA、BSC,Dを並べたものである。ここで、物
理アドレスは、外部記憶装置(DASDなど)に設けら
れたファイル(第1図FD FILEl、・・・1で定
義されたファイルFILEI)のレコードの物理アドレ
スを示す。キー領域(KEYI)は、第1図定義(02
KEYI PICX(2)、”)によって定義された領
域を示す、データ領域(FILLER)は、第1図定義
(02FILLEI? PIC9(8)、’)によって
定義された領域を示す。
FIG. 2(A) schematically shows how a logical file looks. In this example, records A, BSC, and D are arranged from top to bottom in descending order of record keys stored in the record key area. Here, the physical address indicates the physical address of a record of a file (file FILEI defined in FIG. 1 FD FILE1, . . . 1) provided in an external storage device (such as DASD). The key area (KEYI) is defined in Figure 1 (02
The data area (FILLER) indicates the area defined by KEYI PICX(2),''), and the data area (FILLER) indicates the area defined by the FIG. 1 definition (02FILLEI? PIC9(8),').

第2図(ロ)は、物理的なファイルの見え方を模式的に
示したものである。これは、第2図(イ)のレコードを
、物理アドレスの小さい順に上から下に向かってレコー
ドD、B、C,Aに並べたものである。
FIG. 2(b) schematically shows how a physical file looks. In this example, the records shown in FIG. 2(a) are arranged in records D, B, C, and A in descending order of physical address from top to bottom.

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

以上説明したように、本発明によれば、応用プログラム
1からの先頭指定あるいは最後指定に対応して、ライブ
ラリ2がファイルを検索して最小キーあるいは最大キー
を持つレコードに位置付ける構成を採用しているため、
応用プログラムlはキー値を意識することなく、先頭指
定あるいは最後指定という簡単なコーディングのみによ
り、最小キーあるいは最大キーの位置からファイルを検
索することが可能となる。
As explained above, according to the present invention, the library 2 searches for a file and positions it in the record having the minimum key or maximum key in response to the beginning designation or end designation from the application program 1. Because there are
The application program I can search for a file from the position of the minimum key or maximum key without being aware of the key value, just by simple coding such as specifying the beginning or end.

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

第1図は本発明の1実施例の構成および動作説明図、第
2図は本発明に係わるファイルの形式例を示す。 図中、1は応用プログラム、2はライブラリを表す。
FIG. 1 is an explanatory diagram of the configuration and operation of an embodiment of the present invention, and FIG. 2 shows an example of a file format according to the present invention. In the figure, 1 represents an application program and 2 represents a library.

Claims (1)

【特許請求の範囲】 索引ファイルをキーを用いて検索するファイル検索方式
において、 応用プログラム(1)からのファイルの先頭指定あるい
は最後指定に基づいて、最小キーあるいは最大キーを持
つファイル中のレコードを見つけ、これに位置づけるラ
イブラリ(2)を備え、 このライブラリ(2)によって位置づけられたレコード
からファイルを検索し得るように構成したことを特徴と
するファイル検索方式。
[Claims] In a file search method that searches an indexed file using a key, a record in the file having the minimum key or maximum key is searched based on the beginning or end designation of the file from the application program (1). A file search method comprising a library (2) for finding and positioning files, and configured to search for files from records located by this library (2).
JP63046517A 1988-02-29 1988-02-29 File retrieving system Pending JPH01220036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63046517A JPH01220036A (en) 1988-02-29 1988-02-29 File retrieving system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63046517A JPH01220036A (en) 1988-02-29 1988-02-29 File retrieving system

Publications (1)

Publication Number Publication Date
JPH01220036A true JPH01220036A (en) 1989-09-01

Family

ID=12749465

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63046517A Pending JPH01220036A (en) 1988-02-29 1988-02-29 File retrieving system

Country Status (1)

Country Link
JP (1) JPH01220036A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6017390A (en) * 1983-07-11 1985-01-29 Casio Comput Co Ltd Electronic clock
JPS60202378A (en) * 1984-03-27 1985-10-12 Seiko Epson Corp Electronic timepiece
JPS61127489U (en) * 1985-01-29 1986-08-09
JPS6329291A (en) * 1986-07-10 1988-02-06 イ−エム・マイクロエレクトロニツク−マリン・エスア− Programming device for electric type rewritable nonvolatile memory for clock

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6017390A (en) * 1983-07-11 1985-01-29 Casio Comput Co Ltd Electronic clock
JPS60202378A (en) * 1984-03-27 1985-10-12 Seiko Epson Corp Electronic timepiece
JPS61127489U (en) * 1985-01-29 1986-08-09
JPS6329291A (en) * 1986-07-10 1988-02-06 イ−エム・マイクロエレクトロニツク−マリン・エスア− Programming device for electric type rewritable nonvolatile memory for clock

Similar Documents

Publication Publication Date Title
JP2770855B2 (en) Digital information storage and retrieval method and apparatus
US4633391A (en) Extended index for digital information storage and retrieval device
CN115809268B (en) Adaptive query method and device based on fragment index
JPH01220036A (en) File retrieving system
JPH06215037A (en) Automatic updating device for index
JP4785749B2 (en) Method and apparatus for searching a database in two search steps
JP3544829B2 (en) Information storage and retrieval device and information storage and retrieval method
EP0394172A2 (en) Method of performing file services given partial file names
JP3260706B2 (en) A search system that searches for files stored on the hard disk of a personal computer
JP5936465B2 (en) Multiple database automatic search device
JPH04140825A (en) Optical disk device access system
JPS6182232A (en) Information registering and retrieving system
JPH03174654A (en) Filing method and its device
JPH10240744A (en) System for processing retrieval of range division chart and method therefor and recording medium for recording retrieval processing program
JP3019104B2 (en) File processing device
JP2002259450A (en) Writing method for related documentation with keyword of folder name, and recording medium with procedure of the method recorded thereon
JPH01220035A (en) Duplicate key record identifying system
JPH06275023A (en) Information recorder
JPH0644300A (en) Information retrieving device
JPH0233786A (en) Optical disk device
JPH05233386A (en) Data base management system
JPH02181268A (en) File retrieving system
JPH05100919A (en) Dump data file managing system
JPH01209545A (en) Data processor
JPH03210667A (en) Access method to information having same key