home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 17
/
CD_ASCQ_17_101194.iso
/
vrac_os2
/
fsorte.zip
/
FSORT.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1994-08-29
|
64KB
|
840 lines
ΓòÉΓòÉΓòÉ 1. Copyright ΓòÉΓòÉΓòÉ
FSORT ver 2.01d
32bit MULTI-THREADED,
FIXED-LENGTH record sort,
for OS/2 2.x systems
COPYRIGHT (C) 1994 MYSTIC SOFTWARE
MYSTIC SOFTWARE reserves the right to change
the performance or functionality of all aspects
of this sort.
You may Download the latest version of FSORT
by calling the Mystic Software BBS at 913-263-7394.
The FSORT evaluation package is in FILE AREA 2.
ΓòÉΓòÉΓòÉ 2. Obtaining the most recent FSORT evaluation package ΓòÉΓòÉΓòÉ
You may Download the latest version of FSORT
by calling the Mystic Software BBS at 913-263-7394.
The FSORT evaluation package is in FILE AREA 2.
ΓòÉΓòÉΓòÉ 3. Sample parmfile and data ΓòÉΓòÉΓòÉ
A sample parm file and data file are included with this
evaluation copy of FSORT. DATA.DAT has 10000
records. Each record has a 5 character ASCII number
followed by carriage-return/line-feed for a total
of 7 characters. You can type this file or use
an editor to view its contents. This file is in
ascending order. DATA.PRM has the sort control
statements to tell FSORT to sort DATA.DAT in descending
order and create an output file named FSORT.OUT.
You can run this sample entering "FSORT DATA.PRM".
ΓòÉΓòÉΓòÉ 4. Questions Suggestions or Problems ΓòÉΓòÉΓòÉ
Please direct any questions, suggestions, or problems
to Larry Griffiths on the Mystic Software BBS
at 913-263-7394. After you log on:
[J]oin a Conference...
Join message base "2"...
[E]nter a message...
ENTRY METHOD [F], [Q], or [L]...
To - Larry Griffiths
Subject -
Security -
Spell Checking -
(Enter your question, problem, or comments)
A blank line ends message
[S]ave message
ΓòÉΓòÉΓòÉ 5. Introduction ΓòÉΓòÉΓòÉ
FSORT is a 32 bit OS/2 2.x FIXED-LENGTH RECORD
sort program with disk sortwork capability.
The size of the file to be sorted is limited by the amount
of disk space available. FSORT is a "Stable" sort.
Any records with EQUAL sort fields
will be kept in the same order as they were in
the input file.
ΓòÉΓòÉΓòÉ 6. Command Format ΓòÉΓòÉΓòÉ
The command format is as follows:
FSORT Infilename Outfilename [Sort fields] [Options]
Infilename: Name of the input file.
This file must contain records of equal length. FSORT
will terminate if the recordsize is not a multiple
of the filesize.
Outfilename: Name of the output file.
A PARAMETER FILE CAN BE SPECIFIED BY ENTERING ONLY ONE PARAMETER.
EXAMPLE: "FSORT PARMS.PRM".
Each parameter in the parameter file must be separated by space(s)
or placed on a new line.
EXAMPLE:
Infilename Outfilename
5,7,bi,a 1,1,fl,a
m4000 l72
ΓòÉΓòÉΓòÉ 7. Sort Fields ΓòÉΓòÉΓòÉ
Sort fields: The Sort fields must follow Infilename and Outfilename.
Up to 64 sort fields may be specified.
The starting position must be greater than zero.
Starting position + Field length - 1
cannot be greater than the record length.
Each sort field contains:
The Starting position.
(1-16384)
The Length.
(1-16384)
The Field type.
BI - binary.
C - character.
FL - Floating point.
(lengths must be 4, 8, or 10 bytes).
You must have a 386 coprocessor,
a 486, or a Pentium.
I - Signed Intel format integer.
(lengths must be 1, 2, or 4 bytes)
Specify "R" if Signed integers are
not in an Intel format and you have a 486
or Pentium machine.
LA - lowercase ASCII.
UA - uppercase ASCII.
LE - lowercase EBCDIC.
UE - uppercase EBCDIC.
The Order of the sorted output.
A - ascending.
D - descending.
F - forward (sort from left to right) (default).
R - reverse (sort from right to left).
Bytes are stored with the most significant
bytes in the rightmost position of the field.
"R" will not work for Signed integers
unless you have a 486 or Pentium processor.
"R" is not valid for Floating point.
ΓòÉΓòÉΓòÉ 8. Examples ΓòÉΓòÉΓòÉ
EXAMPLES: "FSORT in out 1,1,bi,a"
(This will sort column 1 for a length of 1,
BINARY, in ascending order)
"FSORT in out 3,3,bi,d"
(Sort starting in column 3, for a length of 3,
BINARY, in descending order)
"FSORT in out 5,2,bi,a 2,3,bi,d"
(Sort starting in column 5, for a length of 2,
BINARY, in ascending sequence.
If the first field is the same in both
records being compared, then sort
starting in column 2, for a length of 3, BINARY
in descending sequence)
"FSORT in out 5,2,bi,a 2,1,bi,d"
(Sort starting in column 5, for a length of 2, BINARY
in ascending sequence. If the first field is the same
in both records being compared, then sort
starting in column 2, for a length of 1, BINARY
in descending sequence)
"FSORT in out 5,2,ua,d"
(Sort starting in column 5, for a length of 2,
Lowercase ASCII characters are treated the
same as Uppercase ASCII characters, descending.)
"FSORT in out 5,2,bi,ar"
(Sort starting in column 5, for a length of 2, BINARY
in ascending sequence. This is the same as
specifying FSORT in out 6,1,bi,a 5,1,bi,a
ΓòÉΓòÉΓòÉ 9. Options ΓòÉΓòÉΓòÉ
Options: The options must follow Infilename and Outfilename.
They are described as follows:
Hnnn - (2-256) Override number of sortworks.
Use this if you have lots of memory but little
disk space on your computer. Example:
4 megabytes of memory are available for sorting.
Disk C: has a 1 gigabyte input file to be sorted.
Disk D: has 1 gigabyte of free space on it.
FSORT may choose multiple merge passes to sort
the file in the least amount of time, but this
would require 2 gigabytes of disk work space.
SOLUTION: The input and output file path names
must be the same so that the output
file will write over the input file.
H256 will create 256 disk work files
with 4 megabytes of data in each
workfile. H256 tells FSORT to use
a merge width of 256. This allows
FSORT to merge in one pass without the
need for additional disk work files.
It may take longer to sort the file
but function comes before performance
in the above example.
NOTE: FSORT requires 8 bytes of overhead for
each record that it sorts. If the
record length in the above example was
100 then each workfile would really
hold less than 4 megabytes of records.
FSORT could only sort about
900 megabytes instead of
the 1 gigabyte file shown in the above
example. Keep this in mind if you
need to sort files this way.
Lnnnn - (1-16384) Length of each record.
Mnnnn - (129-32000) Amount of memory to use in kilobytes.
M73 means 73k or 74752 bytes.
DEFAULT (256k)
WARNING: Elapsed sort time will increase
dramatically if you specify
a value that is greater than
the amount of free memory
available on your system.
This may also cause the SWAP FILE
disk to become full.
Unnnnnnnn - UPSI (USER PROGRAM SWITCH INDICATORS)
Reserved.
Wcc - (A-Z) Up to TWO sortwork disks.
DEFAULT (Root directory of current disk)
Put sort work areas on these drive letters.
You can enhance performance by placeing
sortworks on separate PHYSICAL hard drives.
ΓòÉΓòÉΓòÉ 10. Alternate Sequence tables ΓòÉΓòÉΓòÉ
FSORT comes with 4 tables called LA, UA, LE, and UE.
You may create your own tables if you have a hex editor.
A table must be exactly 256 bytes (characters) in length.
FSORT takes each character from the sort field and uses
it as an offset into the table. Here is an example of how
to make ascii characters 0-9 look like ascii spaces:
----------------------------------------------------
00 - 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 - 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 - 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
-----------------------------------
----------> 30 | 20 20 20 20 20 20 20 20 20 20|3A 3B 3C 3D 3E 3F
-----------------------------------
40 - 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 - 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
60 - 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
70 - 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
80 - 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 - 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 - A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 - B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
C0 - C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 - D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
E0 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 - F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
----------------------------------------------------
The hexidecimal representation of ascii 0 is 30.
The hexidecimal representation of ascii space is 20.
Goto hexidecimal offset 30 in the table and place
the hexidecimal value of 20 there.
Continue the above process for the remaining hexidecimal
representations of ascii numbers 1 thru 9.
ΓòÉΓòÉΓòÉ 11. Space Requirements ΓòÉΓòÉΓòÉ
Space requirements:
You may use the same filename for Input and Output.
CAUTION!!! The input file will be lost if Phase 1 has ended
and one of the following conditions occurs:
A) A hardware or software failure.
This includes failure of a network connection if
a network disk is used for the output file or
work files.
B) A power failure. (If you are not using an
Uninterruptible Power System)
C) The sort is interrupted by CTRL-BREAK or the
window is closed.
BACKUP THE INPUT FILE BEFORE USING THIS TYPE OF
SORTING PROCEDURE OR RISK LOSING THE INPUT FILE!!!
FSORT will delete the input file when phase 1 is complete.
Phase1: (SORT PHASE)
If the OUTPUT file name is different than the INPUT file name,
then the OUTPUT file will be erased if it exists.
If Phase 1 can sort the input file in memory, then disk
workfiles are not used.
If Phase 1 cannot sort the input file in memory then Phase 1
disk workfiles are created and they will use the same amount
of disk space as the INPUT file.
The INPUT file will be erased at the end of Phase 1
if the OUTPUT file pathname is the same
as the INPUT file pathname.
Phase2: (MERGE PHASE)
Phase 2 has three possible choices:
A) If Phase 1 could sort the input file in memory:
The output file will be written directly from memory.
Workfile space is not used.
B) If Phase 1 created disk workfiles and Phase 2 can complete
processing in one merge pass:
Workfile space is equal to the space used by the input
file.
C) If Phase 2 needs to perform multiple merge passes:
Workfiles will need twice the space that the
input file uses.
Here are some pictorial examples of some sorts where the
input file pathname and the output file pathname are the same:
*************************************************************************
* The Input file, Output file, and Workfiles are on the same disk. *
* The Input file can be sorted in memory. *
*************************************************************************
------------
|iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
Phase1 |iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
------------
------------
|..........|
|..........|
|..........|
Phase1 |..........|
End |..........|
|..........|
|..........|
|..........|
|..........|
------------
------------
|oooooooooo|
|oooooooooo|
|oooooooooo|
Phase2 |oooooooooo|
|oooooooooo|
|oooooooooo|
|oooooooooo|
|oooooooooo|
|oooooooooo|
------------
*************************************************************************
* The Input file, Output file, and Workfiles are on the same disk. *
* Phase 1 creates disk workfiles. *
* Phase 2 only requires one merge pass. *
*************************************************************************
------------
|iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
Phase1 |iiiiiiiiii|
|1111111111|
|1111111111|
|1111111111|
|1111111111|
|..........|
------------
------------
|..........|
|..........|
|..........|
Phase1 |..........|
End |1111111111|
|1111111111|
|1111111111|
|1111111111|
|..........|
------------
------------
|oooooooooo|
|oooooooooo|
|oooooooooo|
Phase2 |oooooooooo|
|1111111111|
|1111111111|
|1111111111|
|1111111111|
|..........|
------------
------------
|oooooooooo|
|oooooooooo|
|oooooooooo|
Phase2 |oooooooooo|
End |..........|
|..........|
|..........|
|..........|
|..........|
------------
*************************************************************************
* The Input file, Output file, and Workfiles are on the same disk. *
* Phase 1 creates disk workfiles. *
* Phase 2 creates additional workfiles. *
*************************************************************************
------------
|iiiiiiiiii|
|iiiiiiiiii|
|iiiiiiiiii|
Phase1 |iiiiiiiiii|
|1111111111|
|1111111111|
|1111111111|
|1111111111|
|..........|
------------
------------
|..........|
|..........|
|..........|
Phase1 |..........|
End |1111111111|
|1111111111|
|1111111111|
|1111111111|
|..........|
------------
------------
|2222222222|
|2222222222|
|2222222222|
Phase2 |2222222222|
multiple |1111111111|
merge |1111111111|
passes |1111111111|
|1111111111|
|..........|
------------
------------
|2222222222|
|2222222222|
|2222222222|
Phase2 |2222222222|
before |..........|
final |..........|
merge |..........|
pass |..........|
|..........|
------------
------------
|2222222222|
|2222222222|
|2222222222|
Phase2 |2222222222|
Final |oooooooooo|
Merge |oooooooooo|
Pass |oooooooooo|
|oooooooooo|
|..........|
------------
------------
|..........|
|..........|
|..........|
Phase2 |..........|
End |oooooooooo|
|oooooooooo|
|oooooooooo|
|oooooooooo|
|..........|
------------
*************************************************************************
* The Input file, Output file are on the same disk. *
* the Workfiles are on a different disk. *
* The Input file can be sorted in memory. *
*************************************************************************
------------ ------------
|iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
Phase1 |iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
|iiiiiiiiii| |..........|
------------ ------------
------------ ------------
|..........| |..........|
|..........| |..........|
|..........| |..........|
Phase1 |..........| |..........|
End |..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
------------ ------------
------------ ------------
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
Phase2 |oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
------------ ------------
*************************************************************************
* The Input file, Output file are on the same disk. *
* The Workfiles are on a different disk. *
* Phase 1 creates disk workfiles. *
* Phase 2 only requires one merge pass. *
*************************************************************************
------------ ------------
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
Phase1 |iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
------------ ------------
------------ ------------
|..........| |1111111111|
|..........| |1111111111|
|..........| |1111111111|
Phase1 |..........| |1111111111|
End |..........| |1111111111|
|..........| |1111111111|
|..........| |1111111111|
|..........| |1111111111|
|..........| |1111111111|
------------ ------------
------------ ------------
|oooooooooo| |1111111111|
|oooooooooo| |1111111111|
|oooooooooo| |1111111111|
Phase2 |oooooooooo| |1111111111|
|oooooooooo| |1111111111|
|oooooooooo| |1111111111|
|oooooooooo| |1111111111|
|oooooooooo| |1111111111|
|oooooooooo| |1111111111|
------------ ------------
------------ ------------
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
Phase2 |oooooooooo| |..........|
end |oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
------------ ------------
*************************************************************************
* The Input file, Output file are on the same disk. *
* The Workfiles are on a different disk. *
* Phase 1 creates disk workfiles. *
* Phase 2 creates additional workfiles. *
*************************************************************************
------------ ------------
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
|iiiiiiiiii| |1111111111|
Phase1 |iiiiiiiiii| |1111111111|
|..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
------------ ------------
------------ ------------
|..........| |1111111111|
|..........| |1111111111|
|..........| |1111111111|
Phase1 |..........| |1111111111|
End |..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
------------ ------------
------------ ------------
|..........| |1111111111|
|..........| |1111111111|
|..........| |1111111111|
Phase2 |..........| |1111111111|
multiple |..........| |2222222222|
merge |..........| |2222222222|
passes |..........| |2222222222|
|..........| |2222222222|
|..........| |..........|
------------ ------------
------------ ------------
|..........| |..........|
|..........| |..........|
|..........| |..........|
Phase2 |..........| |..........|
before |..........| |2222222222|
final |..........| |2222222222|
merge |..........| |2222222222|
pass |..........| |2222222222|
|..........| |..........|
------------ ------------
------------ ------------
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
Phase2 |oooooooooo| |..........|
final |..........| |2222222222|
merge |..........| |2222222222|
pass |..........| |2222222222|
|..........| |2222222222|
|..........| |..........|
------------ ------------
------------ ------------
|oooooooooo| |..........|
|oooooooooo| |..........|
|oooooooooo| |..........|
Phase2 |oooooooooo| |..........|
end |..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
|..........| |..........|
------------ ------------
ΓòÉΓòÉΓòÉ 12. Execution Graph 1 (122 character records) ΓòÉΓòÉΓòÉ
The following Graph was created by varying the memory from 64k to 4096k
in increments of 64k. The data file consisted of 500,000 122 character
records. These records were in random order. There were 12 one character
sort fields. FSORT made two merge passes until it hit 1024k of memory.
Increasing memory above 4096k (4meg) was not necessary as it did not
decrease execution time. Phase1 is BLUE and Phase2 is GREEN.
FSORT ran on the following hardware:
50mhz EISA 486 with 32meg of memory.
SCSI cache controller with 4meg of memory.
Two physical SCSI disk drives.
INPUT file was on a HPFS partition with 1024k cache.
SORTWORK files were on a FAT partition with 2048k cache.
ΓòÉΓòÉΓòÉ 13. Execution Graph 1 (16 character records) ΓòÉΓòÉΓòÉ
The following Graph was created by varying the memory from 64k to 4096k
in increments of 64k. The data file consisted of 3,812,500 16 character
records. These records were in random order. There was one integer
sort field.
Phase1 is BLUE and Phase2 is GREEN.
FSORT ran on the following hardware:
50mhz EISA 486 with 32meg of memory.
SCSI cache controller with 4meg of memory.
Two physical SCSI disk drives.
INPUT file was on a HPFS partition with 1024k cache.
SORTWORK files were on a FAT partition with 2048k cache.
ΓòÉΓòÉΓòÉ 14. Performance ΓòÉΓòÉΓòÉ
The performance of FSORT can be improved in two ways.
1) Increase the amount of REAL memory that it can use for sorting.
See Graph 1 to show wasted memory allocation.
2) Place the sortwork areas on seperate PHYSICAL disk devices.
ΓòÉΓòÉΓòÉ 15. Technical Support ΓòÉΓòÉΓòÉ
FSORT is tested by giving it many combinations of input parameters
and then checking for correct output. This will give many of you
that warm, fuzzy feeling. FSORT is currently supported thru the
Mystic Software BBS and Questions and Problems should be answered within
24 hours. However, some of you may be looking for emergency telephone
support. Mystic Software is a new Corporation and cannot provide this
kind of support at this time. You may send a letter of intent to
purchase software support for FSORT to:
Mystic Software
P.O. Box 691
Abilene, Kansas 67410
Support rates will depend upon how many letters of intent are
received. Support contracts would run for one year with options
to renew every year.
Number of contracts
100 - 500 $400 to $2000 a year
501 - 1000 $200 to $400 a year
1001 - 5000 $50 to $200 a year
Please specify the amount of money that you would be willing to
commit for an Annual Support contract. You will be notified in
writing when and if the above levels of letters of intent have
been received.
ΓòÉΓòÉΓòÉ 16. D I S C L A I M E R ΓòÉΓòÉΓòÉ
D I S C L A I M E R
THIS PROGRAM IS AN EVALUATION COPY AND AS SUCH YOU ARE PERMITTED TO
DISTRIBUTE IT WITHOUT CHARGE PROVIDED THAT ALL FILES ARE UNMODIFIED
AND DISTRIBUTED TOGETHER. DUE COPYRIGHT MUST BE OBSERVED. THIS
PROGRAM IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND,
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABLILITY AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MYSTIC SOFTWARE BE LIABLE FOR ANY DAMAGES,
EITHER DIRECT OR CONSEQUENTIAL, CAUSED BY THE USE,
OR INABLILITY TO USE THIS PROGRAM, EVEN IF MYSTIC SOFTWARE
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
ALL TRADEMARKS AND SERVICE MARKS ARE THE PROPERTY
OF THEIR RESPECTIVE OWNERS.