Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50342/avclnr.f4
There are no other files named avclnr.f4 in the archive.
C	PROGRAM AVCLNR
C
C	SEARCH LIST OF AVAILABLE SOFTWARE
C
C	PETE SCHILLING   ALCOA TECHNICAL CENTER   SEPTEMBER, 1974
C
C	CLEAN THE INDEX OF AVAILABLE SOFTWARE.  READ AND REWRITE THE
C	INDEX FILE, ELIMINATING DUPLICATE ENTRIES AND 'STOP' WORDS,
C	AND PRINTING A FREQUENCY TABLE.
C
	DIMENSION INPUT(21), JNPUT(21), KNPUT(21)
C
	COMMON / AVLUNS / LUTT, LUFL
	COMMON / AVNONW / NSTOP, KSTOP(12,150)
C
	DATA IBLNK / ' ' /
	DATA INPUT / 21 * ' ' /
	DATA JNPUT / 21 * ' ' /
	DATA LUFL  / 26 /
	DATA LUOU  / 27 /
	DATA LULP  / 3 /
	DATA LUTT  / 5 /
C
C TO START - -
C
C GET THE LIST OF 'STOP' WORDS.
	CALL AVSTOP
C
C OPEN THE INPUT AND OUTPUT FILES.
	OPEN ( UNIT = LUFL, MODE = 'ASCII', ACCESS = 'SEQIN',
	1 FILE = 'PROGMS.IDX', DEVICE = 'DSK:', DISPOSE = 'SAVE',
	2 DIRECTORY = '101,15' )
	OPEN ( UNIT = LUOU, MODE = 'ASCII', ACCESS = 'SEQOUT',
	1 FILE = 'PROGMS.NWX', DEVICE = 'DSK:', DISPOSE = 'SAVE',
	2 DIRECTORY = '101,15' )
C
C INITIALIZE THE COUNTERS.
	I0    = 1
	KOUNT = 0
	NCHAR = 1
	NRECS = 0
	NWRDS = 0
C
C PRINT A PAGE HEADING.
	WRITE ( LUTT, 10 )
	WRITE ( LULP, 10 )
10	FORMAT ( '1FREQUENCY DISTRIBUTION OF WORDS IN INDEX OF' /
	1 ' AVAILABLE SOFTWARE FOR THE DECSYSTEM-10.' / )
C
C MAIN PROCESSING LOOP * * * * * * * * * * * * * * * * * * * * * * *
C
C READ AN INPUT RECORD.
20	READ ( LUFL, 25, END = 200 ) KNPUT
25	FORMAT ( 21A1 )
C
C FIND THE BLANK CHARACTER AT THE END OF THE CURRENT ENTRY.
	DO 30  I = 2, 16
	IF ( KNPUT(I) .EQ. IBLNK ) GO TO 40
30	CONTINUE
	I = 17
C
40	KCHAR = I
C
C COMPARE THE CURRENT ENTRY WITH THE 'STOP' LIST.  IF IT IS IN THAT
C   LIST, DO NOT REWRITE IT.
	DO 50  I = I0, NSTOP
	IF ( NCOMP ( KNPUT, 1, KCHAR, KSTOP(1,I), 1 ) ) 60, 20, 50
50	CONTINUE
	I = NSTOP + 1
C
60	I0 = I - 1
C
C COMPARE THE CURRENT ENTRY WITH THE PREVIOUS GOOD ONE.
	IF ( NCOMP ( KNPUT, 1, 21, JNPUT, 1 ) ) 70, 20, 70
C
C IF THE CURRENT ENTRY IS NOT IDENTICAL TO THE PREVIOUS GOOD ONE, SAVE
C   AND COUNT IT.
70	WRITE ( LUOU, 25 ) KNPUT
	CALL MOVE ( KNPUT, 1, 21, JNPUT, 1 )
	NRECS = NRECS + 1
C
C COMPARE THE FREQUENCY TABLE ENTRY WITH THE CURRENT ONE.
	IF ( NCOMP ( INPUT, 1, NCHAR, KNPUT, 1 ) ) 90, 80, 90
C
C IF THE NEW ENTRY IS THE SAME, COUNT IT.
80	KOUNT = KOUNT + 1
	GO TO 20
C
C IF THE NEW ENTRY IS DIFFERENT, PRINT AND COUNT THE OLD ONE.
90	WRITE ( LULP, 100 ) KOUNT, ( INPUT(I), I = 1, NCHAR )
100	FORMAT ( I5, 1X, 21A1 )
	NWRDS = NWRDS + 1
C
C RESET THE COUNT AND SAVE THE CURRENT ENTRY.
	KOUNT = 1
	CALL MOVE ( KNPUT, 1, 21, INPUT, 1 )
	NCHAR = KCHAR
C
C GO GET THE NEXT INPUT RECORD.
	GO TO 20
C
C END-OF-FILE PROCESSING * * * * * * * * * * * * * * * * * * * * * * * *
C
C PRINT THE LAST FREQUENCY ENTRY AND THE COUNT.
200	WRITE ( LULP, 100 ) KOUNT, ( INPUT(I), I = 1, NCHAR )
C
C PRINT THE GRAND TOTAL OF WORDS AND ENTRIES.
	WRITE ( LUTT, 210 ) NWRDS, NRECS
	WRITE ( LULP, 210 ) NWRDS, NRECS
210	FORMAT ( / ' THE INDEX CONTAINS', I5, ' DIFFERENT WORDS'
	1 ' AND', I5, ' ENTRIES.' )
C
C CLOSE THE INPUT AND OUTPUT FILES.
	CLOSE ( UNIT = LUFL )
	ENDFILE LUOU
	CALL EXIT
	END