Google
 

Trailing-Edge - PDP-10 Archives - AP-D489C-SB - sort.doc
There are no other files named sort.doc in the archive.


SORT.DOC -- Changes from V3A(200) to V4(302).
Apr 1978






























COPYRIGHT (C) 1978 BY
DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
TRANSFERRED.

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
CORPORATION.

DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
SRT4.DOC                                                        Page 2


SORT.DOC -- Changes from V3A(200) to V4(302)



1.0  SUMMARY

1.1  Functions

SORT is the high performance sort/merge package for the  DECsystem-10.
SORT may be run as a stand-alone sort/merge, or embedded in a COBOL or
FORTRAN program.

This release, SORT v4(302), contains all published  edits  up  to  and
including  edit  302, has performance enhancements, has the capability
to sequence check merge files and may sort  files  via  a  nonstandard
collating sequence.


1.2  Monitor

SORT runs under all supported monitors, and has been tested under 6.03
and the 6.04 prototype.  It has not been tested on a KA-10 cpu.

See section 4 for details of how to rebuild SORT.


1.3  Software Dependencies

The stand-alone sort, SORT.EXE, requires that the FORTRAN object  time
system, FOROTS.EXE, be on SYS:, if floating point ASCII keys are to be
used.

The internal COBOL SORT requires version 12 of the COBOL  object  time
system, LIBOL.REL , to reside on SYS:.

The internal FORTRAN SORT requires the  FORTRAN  library,  FORLIB.REL,
and the object time system, FOROTS.EXE, to reside on SYS:.


1.4  Relevant Documentation

SORT is documented in the following manuals:

DECsystem-10 SORT/MERGE User's Guide, AA-0997D-TB
COBOL-68 Language Reference Manual, AA-5057A-TK
DECsystem-10 FORTRAN Programmer's Reference Manual, AA-0944E-TB

These may be found in Software Notebooks 7, 8, and 9.
SRT4.DOC                                                        Page 3


2.0  EXTERNAL CHANGES


2.1  Sequence Checking of MERGE Files

The COBOL MERGE statement has new syntax [WITH SEQUENCE CHECK].   When
WITH  SEQUENCE  CHECK is specified SORT will check the record sequence
of the merge files to ensure that they are pre-sorted.  There is a new
switch  /CHECK  to  accomplish  the  same check in the stand-alone and
FORTRAN SORT.


2.2  KL DECsystem-10 Performance Improvement

There is a minor performance improvement valid on  the  DECsystem-1080
(KL10).   The  BIS  instruction  CVTDBO  is used to convert decimal to
binary for display keys.


2.3  Alternate Collating Sequences

Support has been added for alternate collating sequences.   Files  may
now  be  sorted  via a non-standard collating sequence.  The following
new switches may be used to specify the desired collating sequence:

          /COLLATE:ASCII
          /COLLATE:EBCDIC
          /COLLATE:FILE:file-spec
          /COLLATE:LITERAL:'string'
          /COLLATE:ADDRESS:address


The FILE switch argument is a  file-specification  and  the  collating
sequence  is  input  from  that file.  The file consist of a string of
ASCII characters.  The character's octal value is  determined  by  the
recording  mode switch (SIXBIT A=41, ASCII A=101, EBCDIC A=301).  Each
character in this string, starting with the left  most  character,  is
assigned  sucessive  ascending  positions in the collating sequence of
the character set being specified.  The characters may be  a  graphic,
an  octal  value  or  a  delimiter.   The delimiters are double quote,
comma, hyphen or equal sign.  A graphic  or  string  of  graphics  are
always  enclosed  with double quotes ("A",102,"CDE").  The octal value
represents the value of the character.  This value may not exceed  the
value  which  represents the total number of characters in the set.  A
hyphen (-) may be used in place of a comma to  represent  all  of  the
characters,  found  in  the  normal  collating  sequence,  between the
character which precedes and follows the hyphen.  An  equal  sign  (=)
may be used to denote equivalence;  thus (="D") causes "D" to have the
same position in the collating sequence as the preceding character.

All of the following are equivalent:
(The character set is ASCII)

          "A","B","C","D","E"="G","Z"
          "A"-"D",105="G","Z"
SRT4.DOC                                                        Page 4


          101-"D","E"=107,"Z"
          101-104,105=107,132

Unspecified characters will be treated as though they had appeared  at
the  end  of  the  specified  characters  in  their  normal  ascending
collating sequence.  Hence, a file containing the single character "z"
would  have  the normal collating sequence with the exception that "z"
would have the first position instead of the one after "y".

It will be easy for the user to add new installation defined collating
sequence switch names.

The LITERAL argument is just the text string that would have been  put
in  a file-spec delimited by some character (any character not just ')
that is not in the text string.

The ADDRESS argument is mainly for FORTRAN.  It is the address  of  an
array  containing  the literal text string.  Although an octal address
could be given the more usual form would be a formal  argument  number
^N (see sec.  2.4).

Only one collating sequence is allowed per sort command.


2.4  FORTRAN SORT

Three new switches have been added mainly for FORTRAN SORT these are:

/SUPPRESS:arg     where arg is one of:
ALL         Suppress all error messages
FATAL       Suppress fatal, warnings and informational error  messages
            (same as ALL)
WARNING     Suppress warnings and informational messages
INFORMATION Suppress informational messages
NONE        Suppress none of the messages

/ERROR:ADDRESS of where to go on a fatal error.

/FATAL:ADDRESS of where to store the sixbit error code (SRTxyz).

Although /ERROR and /FATAL code  accept  an  octal  address  the  most
useful argument is one of the form ^N where ^N is the N'th argument in
the FORTRAN call.
i.e.  CALL SORT ('...  /ERROR:^2 /FATAL:^3 ...',$100,ERRCOD)
where label 100 and ERRCOD are defined in the FORTRAN program.

The /ERROR switch allows the user program to  trap  all  SORT  errors.
The  /SUPPRESS  switch allows the user program to prevent the terminal
user from seeing SORT messages.  And the /FATAL switch allows the user
program to decode the SORT error and perhaps do something useful.
SRT4.DOC                                                        Page 5


2.5  Memory allocation algorithm

The memory allocation algorithm for stand-alone and FORTRAN SORT  have
been  centralized so than all requests for memory space now go through
one routine.  In particular the FORTRAN SORT now allocate  space  only
via the FUNCT.  call.  This means that SORT should be able to co-exist
with LINK overlays, and other  user  routines  which  allocate  memory
correctly via FUNCT.

In  addition  the  following  switch  has  been  added,   mainly   for
compatibility with TOPS-20.
/LEAVES:N where N is  the  decimal  number  of  terminal  nodes  (i.e.
records  in  core).   This  switch and the /CORE switch can be used to
tune SORT for a particular application.
SRT4.DOC                                                        Page 6


3.0  KNOWN BUGS AND DEFICIENCIES

As of 12-Apr-78, the following deficiencies are known:


     1.  Stand-alone SORT may not reinitialize itself after a sort, so
         that  restarting  it  by  ^C,  and  running  it  again may be
         necessary.

     2.  If more than 262,143 (2**18-1) records in the input file  all
         have  identical  keys  (which  is  unlikely), SORT's internal
         sequence number overflows.  This causes the  sort  to  become
         unstable;   i.e., the output data is sorted correctly but the
         records with identical keys will not be in the same order  as
         they  were  in  the input file.  In previous versions of SORT
         this simply happened without  any  warning.   Version  4  now
         prints  a  warning  message  if  this  occurs  and  continues
         sorting.

     3.  Edits 303, 304, and 305 were made after the SORT sources were
         frozen.  These patches are in the beware file SORT.BWR.  They
         are also included for your convenience in  the  *.NEW  files.
         Note  however  that  these  patches  have  had  only  minimal
         testing.

     4.  SORT may give the message:

              %SRTNCS Not enough core specified

         when no /CORE switch or MEMORY SIZE clause  was  given.   The
         sort should proceed normally, however.

     5.  Though  FORTRAN  SORT's  calling  sequence  is   similar   to
         stand-alone SORT's, the following differences are known:

              1.  Continuation  lines  (in  indirect  files)  are  not
                  allowed.

              2.  Indirect files must be on DSK: in the user's default
                  path.

              3.  File extensions must be typed explicitly.

              4.  Switches must always follow file  specifications  to
                  which they apply.

     6.  On VM systems, COBOL SORT destroys pages left around by  MCS,
         VMDDT,  and the page fault handler when it reduces core after
         a sort.  The page fault handler is  not  affected  too  much,
         however,  since  it will be brought in again if totally wiped
         out.

     7.  SORT  and  COBOL  overlays  do  not  always   work   together
         correctly.
SRT4.DOC                                                        Page 7


4.0  INSTALLATION INSTRUCTIONS


4.1  Instructions for Loading and Installing SORT

The installation of stand alone SORT is simple.  Just put SORT.EXE  on
SYS:  (or NEW:) and SORT.HLP on HLP:.


4.2  Instructions for Building SORT

Full building instructions for SORT can be found in SORT.CTL.

To generate stand-alone SORT, load all of the SORT  sources  from  the
SORT tape into your directory area, and type:

     SUBMIT SORT/TIME:20:00

If LIBOL.REL and FTDEFS.UNV are in your directory, a COBOL  SORT  will
be built and inserted into LIBOL.REL.

If FORLIB.REL is in your directory, a FORTRAN SORT will be  built  and
inserted into FORLIB.REL.

To build only a COBOL SORT type:

     SUBMIT SORT/TIME:20:00/TAG:COBOL


To build only a FORTRAN SORT type:

     SUBMIT SORT/TIME:20:00/TAG:FORTRA

The following table contains  the  assembly  switches,  their  default
value, location and intended use.

  ASSEMBLY   DEFAULT  DEFINED    USE WHEN SWITCH HAS
  SWITCH     VALUE    IN MODULE  A NONZERO VALUE
  ------------------------------------------------------------------
  FTOPS20    0        SRTPRM     Build SORT for a DECsystem-20
  FTKL10     0        SRTPRM     Use KL instructions (BIS etc.)
  FTKI10     0        SRTPRM     Use KI instructions (DMOVE etc.)
  FTCOL      1        SRTPRM     Allow alternate collating sequence
  FTDEBUG    0        SRTPRM     Debugging aids and additional info
  FTCOBOL    1        SRTCBL     Build SORT for COBOL
  FTFORTRAN  0        SRTCBL     Building COBOL, so turn off FORTRAN
  FTFORTRAN  1        SRTFOR     Build SORT for FORTRAN
  FTCOBOL    0        SRTFOR     Building FORTRAN, so turn off COBOL
SRT4.DOC                                                        Page 8


5.0  INTERNAL CHANGES

Several of the  sort  source  modules  have  been  split  to  separate
DECsystem-10 and DECSYSTEM-20 code.

The sources now consist of:

SRTPRM.MAC  The common parameter definitions
SRTSTA.MAC  The common stand-alone code
SRTSCN.MAC  The interface to SCAN
SRTUUO.MAC  DECsystem-10 specific code
SRTCMP.MAC  The comparison generator
SORT.MAC    The common algorithms

In addition the COBOL SORT has:
SRTCBL.MAC  The interface for COBOL

and the FORTRAN SORT has:
SRTFOR.MAC  The FORTRAN interface.
SRTCER.MAC  Standard error message routines



The following edits were made to SORT as a result of bugs found:

EDIT #

201  SPR 10-22768

     Attempts to compine /BINARY with  /ASCII  in  FORTRAN  SORT,  and
     additionally  with /SIXBIT or /EBCDIC in stand-alone SORT, caused
     SORT to become confused between the mode for key comparisons  and
     the  mode for actual I/O.  Symptoms of this were bad output files
     or illegal memory references.

202  SPR 10-22767

     FORTRAN SORT incorrectly required all binary files to  have  been
     written   with   MODE='BINARY'   in  the  OPEN  statement.   This
     frequently resulted in the erroneous message

          ?SRTFCW FORTRAN binary control word incorrect

203  SPR 10-22769

     Wide confusion in FORTRAN  and  stand-alone  SORT's  handling  of
     FORTRAN binary files of all kinds.

204

     Change SIXBIT input to ignore zero words.  This allowed sorts and
     merges of COBOL RANDOM files, among other things.

205
SRT4.DOC                                                        Page 9


     Fix the handling of labeled multi-reel tapes for sorts.

206

     Turn on the FTOPS20 conditional for TOPS-20  SORT  on  the  QT011
     tape.

207

     Write variable length .TMP files in COBOL SORT.  This can cause a
     great  savings  of  disk  space  during  sorts and merges in some
     cases.

210, SPR 10-22813

     On TOPS-10, SORT occasionally would pad the last block of  output
     disk  files  with  zeros.   Edit  131  in  a previous release was
     intended to fix this, but one  case  was  left  out.   This  edit
     includes that case.

211

     FORTRAN SORT neglected to free one of the I/O  channels  it  used
     each  time  it  was  called.   With enough calls to SORT, all the
     channels were used up.  This edit frees the extra channel.

212, SPR 10-22379

     Multiple commands to SORT  giving  the  /TEMP  switch  frequently
     caused  SORT  to  blow up.  This was caused by SORT's not zeroing
     the last pointer in its list of temporary devices.

213, SPR 10-24603

     This edit removed many of the restrictions in  the  FORTRAN  SORT
     command scanner.  Among these are:

     1.  Removal of some undocumented, redundant switches.

     2.  Allow recording mode switches anywhere in the command string,
         not just following a /KEY.

     3.  Add /COMPUTATIONAL, /STANDARD and /DENSITY for  compatability
         with stand-alone SORT.

     4.  Make /CORE operate as in stand-alone SORT.

     5.  Allow /FORMAT as a key data type on any /KEY,  not  just  the
         last one.

     6.  Allow the command string to  be  in  an  array,  rather  than
         requiring it to be a literal.

     7.  Try default extensions of .CCL and .CMD for indirect  command
         files.
SRT4.DOC                                                       Page 10


214, SPR 10-22409

     Several problems with  SORT's  command  scanner  when  the  /TEMP
     switch  is  used, were fixed.  The fixes included added checks to
     be sure that there was actually an  input  file  (not  all  /TEMP
     specs),  and  allowing  SORT to skip temporary structures if they
     were at least writable, but didn't contain the user's path.

215

     Fix the handling of labeled multi-reel tapes in all cases.   This
     was  a  generalization  of  edit  205,  to allow labeled tapes in
     merges as well as sorts.  This edit was not published due to  its
     immense size.

216

     This fixed the sorting of line-sequenced ASCII files on KL CPUs.

217, SPR 10-24709

     Fixed a bug in edit 207, which caused the data record in a  COBOL
     sort not to be copied into SORT's buffers.

220

     Fixed an illegal instruction when using tapes in FORTRAN SORT.

221, SPR 20-11131

     FORTRAN SORT grew and grew  in  memory  size  each  time  it  was
     called, until all of memory was used up.

222

     Specifying  more  than  one  FORTRAN  floating-point  ASCII   key
     frequently resulted in a FOROTS run-time DECODE error.

223

     When FORTRAN SORT was called by a huge FORTRAN program which  was
     loaded  with FORDDT, SORT got address checks or I/O to unassigned
     channel errors.  This was also caused if the FORTRAN program  ran
     for a while or had complicated expressions preceeding the call to
     SORT.

224

     If a user returned from an output procedure in  a  COBOL  program
     before  the AT END path on the RETURN statement was taken, I/O to
     unassigned channel or no free channel errors resulted.

225 thru 277

     These were spares, and were never used.
SRT4.DOC                                                       Page 11


300

     Development of version 4.

301, 302

     Field test edits.


     The following edits are in the beware file and *.NEW sources

303

     Fix compares of two character EBCDIC  alphanumeric  keys  in  the
     middle of a word.

304

     Fix ?SRTRIE errors on EBCDIC fixed-length files.

305

     On TOPS-20 fix blocking factor problems



6.0  SUGGESTIONS

None.



[End of SRT4.DOC]