SUNINDEX Examples


Example 1:

SUNINDEX FILE1 -1-2,14-17,21-22

 

Creates an ISAM key file from the source data file with both having the name FILE1 and extensions of .TXT and .ISI respectively. The key information is extracted from the input file based on the positions given (bytes 1-2, bytes 14-17 and bytes 21-22). Duplicate keys are allowed and case conversion is not done on the key.

Example 2:

SUNINDEX FILE2.TXT,FILE3.ISI -N,7-9,12-15

 

Creates an ISAM key file FILE3.ISI from the source data file FILE2.TXT. The key information is extracted from the input file based on the positions given (bytes 7-9 and 12-15). If any duplicate keys found, they are written to FILE3.ERR and the key file is deleted. If the index is successful, any attempt to write a duplicate key to the file generates a trappable I/O error. Case conversion is not performed on the key.

Example 3:

SUNINDEX -IC:\TEMP\SUNINDEX.INI FILE4,,L1024 -U,1,20-30

 

Creates an ISAM key file from the source data file with both having the name FILE4 and extensions of .TXT and .ISI respectively. The record length is 1024 bytes. The key information is extracted from the input file based on the positions given (bytes 1 and bytes 20-30). If FILE4.TXT does not exist, it is created. Any lower case characters in the key information are converted to upper case for the key file (the 'U' option) and duplicate keys are allowed. Utility keywords are first retrieved from the SUNINDEX.INI file in the C:\TEMP directory.

Example 4:

SUNINDEX FILE5,,,\TMP -S,1,20-25

 

Creates an ISAM key file from the source data file with both having the name FILE5 and extensions of .TXT and .ISI respectively. The key information is extracted from the input file based on the positions given (byte 1 and bytes 20-25). Any intermediate work files created are placed in the TMP directory (\TMP) (Current drive if MS-DOS). Duplicate keys are allowed, case conversion is not done on the key and the records in the data file may be both space compressed and variable length.

Example 5:

SUNINDEX file -1-5,p=\"10='abc'\" MS-DOS

SUNINDEX file -1-5,p=\"10=\'abc\'\" Linux

 

SUNINDEX file -p=\"10='abc'\",1-5 MS-DOS

SUNINDEX file -p=\"10=\'abc\'\",1-5 Linux

 

SUNINDEX file -p#\"10!='abc'\",1-5 MS-DOS

SUNINDEX file -p#\"10!=\'abc\'\",1-5 Linux

 

Each of the 3 examples above all perform the same index. The first two are actually the same, with the index positions being specified in a different place. The alternate primary record selection feature is used that specifies that columns 10 through 12 must equal 'abc'. If they do not, record is not included in the index.

Example 6:

SUNINDEX file -p=\"10<'a'&25!='test'\",1-5 MS-DOS

SUNINDEX file -p=\"10<\'a'&25!=\'test\'\",1-5 Linux

 

Creates an index file with primary records being specified as those records with a position 10 less than 'a' and position 25-28 not equal to 'test'.

Example 7:

SUNINDEX file -p=\"1E'1' & 3E'*' | 1E'3' & 3E'*'\",4-12 MS-DOS

SUNINDEX file -p=\"1E\'1\' & 3E\'*\' | 1E\'3\' & 3E\'*\'",4-12 Linux

 

Creates an index file with primary records being specified as those records with position 1 equal to '1' or '3', and position 3 equal to '*'.

Example 8:

 

Compacting Option

 

SUNINDEX xfile -c

;Locking used!

SUNINDEX xfile,out -c

;Locking used! ISI command changed!

SUNINDEX xfile,out -c=0

;Locking used! ISI command not changed!

SUNINDEX xfile -c=1

;Locking NOT used. TXT opened exclusive.

SUNINDEX xfile -c=2

;Locking NOT used. TXT not used!

 

;ISI file opened exclusive.

 

 

See Also: SUNINDEX, Utilities

 



System Utilities