JPS6316330A - String converting system - Google Patents

String converting system

Info

Publication number
JPS6316330A
JPS6316330A JP16115186A JP16115186A JPS6316330A JP S6316330 A JPS6316330 A JP S6316330A JP 16115186 A JP16115186 A JP 16115186A JP 16115186 A JP16115186 A JP 16115186A JP S6316330 A JPS6316330 A JP S6316330A
Authority
JP
Japan
Prior art keywords
data
code
inverted
bit
sorting
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
JP16115186A
Other languages
Japanese (ja)
Inventor
Misako Hirata
平田 美佐子
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
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP16115186A priority Critical patent/JPS6316330A/en
Publication of JPS6316330A publication Critical patent/JPS6316330A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

PURPOSE:To facilitate an easy sorting job by shifting a pack code to a higher bit in a packed mode, taking off a code when a positive code already exists, then inverting the bit with a negative code. CONSTITUTION:The attribute of data is detected (step 10) and a right shift is carried out (step 11) to change the lowest code into the highest one in a packed decimal mode. A code is saved (step 12) and erased (step 13). If a code is negative, the data are inverted (steps 14 and 15). The data are sent as they are as long as a sorting indication is ascending; while the data bit is inverted if the sorting indication is descending (steps 16 and 17). These data are operated ascendingly to perform both ascending and descending sorting actions. When it is decided that the input data is not decimal (step 10), the bit is inverted in a descending mode and an ascending operation is carried out.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は電子計算機システムにおけろデータのソート処
理に関し、特に高速ソートを実現するためのソートキー
生成におけるストリング変換方式〔従来の技術〕 従来、この種のソート処理では、そのソートキーとなる
フィールドの属性、つまり、数値フィールドなのか数値
フィールドであればそれは符号材なのかというような性
質、あるいは昇順、降順といった並びかえの手順によっ
て複雑な論理処理、あるいは変換処理を行っていた。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to data sorting processing in a computer system, and in particular to a string conversion method for generating sort keys to achieve high-speed sorting [Prior Art] Conventionally, This type of sorting requires complex logical processing based on the attributes of the field that serves as the sort key, such as whether it is a numeric field or whether it is a code material if it is a numeric field, or the sorting procedure such as ascending or descending order. , or was performing a conversion process.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述のように従来の方式では処理が複雑となっているの
で、ソート機能の高速性が損なわれるという欠点がある
As described above, the conventional method requires complicated processing, and therefore has the disadvantage that the speed of the sorting function is impaired.

本発明の目的は、このような欠点を解決し、高速にソー
ト処理をできるようにしたストリンク変換方式を提供す
ることにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a string transformation method that solves these drawbacks and enables high-speed sort processing.

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

本発明のストリング変換方式の横或は、入力データを属
性検出手段により10進数が否かを検出し、その入力デ
ータが10進数の場合はバ・ツクされているか否か分検
出し、その入力データがパックされた10進数の場合は
そのデータビットを所定数シフトし、シフトされたパッ
クド10進数あるいは前記パックされていない10進数
の符号を判定し、この符号が負の場合はそのデータビッ
トを反転し、この反転されたデータあるいは前記符号が
正のデータあるいは前記10進数でない場合のデータを
手順指示手段により昇順が降順かを検出し、その手順が
降順の場合にはそのデータビットを反転し、その手順が
昇順の場合にはそのままデータを出力することを特徴と
する。
Alternatively, in the string conversion method of the present invention, the attribute detection means detects whether the input data is a decimal number or not, and if the input data is a decimal number, it is detected whether it is backed up or not. If the data is a packed decimal number, shift the data bits by a predetermined number, determine the sign of the shifted packed decimal number or the unpacked decimal number, and if this sign is negative, shift the data bits by a predetermined number. The inverted data or the data when the sign is positive or the decimal number is detected by the procedure indicating means to determine whether the ascending order is descending order, and if the procedure is descending order, the data bits are inverted. , if the procedure is in ascending order, the data is output as is.

〔実施例〕〔Example〕

次に、本発明を図面により詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図は本発明の一実施例の動作手順を示した流れ図で
ある。本実施例は、ステップ1oに属性検出手段、ステ
ップ15.17にビット反転手段、ステップ16に手順
指示手段を用いている。
FIG. 1 is a flowchart showing the operating procedure of an embodiment of the present invention. In this embodiment, an attribute detection means is used in step 1o, a bit inversion means is used in steps 15 and 17, and a procedure instruction means is used in step 16.

まず、データが入力されると、ステ・ツブ10て′属性
検出手段によりデータの属性をチェックし、入力データ
が10進数ならば符号に関する処理を行い、10進数以
外ならば何もせずにステップ16の手順指示手段の処理
に進む。
First, when data is input, the attribute of the data is checked by the attribute detection means in the step 10, and if the input data is a decimal number, processing related to the sign is performed, and if the input data is not a decimal number, nothing is done and step 16 The process proceeds to the procedure instruction means.

入力データが10進数の場合、このデータがパック(p
ack)か、アンパック(unpack)かを調べ、パ
ックの場合ステップ11でビ・シトシフトを行ってから
符号処理な行う。ステ・ツブ12で符号を退避させてス
テップ13で符号を消去しステップ14でその符号の正
負を判定する。この符号が負であれば、ステップ15の
ビット反転手段によりそのデータビットを反転させ、ス
テップ16の手順指示手段の処理を行う。
If the input data is a decimal number, this data is packed (p
ack) or unpack, and if it is packed, Bi-Cit shift is performed in step 11, and then code processing is performed. In step 12, the code is saved, in step 13, the code is erased, and in step 14, the sign is determined. If this sign is negative, the data bit is inverted by the bit inverting means in step 15, and the processing by the procedure instruction means in step 16 is performed.

ステップ16では、手順指示手段によりデータのソート
手順が降順ならばステップ17のビット反転手段でその
データビットを反転させ、昇順ならばそのまま処理を終
了させる。このようにして変換された二進文字列を用い
たソート処理が行われる。
In step 16, if the data sorting procedure is in descending order by the procedure instructing means, the bit inverting means in step 17 inverts the data bits, and if it is in ascending order, the process is directly terminated. Sorting processing is performed using the binary character strings thus converted.

次に、本実施例を具体例について説明する。Next, a specific example of this embodiment will be explained.

第2図は本実施例がアンパックド10進数で昇順に並べ
る処理の場合の流れ図、第3図(a)。
FIG. 2 is a flowchart in the case where the present embodiment arranges unpacked decimal numbers in ascending order, and FIG. 3(a).

(b)は第2図で入力データr+123J 、第3図(
c)〜(e)は入力データが「−123Jを設定した時
のデータ配置図である。第2図の流れ図の実線に従って
処理を行なうと、入力データがr+123Jの場合(第
3図(a)、rFIF2C3)IJ)−まず、ステップ
10で属性検出手段によりアンパックド10進数である
ことを検出すると、ステップ12で符号を退避させた後
、ステップ13でその符号を消去する(第3図(b)、
’PIF2F3HJ )。次に、ステップ14で退避さ
せた符号から符号を判断し、この場合「正」であるから
、ステ・ツブ16でそのまま手順指示手段により昇順で
あることを指示し処理を抜ける。
(b) is the input data r+123J in Figure 2, and Figure 3 (
c) to (e) are data arrangement diagrams when the input data is set to -123J.If the processing is performed according to the solid line in the flowchart in Figure 2, when the input data is r+123J (Figure 3 (a) , rFIF2C3)IJ) - First, when the attribute detection means detects that it is an unpacked decimal number in step 10, the code is saved in step 12, and then the code is erased in step 13 (Fig. 3(b) ),
'PIF2F3HJ). Next, the code is judged from the saved code in step 14, and since it is "correct" in this case, in step 16, the procedure instruction means directs ascending order, and the process exits.

また、入力データがr−123,の場合(第3図(c)
、’FIF2D3HJ)、r +i 23 」の時と同
様に、属性検出手段によりアンバ・ソクド10進数を検
出し、符号を退避させたのち、符号を消去しく第3図(
d)、’P I F2F3H」)、退避させた符号から
符号を判断する。この場合「負」であるから、ステップ
15でビット反転手段によってデータビットを反転させ
(第3図(e)、  「0EODOC)! J ) 、
ステップ16の手順指示手段により昇順であることを検
出し処理を抜ける。これらの変換された二進文字列を見
てみると、符号を意識せずに単純に昇順に並べるだけで
処理できることがわかる。
In addition, when the input data is r-123 (Fig. 3(c)
, 'FIF2D3HJ), r +i 23'', the attribute detection means detects the amba-sokudo decimal number, saves the code, and erases the code.
d), 'P I F2F3H'), the code is determined from the saved code. In this case, it is "negative", so in step 15, the data bit is inverted by the bit inverting means (FIG. 3(e), "0EODOC"!J),
The procedure instruction means in step 16 detects that the order is ascending and exits the process. If we look at these converted binary strings, we can see that they can be processed simply by arranging them in ascending order without being aware of the sign.

また、第4図は本実施例入力データがパ・ソクド10進
数で降順に並べる処理の流れ図、第5図(a)〜(d)
は入力データがr+1234、第5図(e)〜(i)は
入力データが’−1234を設定した時のデータ配置図
である。
In addition, FIG. 4 is a flowchart of the process of arranging the input data of this embodiment in descending order in Pa-Sokdo decimal numbers, and FIGS. 5(a) to (d)
is a data arrangement diagram when the input data is set to r+1234, and FIGS. 5(e) to (i) are data arrangement diagrams when the input data is set to '-1234.

第4図の流れ図の実線に従って処理を行なうと、入力デ
ータが「+123」の場合(第5図(a)’123CH
J >、まず、ステーツブlOで属性検出手段によりバ
・ソクド1Φ進数を検出するので、ステップ11でデー
タビットを右に4ビツトシフトする(第5図(b)’C
l23HJ )。
When processing is performed according to the solid line in the flowchart in Figure 4, if the input data is "+123" (Figure 5 (a) '123CH
First, in state lO, the attribute detection means detects the base 1Φ number, so in step 11 the data bits are shifted to the right by 4 bits (Fig. 5(b)'C
l23HJ).

次に、ステップ12で符号を退避させたのち符号を消去
しく第5図(C)’F123HJ >、退避させた符号
から符号を判断する(ステップ14)。この場合「正」
であるから、ステップ16でそのまま手順指示手段によ
り降順であることを指示し、ステップ17でビット反転
手段によりデータビットを反転させ(第5図(d)’0
EDCu J )、処理を抜ける。
Next, after saving the code in step 12, the code is erased (FIG. 5C)'F123HJ>, and the code is determined from the saved code (step 14). In this case "correct"
Therefore, in step 16, the procedure instruction means directs descending order, and in step 17, the bit inversion means inverts the data bits (Fig. 5(d) '0').
EDCu J), exit the process.

また、入力データが「−123Jの場合(第5図(e)
’123D)l J )、「+123Jの時と同様にス
テップ10で属性検出手段によりパックド10進数を検
出し、ステップ11でデータピッ1〜を右に4ビツトシ
フトする(第5図(f)rD123o」)。次に、符号
を退避させたのち符号を消去しく第5図(g)’F12
3g J )−退避させた符号から符号を判断する(ス
テップ12〜14〉。この場合「負」であるから、ステ
ップ15でビット反転手段によってそのデータビットを
反転させ(第5図(h)’0EDCI4 J ) 、ス
テップ16で手順指示手段により降順であることを指示
し、ステップ17でビット反転機構によってデータビッ
トを反転させ(第5図(i)rF123M」処理を抜け
る。これらの変換された二進文字列(第5図)テ見てみ
ると、そのまま単純に昇順に並べると元の値が降順に並
べるだけで処理できることがわかる。
In addition, when the input data is "-123J" (Figure 5 (e)
'123D)l J), "Similar to +123J, in step 10, the attribute detection means detects the packed decimal number, and in step 11, data bits 1~ are shifted to the right by 4 bits (Fig. 5 (f) rD123o"). . Next, after saving the code, erase the code. Figure 5 (g) 'F12
3g J) - Determine the sign from the saved code (steps 12 to 14). In this case, it is "negative", so in step 15, the data bit is inverted by the bit inverting means (Fig. 5 (h)' 0EDCI4 J), in step 16 the procedure instruction means instructs the data bits to be in descending order, and in step 17 the data bits are inverted by the bit inversion mechanism (the process exits from ``rF123M'' in FIG. 5(i)). If you look at the hexadecimal character string (Figure 5), you will see that if you simply arrange them in ascending order, you can process the original values by simply arranging them in descending order.

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

以上説明したように本発明によれば、ソートキーがその
属性あるいは並びかえ手順を意識する必要のない二進文
字列に変換されるため、ソート処理では変換された二進
文字列を単純に分類するだけの処理により目的とした結
果が得られ、高速な処理が可能となる。
As explained above, according to the present invention, the sort key is converted into a binary string without having to be aware of its attributes or sorting procedure, so the converted binary string is simply classified in the sorting process. The desired result can be obtained by processing only a few steps, and high-speed processing is possible.

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

第1図は本発明の一実施例の動作手順を示す流れ図、第
2図、第4図は本実施例の具体例のパックド10進数、
アンパ・ソクド10進数の場合の流れ図、第3図(a)
〜(e)は第2図で入力データが’+123J、  「
−’123Jの場合のデータ配列図、第5図(a)〜(
i)は第4図で入力データが’+123J、’−123
Jの場合のデータ配列図である。 10〜17・・・動作ステップ。 第l 図
FIG. 1 is a flowchart showing the operation procedure of an embodiment of the present invention, and FIGS. 2 and 4 are packed decimal numbers of a specific example of this embodiment.
Flowchart for Ampa Sokdo decimal number, Figure 3 (a)
~(e) is shown in Figure 2, where the input data is '+123J, '
- Data array diagram for '123J, Figure 5 (a) ~ (
i) is shown in Figure 4, where the input data is '+123J,'-123
It is a data arrangement diagram in case of J. 10-17...Operation steps. Figure l

Claims (1)

【特許請求の範囲】[Claims] 入力データを属性検出手段により10進数か否かを検出
し、その入力データが10進数の場合はパックされてい
るか否かを検出し、その入力データがパックされた10
進数の場合はそのデータビットを所定数シフトし、シフ
トされたパックド10進数あるいは前記パックされてい
ない10進数の符号を判定し、この符号が負の場合はそ
のデータビットを反転し、この反転されたデータあるい
は前記符号が正のデータあるいは前記10進数でない場
合のデータを手順指示手段により昇順か降順かを検出し
、その手順が降順の場合にはそのデータビットを反転し
、その手順が昇順の場合にはそのままデータを出力する
ことを特徴とするストリング変換方式。
The attribute detection means detects whether the input data is a decimal number or not, and if the input data is a decimal number, it is detected whether it is packed or not.
In the case of a hexadecimal number, the data bits are shifted by a predetermined number, the sign of the shifted packed decimal number or the unpacked decimal number is determined, and if this sign is negative, the data bit is inverted, and the inverted data bit is The procedure instruction means detects whether the data is in ascending order or descending order, and if the procedure is in descending order, the data bits are inverted, and the data bits are inverted if the procedure is in ascending order. A string conversion method that is characterized by outputting data as is in some cases.
JP16115186A 1986-07-08 1986-07-08 String converting system Pending JPS6316330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16115186A JPS6316330A (en) 1986-07-08 1986-07-08 String converting system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16115186A JPS6316330A (en) 1986-07-08 1986-07-08 String converting system

Publications (1)

Publication Number Publication Date
JPS6316330A true JPS6316330A (en) 1988-01-23

Family

ID=15729563

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16115186A Pending JPS6316330A (en) 1986-07-08 1986-07-08 String converting system

Country Status (1)

Country Link
JP (1) JPS6316330A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5696327A (en) * 1979-12-28 1981-08-04 Fujitsu Ltd Record data ordering processing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5696327A (en) * 1979-12-28 1981-08-04 Fujitsu Ltd Record data ordering processing system

Similar Documents

Publication Publication Date Title
JPH0480815A (en) Absolute value computing circuit
JPS6316330A (en) String converting system
JP3097294B2 (en) Code conversion device
JP2752220B2 (en) String processing unit
JPH04323727A (en) Arithmetic processing system
JPH0736149B2 (en) Shift flag generation circuit
JP2564881B2 (en) Bit string comparison method
JP2728534B2 (en) Byte position identification code setting processing method
KR950012114B1 (en) Most significant 1 logic address detecting method and its circuit
JP2599984B2 (en) Input data peak value detection circuit
JPH02304621A (en) Detecting circuit for equivalence of logical value
JPS59211137A (en) Comparison system
JPS62154134A (en) Data converter
JPH04326120A (en) Information processor
JPH07325703A (en) Data converting device/method
JPH0855011A (en) Method for converting data between different machine kinds
JPH0635442A (en) Data converting device
JPS6015965B2 (en) Information processing device that processes character string data
JPS6111493B2 (en)
JPH01276222A (en) Data converter
JPH02266413A (en) Code converting method
Yu Hpsimc: ahpl simulator implemented in c language (parser, software)
JPH0370317A (en) Data processing method
JPS6339031A (en) Key data comparator
JPH0333978A (en) Retrieving device for filing system