JPH03282841A - Direct input/output processing system for variable length record - Google Patents
Direct input/output processing system for variable length recordInfo
- Publication number
- JPH03282841A JPH03282841A JP2084146A JP8414690A JPH03282841A JP H03282841 A JPH03282841 A JP H03282841A JP 2084146 A JP2084146 A JP 2084146A JP 8414690 A JP8414690 A JP 8414690A JP H03282841 A JPH03282841 A JP H03282841A
- Authority
- JP
- Japan
- Prior art keywords
- record
- record information
- information table
- file
- output
- 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
Links
- 238000003672 processing method Methods 0.000 claims description 5
- 238000000034 method Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 4
- 238000007796 conventional method Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明はファイルの入出力処理方式に関し、特に可変長
レコードの直接入出力処理方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a file input/output processing method, and particularly to a direct input/output processing method for variable length records.
従来、直接入出力を行えるファイルはそのファイル内で
レコード長または最大レコード長が一定であった。また
、レコード長またri最犬レコード長をファイルの作成
時ま次はファイルのオープン時に指定する必要があった
。Conventionally, files that allow direct input/output have had a constant record length or maximum record length within the file. Furthermore, it was necessary to specify the record length or the longest record length when creating a file, and then when opening the file.
上述した従来の方法では、直接入出力を行おうとするフ
ァイルでは可変長レコードが扱えないという欠点がある
。The conventional method described above has the disadvantage that variable-length records cannot be handled in files to which direct input/output is intended.
また、ファイルの作成時″またはファイルのオ−ダン時
にレコード長1fcrC最大レコード長を指定しなけれ
ばならず、論理レコードの最大値を予め計算して2かな
ければならないという欠点がある。Another disadvantage is that the maximum record length of 1fcrC must be specified at the time of file creation or file download, and the maximum value of the logical record must be calculated in advance and set to 2.
さらに、指定されたレコード長または最大レコード長に
よってファイル内の全てのレコードが作成されるので、
そのレコード長よりも短い論理レコードを出力した場合
には使用しない領域ができ無駄なファイル領域を取って
しまうという欠点がある。Additionally, all records in the file are created with the specified record length or maximum record length, so
If a logical record shorter than the record length is output, there is a drawback that an unused area is created and a file area is wasted.
本発明の可変長レコードの直接入出力処理方式は、論理
レコードごとにそのレコード番号とファイル内における
その論理レコードの先頭を示すレコード位置とその論理
レコードのレコード長とその論理レコードの最大レコー
ド長とを備えたレコード情報テーブルと、入出力しよう
とする論理レコードのレコード番号を示す入出力レコー
ド番号と、前記レコード情報テーブル中の前記入出力レ
コード番号に対応するレコード位置にファイルの位置を
変更するファイル位置付は処理手段と、前記入出力レコ
ード番号と出力する論理レコードのレコード長を基にレ
コード情報テーブルを変更するレコード情報テーブル変
更手段と、ファイルに付加されているレコード情報から
前記レコード情報テーブルを作成するレコード情報テー
ブル作成手段と、前記レコード情報テーブルを入力し、
ファイルにレコード情報を付加するレコード情報付加手
段とを有する。The direct input/output processing method for variable-length records of the present invention requires that, for each logical record, the record number, the record position indicating the start of the logical record within the file, the record length of the logical record, and the maximum record length of the logical record are determined. , an input/output record number indicating the record number of the logical record to be input/output, and a file for changing the file position to the record position corresponding to the input/output record number in the record information table. The positioning is performed by a processing means, a record information table changing means for changing the record information table based on the input/output record number and the record length of the logical record to be output, and a record information table changing means for changing the record information table from the record information added to the file. inputting a record information table creation means to be created and the record information table;
and record information adding means for adding record information to the file.
次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.
第1図は本発明による可変長レコードの直接入出力処理
方式の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of a variable-length record direct input/output processing method according to the present invention.
図中、実線はデータの流れ、破線は制御の流れを示す。In the figure, solid lines indicate the flow of data, and dashed lines indicate the flow of control.
ファイルlOをオープンする場合に、レコード情報テー
ブル作成手段4が呼び出される。レコード情報テーブル
作成手段4はファイルlOに付加されているレコード位
置情報を入力し、レコード番号とそのレコード番号に対
応する論理レコードの先頭位置を示すレコード位置とそ
の論理レコードの最大レコード長とを含んだレコード情
報によって構成されるレコード情報テーブル3を作成す
る。When opening the file IO, the record information table creation means 4 is called. The record information table creation means 4 inputs the record position information added to the file IO, and includes a record number, a record position indicating the start position of the logical record corresponding to the record number, and the maximum record length of the logical record. A record information table 3 made up of record information is created.
ファイル10に対して直接入力文を実行する場合には、
プログラム11は入力しようとする論理レコードのレコ
ード番号を入出力レコード番号8に格納して直接入力処
理手段6′t−呼び出す。直接入力処理手段6はファイ
ル位置付は処理手段lを呼び出す。ファイル位置付は処
理手段lは入出力レコード番号8に対応するレコード位
置をレコード情報テーブル3から取得し、そのレコード
位置の示す位置にファイルlOのファイル位置を変更し
、直接入力処理手段6に制御を戻す。ファイル位置付は
処理手段lから制御が戻ると、直接入力処理手段6はフ
ァイルlOからレコード情報テーブル中の入出力レコー
ド番号8に対応するレコード長だけを1論理レコードと
して入力する。When executing the input statement directly on file 10,
The program 11 stores the record number of the logical record to be input into the input/output record number 8 and directly calls the input processing means 6't-. Direct input processing means 6 calls processing means 1 for file positioning. For file positioning, the processing means 1 obtains the record position corresponding to input/output record number 8 from the record information table 3, changes the file position of the file IO to the position indicated by the record position, and directly controls the input processing means 6. Return. When the file positioning control is returned from the processing means 1, the direct input processing means 6 inputs only the record length corresponding to the input/output record number 8 in the record information table from the file 10 as one logical record.
ファイル10に対して直接出力文を実行する場合には、
プログラム11は出力しようとする論理レコードのレコ
ード番号を入出力レコード番号8に格納し、レコード長
を出力レコード長9に格納し、直接出力処理手段7を呼
び出す。直接出力処理手段7にレコード情報テーブル変
更手段2を呼び出す。レコード情報テーブル変更手段2
に後述するレコード情報テーブル変更処理を行った後、
ファイル位置付は処理手段lを呼び出す。ファイル位置
付は処理手段1a入出力レコ一ド番号8に対応するレコ
ード位置をレコード情報テーブル3から取得し、そのレ
コード位置の示す位置にファイルlOのファイル位置を
変更し、レコード情゛報テーブル変更手段2に制御を戻
す。ファイル位置付は処理手段lから制御が戻ると、レ
コード情報テーブル変更手段2は直接出力処理手段7に
制御を戻す。レコード情報テーブル変更手段2から制御
が戻ると、直接出力処理手段7はファイル10へ1論理
レコードを出力する。When executing the output statement directly on file 10,
The program 11 stores the record number of the logical record to be output in the input/output record number 8, stores the record length in the output record length 9, and directly calls the output processing means 7. The record information table changing means 2 is directly called to the output processing means 7. Record information table changing means 2
After performing the record information table change process described later,
File location calls processing means l. For file positioning, the processing means 1a acquires the record position corresponding to input/output record number 8 from the record information table 3, changes the file position of the file IO to the position indicated by the record position, and changes the record information table. Control is returned to means 2. When the file positioning control is returned from the processing means 1, the record information table changing means 2 directly returns control to the output processing means 7. When control is returned from the record information table changing means 2, the direct output processing means 7 outputs one logical record to the file 10.
ファイルlOをクローズする場合には、レコード情報付
加手段5が呼び出される。レコード情報付加手段5はレ
コード情報テーブルに格納されているレコード番号とレ
コード位置とレコード長と量大レコード長とをファイル
10に付加する。When closing the file IO, the record information adding means 5 is called. The record information adding means 5 adds the record number, record position, record length, and large record length stored in the record information table to the file 10.
第2図はレコード情報テーブル3を示す説明図である。FIG. 2 is an explanatory diagram showing the record information table 3.
同図においてレコード情報(i)Dレコード情報テーブ
ル3内の第1番目のレコード情報であり、N(i)rt
L/ コ−)’番号であり、P(i)dレコード番号
N(i)の論理レコードのレコード位置であり、L(i
)はレコード番号N(i)の論理レコードのレコード長
であり、M(i)はレコード番号N(i)の論理レコー
ドの最大レコード長である。In the figure, record information (i) is the first record information in the D record information table 3, and N(i)rt
L/co)' number, P(i)d is the record position of the logical record of record number N(i), and L(i
) is the record length of the logical record with record number N(i), and M(i) is the maximum record length of the logical record with record number N(i).
レコード情報テーブル変更処理では、まず、入出力レコ
ード番号8と同じレコード番号のレコード情報をレコー
ド情報テーブル3内で検索する。In the record information table changing process, first, the record information table 3 is searched for record information having the same record number as the input/output record number 8.
同じレコード番号のレコード情報があった場合は下記(
1)の処理を行い、ない場合は下記(2)の処理を行う
。If there is record information with the same record number, please use the following (
Perform the process in 1), and if there is none, perform the process in (2) below.
(1) 入出力レコード番号8と同じレコード番号の
レコード情報が存在する。検索されたレコード情報をレ
コード情報[i)とする。そして出力レコード長9がM
(i)より小さいか等しければ、レコード情報テーブル
変更処理を終了する。(1) Record information with the same record number as input/output record number 8 exists. The retrieved record information is referred to as record information [i). And the output record length 9 is M
(i) If it is less than or equal to, the record information table change process is ended.
出力レコード長9がM(i)より大きい場合、下記の処
理(a)を行う。If the output record length 9 is greater than M(i), the following process (a) is performed.
(a) レコード情報(i)がレコード情報テーブル
3の最後のレコード情報ならば、処理(b)を行う。(a) If record information (i) is the last record information in record information table 3, process (b) is performed.
また、N (i+1 )が0でない場合およびN(i+
1)が0であってもM(i+x)が0の場合には処理(
b)を行う。Also, if N (i+1) is not 0 and N(i+
Even if 1) is 0, if M(i+x) is 0, process (
Perform b).
上記以外の場合には、出力レコード長9とM(i)+M
(i+1 )を比較する。出力レコード長9の方が小
さいか等しい場合には、M(i)にM(i)+M (i
+1 )の値を格納し、M(i+1)に0を格納し、レ
コード情報テーブル変更処理を終了する。In cases other than the above, the output record length is 9 and M(i) + M
Compare (i+1). If the output record lengths 9 are smaller or equal, then M(i) has M(i)+M(i
+1), 0 is stored in M(i+1), and the record information table changing process ends.
出力レコード長9がM(i)+M(i+1)よりも大き
い場合には、iをi+1と読みかえて処理(a)をくり
返す。ただし、出力レコード長9との比較はM(i)+
M (i+1 ) +M (i+2 ) +−−−とく
り返すごとにそのレコード情報の最大レコード長を加算
する。If the output record length 9 is larger than M(i)+M(i+1), i is read as i+1 and process (a) is repeated. However, the comparison with the output record length 9 is M(i)+
Each time M (i+1) +M (i+2) +--- is repeated, the maximum record length of the record information is added.
(b) レコード情報(i)がレコード情報テーブル
3の最初のレコード情報ならば、処理[C)を行う。(b) If record information (i) is the first record information in record information table 3, process [C] is performed.
また、N(i−1)が0でない場合およびN(i−1)
が0であってもM(i−t)が0の場合には処理(C)
を行う。Also, if N(i-1) is not 0 and N(i-1)
Even if is 0, if M(i-t) is 0, process (C)
I do.
上記以外の場合、処理(a)をレコード情報(j)まで
くり返したとすると、出力レコード長9とM(i−1)
+M(i)+M(i+1)+−−−+Mす)を比較し、
出力レコード長9の方が小さいか等しい場合には、M(
i)にM(i−1) +M(i)+M(i+1)+−−
−+M(j)を格納し、M(1−1)、M(i+t)、
−−−、M(j)に0を格納し、レコード情報テーブル
変更処理を終了する。In cases other than the above, if processing (a) is repeated until record information (j), the output record length is 9 and M(i-1)
+M(i)+M(i+1)+----+Msu),
If the output record length 9 is smaller or equal, then M(
i) to M(i-1) +M(i)+M(i+1)+--
−+M(j), M(1-1), M(i+t),
---, stores 0 in M(j), and ends the record information table change process.
出力レコード長9の方が大きい場合には、iをi−1と
読みかえて処理(b)をくり返す。If the output record length 9 is larger, i is read as i-1 and the process (b) is repeated.
ただし、出力レコード長9との比較は処理(a)と詞様
に、くり返すごとにそのレコード情報の最大レコード長
を加算する。However, for comparison with the output record length 9, the maximum record length of the record information is added each time it is repeated, as in process (a).
(c) N(i)に0を格納する。処理(b)をレコ
ード情報(h)1でくり返したとすれば、レコード情報
(h)からレコード情報(j)4でのレコード情報を除
外して下記(2)の処理を行う。(c) Store 0 in N(i). If processing (b) is repeated using record information (h) 1, the following processing (2) is performed by excluding the record information (j) 4 from record information (h).
(2)入出力レコード番号8と同じレコード番号のレコ
ード情報がない。レコード情報テーブル3内でN(i)
がOでかつM(i)が0でないレコード情報(i)を検
索する。レコード情報(i)が見つかった場合には、N
(i)=入出力レコード番号8と考えて(1)の処理を
行う。(2) There is no record information with the same record number as input/output record number 8. N(i) in record information table 3
Search for record information (i) where is O and M(i) is not 0. If record information (i) is found, N
Considering (i)=input/output record number 8, process (1) is performed.
上記レコード情報(i)が見つからない場合には、レコ
ード情報テーブル3に新たにレコード情報(n+t)を
追加し、N(n+1)には入出力レコード番号8を格納
し、P (n−)−1)にはその時点でのファイルの終
了位置を格納し、L(n+1)およびM(n+1)には
出力レコード長9を格納し、レコード情報テーブル変更
処理を終了する。If the above record information (i) is not found, new record information (n+t) is added to the record information table 3, input/output record number 8 is stored in N(n+1), and P (n-)- 1) stores the end position of the file at that time, stores the output record length 9 in L(n+1) and M(n+1), and ends the record information table changing process.
以上説明したように本発明によれば可変長レコードを対
象にして直接入出力が行えるという効果がある。また、
ファイルの作成時やオープン時にレコード長または最大
レコード長を指定する必要かないため、論理レコードの
最大長を予め計算しなくてもよいという効果がある。As explained above, according to the present invention, there is an effect that direct input/output can be performed for variable length records. Also,
Since there is no need to specify the record length or maximum record length when creating or opening a file, there is an advantage that there is no need to calculate the maximum length of a logical record in advance.
さらに、論理レコードを出力する場合には出力するレコ
ード長だけのファイル領域があればよいため、無駄なフ
ァイル領域を必要としないという効果がある。Furthermore, when outputting a logical record, it is sufficient to have a file area equal to the length of the record to be output, so there is an effect that no wasted file area is required.
第1図は本発明の一実施例を示すブロック図、第2図は
レコード情報テーブルを示す説明図である。
1・・・・・・ファイル位置付は処理手段、2・・・・
・・レコード情報テーブル変更手段、3・・・・・・レ
コード情報テーブル、4・・・・・・レコード情報テー
ブル作成手段、5・・・・−・レコード情報付加手段、
8・・・・・・入出力レコード番号。FIG. 1 is a block diagram showing an embodiment of the present invention, and FIG. 2 is an explanatory diagram showing a record information table. 1...File positioning is a processing means, 2...
...Record information table changing means, 3...Record information table, 4...Record information table creation means, 5...Record information adding means,
8...Input/output record number.
Claims (1)
けるその論理レコードの先頭を示すレコード位置とその
論理レコードのレコード長とその論理レコードの最大レ
コード長とを備えたレコード情報テーブルと、入出力し
ようとする論理レコードのレコード番号を示す入出力レ
コード番号と、前記レコード情報テーブル中の前記入出
力レコード番号に対応するレコード位置にファイルの位
置を変更するファイル位置付け処理手段と、前記入出力
レコード番号と出力する論理レコードのレコード長を基
にレコード情報テーブルを変更するレコード情報テーブ
ル変更手段と、ファイルに付加されているレコード情報
から前記レコード情報テーブルを作成するレコード情報
テーブル作成手段と、前記レコード情報テーブルを入力
し、ファイルにレコード情報を付加するレコード情報付
加手段とを有することを特徴とする可変長レコードの直
接入出力処理方式。A record information table containing, for each logical record, the record number, the record position indicating the start of the logical record in the file, the record length of the logical record, and the maximum record length of the logical record, and the logical record to be input/output. an input/output record number indicating a record number of a record; a file positioning means for changing the position of the file to a record position corresponding to the input/output record number in the record information table; and logic for outputting the input/output record number. A record information table changing means for changing a record information table based on the record length of a record, a record information table creating means for creating the record information table from record information added to a file, and a record information table creating means for inputting the record information table. 1. A direct input/output processing method for variable length records, comprising: a record information adding means for adding record information to a file.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2084146A JPH03282841A (en) | 1990-03-30 | 1990-03-30 | Direct input/output processing system for variable length record |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2084146A JPH03282841A (en) | 1990-03-30 | 1990-03-30 | Direct input/output processing system for variable length record |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03282841A true JPH03282841A (en) | 1991-12-13 |
Family
ID=13822360
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2084146A Pending JPH03282841A (en) | 1990-03-30 | 1990-03-30 | Direct input/output processing system for variable length record |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03282841A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05181719A (en) * | 1991-12-27 | 1993-07-23 | Nippon Steel Corp | Variable length data storage and reference system |
| JP2000076276A (en) * | 1998-08-31 | 2000-03-14 | Canon Inc | Image storage method and apparatus |
-
1990
- 1990-03-30 JP JP2084146A patent/JPH03282841A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05181719A (en) * | 1991-12-27 | 1993-07-23 | Nippon Steel Corp | Variable length data storage and reference system |
| JP2000076276A (en) * | 1998-08-31 | 2000-03-14 | Canon Inc | Image storage method and apparatus |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH03266039A (en) | Free format data link processing system | |
| JPH03282841A (en) | Direct input/output processing system for variable length record | |
| JP3169596B2 (en) | Database management device | |
| JP4056622B2 (en) | Database management device | |
| JP2722684B2 (en) | File system search device | |
| JPS5846439A (en) | Program editing method of computer | |
| JPH06274328A (en) | Execution method for program consisting of plural processing modules | |
| JPH0554082A (en) | Data base system | |
| JP3008483B2 (en) | Link processing device | |
| JPH0350594A (en) | Display system for large-amount data | |
| JPH0196732A (en) | Macro expansion list output method | |
| JPH04168569A (en) | Generation managing system for document file | |
| JPH02263265A (en) | Tabulation processor | |
| JPS62216037A (en) | Message managing system using source library | |
| JPH04139571A (en) | Document processor | |
| JPH0962553A (en) | Journal output system | |
| JPH0744446A (en) | How to associate grouping information | |
| JPH0816448A (en) | Data deleting method for data group | |
| JPH0477333B2 (en) | ||
| JPH03231340A (en) | File input/output method | |
| JPH04303244A (en) | File arranging system | |
| JPH0319086A (en) | State transition table converter | |
| JPH0245877A (en) | System for editing tree structure | |
| JPH0619759A (en) | History information editing processing system for text editor | |
| JPH045736A (en) | Information processor |