      SUBROUTINE AFILE2

*** ROUTINE TO PROCESS THE A FILE FOR SECOND TIME

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      CHARACTER*80 CARD
      CHARACTER*2 CC12

*** OPEN ADJUSTMENT FILE (IUNIT = 1)

      IUNIT = 1
      OPEN (IUNIT,ERR=200,STATUS='OLD',FILE='AFILE',IOSTAT=IOS,
     &      BLANK='ZERO')

*** READ A FILE -- PROCESS RECORDS WITH SSN FIELDS

   10 READ (IUNIT,11,END = 100) CARD
   11 FORMAT (A80)
      CC12 = CARD(1:2)

      IF (CC12.EQ.'HC') THEN
        CALL ASHC (CARD)
      ENDIF
      GO TO 10

*** END OF A FILE PROCESSING

  100 CLOSE (IUNIT)

*** A FILE NOT PRESENT

  200 RETURN
      END
      SUBROUTINE ASHC (CARD)

*** CONTROL POINT HEIGHT ADJUSTMENT RECORD

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      IMPLICIT INTEGER (I-N)
      PARAMETER (MXSSN = 9999)
      LOGICAL ELFLAG,DFFLAG
      LOGICAL GETSSN
      CHARACTER*80 CARD
      CHARACTER*1 HID
      COMMON /FLAGS/ ELFLAG(MXSSN),DFFLAG(MXSSN)

      READ (CARD,1) HID, ISSN
    1 FORMAT (2X, A1, I4)

      IF ( .NOT.GETSSN(ISSN,ISN) ) THEN
        CALL LINE (3)
        WRITE (6,2) CARD
    2   FORMAT ('0ERROR - NO *80* RECORD FOR --',A80,/)
      ELSE
        IF (HID.EQ.'G') THEN
          ELFLAG(ISN) = .FALSE.
        ELSE
          ELFLAG(ISN) = .TRUE.
        ENDIF
      ENDIF
      RETURN
      END
