Output information on secondary indices (NK-ISAM)
| Component: | BS2000 | 
| Functional area: | File processing | 
| Domain: | FILE | 
| Privileges: | STD-PROCESSING | 
Function
The SHOW-INDEX-ATTRIBUTES command makes a read access to the specified file and outputs information on all existing secondary keys or generated secondary indices to SYSOUT.
The output consists of the file name and a table which contains one line for each defined key, showing:
- key name 
- position of the key field within the data record 
- length of the key field 
- whether duplicate keys are allowed 
- any additional flags, with INCOMPLETE for any incomplete secondary index 
The command supports structured output in S variables (see "Output in S variables").
Format
| SHOW-INDEX-ATTRIBUTES | 
| FILE-NAME = <filename 1..54> | 
Operands
FILE-NAME = <filename 1..54>
The name of the NK-ISAM file for which information on the secondary keys is required. 
Return codes
| (SC2) | SC1 | Maincode | Meaning | 
|---|---|---|---|
| 0 | CMD0001 | Command executed without errors | |
| 32 | CMD2009 | Internal error on structured output to S variables | |
| 32 | DMS0A37 | Internal system error | |
| 32 | DMS0A42 | Internal error on opening the file | |
| 32 | DMS0A43 | Internal error on closing the file | |
| 32 | DMS0A4F | RDTFT error | |
| 32 | DMS0A3A | Inconsistent control block found | |
| 64 | DMS0A4A | No secondary indices exist | |
| 64 | DMS0A30 | Remote system not supported | |
| 64 | DMS0A31 | Specified catalog ID does not exist | |
| 64 | DMS0A46 | Not an NK-ISAM file | |
| 128 | DMS0A49 | Command interrupted | |
| 130 | DMS0A32 | Specified catalog ID not available | |
| 130 | DMS0A38 | Insufficient virtual memory | 
Output in S variables
| Output information | Name of the S variable | T | Contents | Condition | 
|---|---|---|---|---|
| Duplicate secondary keys allowed | var(*LIST).AIX(*LIST).DUP-KEY | S | *NO | |
| Length of the secondary key | var(*LIST).AIX(*LIST).KEY-LEN | I | <integer 1..127> | |
| Name of the secondary key | var(*LIST).AIX(*LIST).KEY-NAME | S | <c-string 1..8> | |
| Position of the secondary key in the record | var(*LIST).AIX(*LIST).KEY-POS | I | <integer 1..32496> | |
| Incomplete secondary key present | var(*LIST).AIX(*LIST).NOT-COMPL | S | *NO | |
| Name of the NK-ISAM file | var(*LIST).F-NAME | S | <c-string 1..54> | |
| Number of secondary keys defined | var(*LIST).KEY | I | <integer 1..30> | 
Example
See the CREATE-ALTERNATE-INDEX command.