-------------------------------------------------------------------------------- MODULE ISORT
-------------------------------------------------------------------------------- REPLACES DAMP modules SIF and IRN
--------------------------------------------------------------------------------
ISORT sorts an IFF file on the basis of FSN (Feature Serial Number), ISN (Internal Sequence Number), or FC (Feature Code).
--------------------------------------------------------------------------------
$ ISORT file-spec file-spec Command qualifiers Defaults /DUPLICATES Retain all duplicate FSNs /NODUPLICATES=FIRST Retain only the first duplicate FSN (See text). /NODUPLICATES=LAST Retain only the last duplicate FSN (See text). /FC /INTERNAL Sort on the basis of FSN. /[NO]LOG /NOLOG /OUTPUT[=file-spec] /OUTPUT=SYS$OUTPUT /[NO]PRINTER /NOPRINTER
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
unsorted-file-spec
- specifies the IFF file to be sorted. Any part of the file specification which is not supplied will be taken from the default specification 'LSL$IF:IFF.IFF;0'.
sorted-file-spec
- specifies the IFF file which is to be created. Any part of the file name which is not explicitly given will be taken from the parsed input specification. Note that a version number must not be specified for the output file. If a file with the specified name already exists a new file will be created with the version number incremented by one.
--------------------------------------------------------------------------------
/DUPLICATES
- forces all features with duplicate FSNs to be retained in the sorted file. The features are retained in the same order as in the unsorted file. This is the default action for ISORT. The /NODUPLICATES qualifier may be used to override this default, and discard features with duplicate FSNs.
/NODUPLICATES=FIRST
- forces all features with duplicate FSNs, with the exception of the FIRST duplicate feature, to be discarded from the sorted file.
/NODUPLICATES=LAST
- forces all features with duplicate FSNs, with the exception of the LAST duplicate feature, to be discarded from the sorted file.
/FC
- forces sorting within layers to be based on the FC (Feature Code) rather than the FSN. Within each layer, features with the same code, which will usually require plotting in the same colour, will be grouped together. Plotting with some colour plotters will thus be speeded up by minimising the number of pen changes required.
/INTERNAL
- forces sorting to be based on the ISN (Internal Sequence Number) rather than the FSN. This will usually result in the restoration of the original digitising order.
/LOG
/NOLOG
- this will result in supplementary messages being sent to SYS$OUTPUT. Supplementary messages are generated when a file is successfully opened, the contents of the HI entry are then output to the listing file if /OUTPUT is specified and a reassuring message output each time a new layer is encountered in the IFF file.
/OUTPUT[=file-spec]
- by default output will be to SYS$OUTPUT. This option allows the user to redirect output to file. If /OUTPUT is specified ISORT can generate voluminous output.
/PRINTER
/NOPRINTER
- queues the ISORT output for printing under the name given by the /OUTPUT qualifier. After printing the file is deleted. If /PRINTER is specified without the /OUTPUT qualifier, the output is directed to a file named SYS$DISK:ISORT.LIS which is queued automatically for printing and then deleted.
--------------------------------------------------------------------------------
ISORT is an IFF file sort program. Its primary purpose is to sort the features in an IFF file into ascending Feature Serial Number (FSN) order prior to output from IFF to a customer format, as the order will usually have been disturbed by editing with LITES2.
In order to preserve the layer structure found in the input IFF file sorting is conducted on a layer by layer basis. Features with a FSN of 0 will be included in the sort.
ISORT outputs a summary of feature serial number allocation including duplicated feature serial numbers and gaps. The FSNs will normally be unique within any one layer. If duplicated FSNs are present then the /NODUPLICATES qualifier with either the FIRST or LAST option, may be used to override the default mechanism of retaining all features with duplicate FSNs. When /NODUPLICATES=FIRST is selected only the first feature with a duplicated FSN in a given layer is kept. When /NODUPLICATES=LAST is selected only the last feature with a duplicated FSN is retained.
The /INTERNAL qualifier may be specified in order that sorting be based on the features' ISN (Internal Sequence Number) instead of the FSN. Each feature in a file should have a unique ISN, and therefore the use of the /NODUPLICATES qualifier is not allowed if a sort on ISN is specified.
The /FC qualifier may be specified so that sorting is based on the features' FC (Feature Code). All the features with the same code within a layer will be grouped together and hence will be plotted consecutively. Since features with the same feature code are usually plotted in the same colour, the action of some colour pen plotters will be speeded up by reducing the number of pen changes needed. The /NODUPLICATES qualifier is not allowed with a sort on FC, since many features may be expected to have the same code.
--------------------------------------------------------------------------------
$ ISORT LESLEY FE.IFFELAPSED: 00:02:03.15 CPU: 0:00:56.12 BUFIO: 8362 DIRIO: 3230 FAULTS: 1379 $
$ ISORT LESLEY FE.IFF/LOG %LSLLIB-I-IFFOPENED, DUA0:[IFF.IMP.TEST]LESLEY.IFF;0 opened for read %LSLLIB-I-IFFOPENED, DUA0:[IFF.IMP.TEST]FE.IFF opened for write %ISORT-I-LAYER, layer 4 found %ISORT-I-LAYER, layer 7 found %ISORT-I-LAYER, layer 1 found %ISORT-I-LAYER, layer 24 found %ISORT-I-LAYER, layer 31 found %ISORT-I-LAYER, layer 32 found ELAPSED: 00:00:11.18 CPU: 0:00:02.38 BUFIO: 7 DIRIO: 50 FAULTS: 1227 $
$ ISORT LESLEY/OUTPUT/NODUPLICATES=FIRST FE.IFF=================================== ISORT ====================================== Input file: DUA0:[IFF.IMP.TEST]LESLEY.IFF;3 Output file: DUA0:[IFF.IMP.TEST]FE.IFF;4 Command line: ISORT LESLEY/OUTPUT/NODUPLICATES=FIRST FE.IFF SORT SUMMARY: Layer 1 Duplicate Feature with FSN 1 discarded Duplicate Feature with FSN 1 discarded Duplicate Feature with FSN 98 discarded Lowest Feature Serial Number 1 Missing Feature Serial Numbers 113 to 327 Highest Feature Serial Number 329 Layer 1 contains 116 sorted features 3 duplicates were omitted Layer 4 Duplicate Feature with FSN 6 discarded Duplicate Feature with FSN 74 discarded Lowest Feature Serial Number 408 Missing Feature Serial Numbers 2117 to 9995 Highest Feature Serial Number 9999 Layer 4 contains 1713 sorted features 2 duplicates were omitted DUA0:[IFF.IMP.TEST]LESLEY.IFF;3 contains 2028 unsorted features DUA0:[IFF.IMP.TEST]FE.IFF;4 contains 2023 sorted features, 5 duplicates were omitted ELAPSED: 0 00:00:19.15 CPU: 0:00:10.28 BUFIO: 26 DIRIO: 242 FAULTS: 1192 $
In this example, /NODUPLICATES=FIRST is used so that all features with duplicate FSNs with the exception of the first feature, are discarded. A message is generated for each feature discarded. The /OUTPUT qualifier without a file specification causes supplementary messages to be sent to SYS$OUTPUT:.
$ ISORT/FC/LOG/OUT START FC_SORTED<CR> %LSLLIB-I-IFFOPENED, LSL$SOURCE_ROOT:[IMP.ISORT]START.IFF;2 opened for read %LSLLIB-I-IFFOPENED, LSL$SOURCE_ROOT:[IMP.ISORT]FC_SORTED.IFF;5 opened for write =================================== ISORT ====================================== Input file: LSL$SOURCE_ROOT:[IMP.ISORT]START.IFF;2 Output file: LSL$SOURCE_ROOT:[IMP.ISORT]FC_SORTED.IFF;5 Command line: ISORT/FC/LOG/OUT START FC_SORTED SORT SUMMARY: %ISORT-I-LAYER, layer 1 found Layer 1 Lowest Feature Code 1 Highest Feature Code 300 Layer 1 contains 16 sorted features %ISORT-I-LAYER, layer 2 found Layer 2 Lowest Feature Code 1 Highest Feature Code 1000 Layer 2 contains 8 sorted features %ISORT-I-LAYER, layer 3 found Layer 3 is empty %ISORT-I-LAYER, layer 4 found Layer 4 Lowest Feature Code 1 Highest Feature Code 1 Layer 4 contains 1 sorted features LSL$SOURCE_ROOT:[IMP.ISORT]START.IFF;2 contains 25 unsorted features LSL$SOURCE_ROOT:[IMP.ISORT]FC_SORTED.IFF;5 contains 25 sorted features ELAPSED: 0 00:00:14.66 CPU: 0:00:12.61 BUFIO: 49 DIRIO: 73 FAULTS: 1598 $
In this example, the /FC qualifier specified that sorting within layers was to be on feature code. Because the /LOG and /OUT options were also used, ISORT indicates the layers encountered, the number of features which they contain, and the range of feature codes present in each.
$ ISORT UNCODE CODE%LSLLIB-E-IFFOPEN, IFF error opening file "LSL$IF:UNCODE.IFF;0" for read %IFF-E-OPEN, error opening IFF file -RMS-E-FNF, file not found ELAPSED: 00:00:01.11 CPU: 0:00:00.28 BUFIO: 2 DIRIO: 4 FAULTS: 60 $
$ ISORT LESLEY FE.IFF/DUP/OUT=LESLEY.LISELAPSED: 00:00:14.80 CPU: 0:00:05.65 BUFIO: 10 DIRIO: 60 FAULTS: 1988 $ $ ISORT LESLEY FE.IFF/OUT=LESLEY.LIS/PRINTER ELAPSED: 00:00:02.54 CPU: 0:00:00.38 BUFIO: 3 DIRIO: 1 FAULTS: 155 $ $ ISORT LESLEY FE.IFF/PRINTER/INTERNAL ELAPSED: 00:00:07.78 CPU: 0:00:01.78 BUFIO: 6 DIRIO: 55 FAULTS: 1125 $
These examples show the various possibilities for specifying /PRINT and
/OUTPUT. In each case the the input file is
DUA0:[IFF.IMP.TEST]LESLEY.IFF and the output file is
DUA0:[IFF.IMP.TEST]FE.IFF. In the first example an output file
SYS$DISK:LESLEY.LIS is created with program output directed to it with the
/OUTPUT qualifier. The second example also creates an output file
SYS$DISK:LESLEY.LIS with the /OUTPUT qualifier but as the /PRINT qualifier is
also given the file is printed and then deleted. In the final example the
/PRINT qualifier is given without any filename specified by the /OUTPUT
qualifier so a temporary file SYS$DISK:ISORT.LIS is created with output
information, printed then deleted.
--------------------------------------------------------------------------------
These messages give information only, and require no immediate action by the user. They are often used to supply explanatory information in support of a warning or error message.
LSTOPN, listing file 'file-spec' opened
Explanation: The specified listing file has been opened successfully.
User action: None.
LAYER, layer 'integer'
Explanation: The specified Layer has been encountered in the input file and is being sorted.
User action: None.
These messages are output when an error has occurred that can be corrected immediately by the user.
LSTNSPLDEL, listing file not spooled or deleted.
Explanation: The program has been unable to queue for printing or delete the listing file specified by the /OUTPUT or /PRINT qualifier.
User action: Check that any listing file specification is correct. Check that the print queues are functioning correctly. If the problem continues notify the system manager.
LSTNSPL, listing file not spooled.
Explanation: The program has been unable to place the listing file specified by the /OUTPUT or /PRINT qualifier onto the printer queue.
User action: Check that any listing file specification is correct. Check that the print queues are functioning correctly. If the problem continues notify the system manager.
--------------------------------------------------------------------------------
These messages indicate an error in processing which has caused the program to terminate. The most likely causes are a corrupt or otherwise invalid input IFF file, or an error related to command line processing and file manipulation. It is most unlikely that any output file produced will be correctly processed.
ERRCLINFL, error closing input IFF file
ERRCLOUTFL, error closing output IFF file
Explanation: An error has occurred in closing the specified IFF file.
User action: This should not normally occur. Check that there is sufficient disk space for the file and that the disk is functioning properly. If the problem continues, notify the system manager.
ERROPLST, error opening list file 'file-spec'
Explanation: The supplied file specification is erroneous, the device or directory specified does not exist, or you do not have write access to the directory.
User action: The accompanying messages will help you to interpret the cause of the error. Check the file specification for errors, check that you have read access to the device and directory. If the problem continues, notify the system manager.
NOFEATURES, input file contains no features - deleting output file
Explanation: The input IFF file does not contain any features. Since ISORT sorts IFF features there is no point in retaining any IFF output file produced. An IFF output file will have been created by the time ISORT detects that there are no features. ISORT closes and deletes this output file before terminating execution. $STATUS will be set to SS$_ABORT.
User action: Use IINFO on the file to determine whether it contains an HI (HIstory) entry. This should reveal what has caused the file to contain no features. Without features an IFF file is useless unless it is destined as template file to receive new digitising.
NOLAYERS, input file contains no layers - deleting output file
Explanation: The input IFF file does not contain any layers. ISORT sorts on a layer by layer basis and cannot work outside of a layer structure. An IFF output file will have been created by the time ISORT detects that there are no layers. ISORT closes and deletes this output file before terminating execution. $STATUS will be set to SS$_ABORT.
User action: Use IINFO on the file to determine whether it contains an HI (HIstory) entry. This should reveal what has caused the file to contain no layers. Many IFF utilities will behave unpredictably when presented with such a file. It is probably best to use ITOTEXT followed by IFROMTEXT to create a default layer structure in the file.
UNEXPEOF, unexpected end of IFF file
Explanation: This message indicates there is something seriously wrong with the IFF file which has caused immediate termination of the program. ISORT has detected the end of the IFF file, but has not detected an IFF 'EJ' entry.
User action: Use IMEND on the file, which will correctly position the EOF marker and insert an EJ entry at the end of the file. Re-run ISORT on the corrected file.
--------------------------------------------------------------------------------
In addition to the above messages which are generated by ISORT itself, other messages may be produced by the command line interpreter (CLI) and by Laser-Scan libraries. In particular, messages may be generated by the IFF library. These are introduced by '%IFF' and are documented in the IFF library users' guide. In most cases IFF errors will be due to a corrupt input file, and this should be the first area of investigation. If the cause of the error cannot be traced by the user and Laser-Scan are consulted, then the input file should be preserved to facilitate diagnosis.