      SUBROUTINE GETAGS                                                 
C                                                                       
C          THIS SUBROUTINE GENERATES THE TAG TABLE                      
C                                                                       
      INCLUDE 'SY:FLGCM.FTN'                                            
      INCLUDE 'SY:LDCOM.FTN'                                            
      INCLUDE 'SY:TTCOM.FTN'                                            
C                                                                       
C                                                                       
C     LOCAL VARIABLES                                                   
	LOGICAL*1 CHRBUF(20)                                                   
	LOGICAL*1 TMPCHR(8)                                                    
	REAL*8    BLNK8, TMPBUF                                                
	EQUIVALENCE (TMPCHR(1),TMPBUF)                                         
C                                                                       
	DATA BLNK8 /'        '/                                                
	DATA LIMTAG /50/                                                       
	IF (DEBUG) TYPE 11,LTAG,LSCP,LLOF                                      
11	FORMAT (' GETAGS',' LTAG=',I5,' LSCP=',I5,' LLOF=',I5)               
C	LOE  IS LENGTH OF ENTRY                                               
	LOE= LTAG + LSCP + LLOF                                                
	IF (LOE .GT. 3) GOTO 30                                                
C                                                                       
C	CHANGE THE FOLLOWING TO STOP 'ABORT'                                  
C                                                                       
	LTAG=5                                                                 
	LSCP=4                                                                 
	LLOF=3                                                                 
	LOE=12                                                                 
	CHRBUF(1)=NXTCHR(IDUM)                                                 
C                                                                       
C                                                                       
30	CONTINUE                                                             
C                                                                       
C                                                                       
C                                                                       
C	FILL THE TAG, START CHAR POS, AND LEN OF FIELD TABLES                 
C	FILL UP TO CAPACITY (LIMTAG), THEN IF MORE, JUST                      
C	START REFILLING FOR NOW.  MESSAGE INDICATES OVERFLOW.                 
C                                                                       
40	DO 600  INDX=1,LIMTAG                                                
C                                                                       
C	EXIT FROM DO-LOOP WHEN FTERM IS RETURNED TRUE FROM NXTCHR.            
C                                                                       
C                                                                       
C	FETCH THE NEXT TAG, START CHAR POS AND LEN OF FIELD                   
C	USING NXTCHR. FETCH LOE CHARACTERS.                                   
C                                                                       
50	DO 100 I=1,LOE                                                       
	CHRBUF(I)=NXTCHR(IDUM)                                                 
	II=I                                                                   
	IF (FTERM) GOTO 120                                                    
100	CONTINUE                                                            
120   CONTINUE                                                          
	IF (FTERM) GOTO 900                                                    
C                                                                       
C	ISOLATE THE TAG AND STORE AWAY                                        
C                                                                       
	ITTL=INDX                                                              
        TMPBUF=BLNK8                                                    
	CALL STRMOV(CHRBUF(1),TMPCHR(1),LTAG)                                  
	ITAG(INDX)=TMPBUF                                                      
C                                                                       
C	ISOLATE LENGTH OF FIELD, DECODE AND STORE AWAY                        
C                                                                       
	TMPBUF=BLNK8                                                           
	CALL STRMOV(CHRBUF(LTAG+1),TMPCHR(9-LLOF),LLOF)                        
	DECODE(8,701,TMPBUF) ITMP                                              
	ILOF(INDX)=ITMP                                                        
C                                                                       
C	ISOLATE START CHAR POS, DECODE AND STORE AWAY                         
C                                                                       
	TMPBUF=BLNK8                                                           
	CALL STRMOV(CHRBUF(LTAG+LLOF+1),TMPCHR(9-LSCP),LSCP)                   
	DECODE(8,701,TMPBUF) ITMP                                              
C                                                                       
	IF (DEBUG) PRINT 501,ITTL,(CHRBUF(I),I=1,II)                           
501	FORMAT(' ENTRY ',I5,' CHRBUF=',20A1,'*')                            
	ISCP(INDX)=ITMP                                                        
C                                                                       
C                                                                       
600	CONTINUE                                                            
C                                                                       
	PRINT 601,LIMTAG                                                       
601	FORMAT(' NO. OF TAGS EXCEEDS ',I4)                                  
	GOTO 40                                                                
701	FORMAT(I8)                                                          
C                                                                       
C                                                                       
C          END OF DIRECTORY                                             
C                                                                       
900	FTERM = .FALSE.                                                     
	IF (DEBUG) PRINT 901,ITTL                                              
901	FORMAT(' TAG TABLE CONTAINS ',I4,' TAGS')                           
C                                                                       
      RETURN                                                            
      END                                                               
