It is possible to automate the idxbuild for some table(s) by using an input file and specifying the idxbuild's options.
To automate the following steps:
proenv>proutil sports -C idxbuild
OpenEdge Release 11.7.4 as of Tue Oct 9 19:02:20 EDT 2018
Index Rebuild Utility
=====================
Select one of the following:
--------------------
All (a/A) - Choose all the indexes
Some (s/S) - Choose only some of the indexes
By Area (r/R) - Choose indexes in selected areas
By Schema (c/C) - Choose indexes by schema owners
By Table (t/T) - Choose indexes in selected tables
By Activation (v/V) - Choose active or inactive indexes
--------------------
Quit (q/Q)
Enter your selection:
s
Enter the name of table containing the index.
Enter ! to indicate input is complete. (9176)
Table name:
customer
Index name:
cust-num
Enter the name of table containing the index.
Enter ! to indicate input is complete. (9176)
Table name:
!
The following indexes will be rebuilt:
Owner: PUB
Table: customer
Index: cust-num
Is this correct? (y/n)
y
Do you have enough disk space for index sorting? (y/n)
y
Idxbuild is running with threads. The maximum number of sort group threads is 8. (13942)
TMB value is 8, TM value is 8, SG value is 48, packing factor is 100. (16141)
Temporary sort file at: C:\OpenEdgex86\WRK will use the available disk space. (11443)
Index 12 ( PUB.Customer, Cust-Num ): de-activated (8831)
Area 9: Index scan (Type II) complete. Elapsed time: 0.001
Processing area 8 : (11463)
Area 8: Record scan (Type II) complete. Elapsed time: 0.001
Sorting and index building group 12.
Sorting index group 12 complete. Elapsed time: 0.001 (16761)
Building index 12 (Cust-Num) of group 12 (16757)
Building of indexes in group 12 completed. Elapsed time: 0.001 (16762)
1 indexes were rebuilt in area 8. Total elapsed time: 0.013 (16171)
Temporary sort file at C:\OpenEdgex86\WRK used up 0K of disk space. (11480)
A total of 0K of temporary sort disk space was used for area 8. (11483)
Processing area 9 : (11463)
Index 12 ( PUB.Customer, Cust-Num ): activated (8830)
1 indexes were rebuilt. (11465)
Index rebuild complete. 0 error(s) encountered. Elapsed time: 0.077
We will need to create a file with the following contents:
s
customer
cust-num
!
y
y
Press <enter> after the last "y" to make sure the last option is read. Save it with any name, like input.txt.
Example:
proutil sports -C idxbuild < input.txt > output.txt
or
proutil sports -C idxbuild < input.txt
or
proutil sports -C idxbuild < input.txt 2>&1
In the first example the input entries will come from the file input.txt and the output of idxbuild will be sent to otput.txt.