Help for AGGRG2

PURPOSE

	"aggrg2" collapses columns of numbers in an IBIS interface file into
smaller columns using a designated column as the control. Within the control
column each number which is repeated will define one row. A second key or
index, the area key, selects the maximum value from an index group and stores
is row position in the column. The row position is a pointer from which a
sample can be selected for other columns.

	There are three alternative methods of collapsing columns:

1. The first option selects a sample item from a column based on the row
position of the maximum value from the key column. One value is selected
for each group of control values.

2. The second option aggregates all the values in a column based on the
limits defined by the control values.

3. The third option selects a maximum value from the column based on the
limits defined by the control values (default).

	To illustrate the options a sample case is shown:

CONTROL AREA	SAMPLE		CONTROL	OPTION	OPTION	OPTION
COLUMN	KEY	COLUMN		COLUMN	ONE	TWO	THREE
1	10	 2		1	 4	12	 6
1	20	 4		2	10	18	10
1	15	 6		3	16	42	16
2	24	 8		4	18	18	18
2	31	10		5	20	20	20
3	16	12
3	31	14
3	53	16
4	10	18
5	20	20

TAE COMMAND LINE FORMAT

	aggrg2 INP=FILE OUT=FILE2 AGCOL=N AREA=A BYAR=(X,Y,Z) SUMCOL=(A,B,C)
	aggrg2 INP=FILE OUT=FILE2 AGCOL=N SUMCOL=(X,Y,Z)

	FILE represents the interface file, N the control column,
	A the keyword area, X,Y, and Z the columns to be collapsed,
	and A,B, and C the columns to be collapsed by aggregating
	all the values for an index group.

EXAMPLE

	sort INP=A SORTCOL=1
	aggrg2 INP=A OUT=B AGCOL=1

	This example collapses the interface file by replacing multiple
rows with the same value in column 1 by a single row and choosing the
largest value in the other rows to be retained.

RESTRICTIONS

The interface file can be sorted on the AGCOL, but it does not have to
be.  It will be collapsed on each set of contiguous values, using
the breaks between them to identify the sets.  For example if the 
agcol contains (0,0,1,1,1,1,0,0,0,1,0,0,1,1,0,0) then 7 sets of 
contiguous values will be recognized.

Dynamic allocation is used so the columns can be of any length.

	WRITTEN BY		A. L. Zobrist		 1 Dec 1975
	COGNIZANT PROGRAMMER	K. F. Evans
	REVISION		1			26 Jul 1978
        Made portable for UNIX  A. Scop (CRI)            2 Jan 1995
        rewritten in C          A. L. Zobrist            7 Jun 2000
Thu Jan  3 2008 wlb switched to USES_ANSI_C AND LIB_CARTO; misc cleanup  


PARAMETERS:


INP

Standard IBIS input file.

OUT

Standard IBIS output file.

AGCOL

Control column number.

AREA

Area maximum key.

BYAR

Columns to be collapsed by the first option.

SUMCOL

Columns to be collapsed by aggregating all values for an index group.

See Examples:


Cognizant Programmer: