C
C ***********************************************************************
C
C  TRANSPA.FOR--READS HOU[N].VOT/SEN[N].VOT FROM BASIC PROGRAM (WHICH
C              PARSES THE LEGI-SLATE OUTPUT FOR THE ROLL CALLS), THE
C              HEADER FILE HOU[N].SRT/SEN[N].SRT, AND CREATES ICPSR
C              STYLE ROLL CALL MATRIX
C                                      
C ***********************************************************************
C
      DIMENSION KVOTE(1600,460)
      CHARACTER*1 KA(20),KB(20)
      integer*2 itim1,itim2,itim3,itim4,jtim1,jtim2,jtim3,jtim4
C      OPEN(1,FILE='HOU106.VOT',STATUS='OLD')
C      OPEN(20,FILE='\COUNTY\COUNTY2\H106.ORD',STATUS='OLD')
C      OPEN(22,FILE='HOU106Y.DTA',RECL=1600)
C      OPEN(24,FILE='HOU106Y.ORD',RECL=1600)
c  *****
      OPEN(1,FILE='SEN107.VOT',STATUS='OLD')
      OPEN(20,FILE='S107.ORD',STATUS='OLD')
      OPEN(22,FILE='SEN107Y.DTA',RECL=1600)
      OPEN(24,FILE='SEN107Y.ORD',RECL=1600)
C
      OPEN(21,FILE='YESNO107.DAT')
C
  100 FORMAT(I6,4X,460I1)
  150 FORMAT(I4,I6,I3,I2,1X,7A1,1X,I4,1X,11A1)
  200 FORMAT(2X,I3,2I2,I4,I5,2X,11A1,1600I1)
  210 FORMAT(I3,I5,2I2,7A1,I4,2I1,11A1,1600I1)
  225 FORMAT(2X,I3,2I2,I4,I5,2X,11A1,3I5)
  250 FORMAT(3I4)
  301 FORMAT(' NUMBER RECORDS WRITTEN',I6)
  310 FORMAT(' NUMBER ROLL CALLS READ',2I6)
 1000 format(22x,4(i2.2,'.'))
 1001 format(' ELAPSED TIME OF JOB  ',4(i2.2,'.'))
      call gettim(itim1,itim2,itim3,itim4)
C
C 107TH SENATE
C
      NP=100
C
C 106TH SENATE
C
C      NP=102
C
C 106TH HOUSE
C
C      NP=439
C
C 105TH SENATE
C
C      NP=100
C
C 105TH HOUSE
C
C      NP=444
C
C 104TH HOUSE
C      NP=446
C 103RD HOUSE
C      NP=444
C 102ND HOUSE
C      NP=441
C 104TH SENATE
C      NP=103
C 103RD SENATE
C      NP=103
C 102ND SENATE
C      NP=103
C
C  READ TRANSPOSED VOTE FILE
C
      I=0
  500 READ(1,100,END=400)IN,(KVOTE(I+1,J),J=1,NP)
      I=I+1
      KYES=0
      KNO=0
      DO 1 J=1,NP
      IF(KVOTE(I,J).EQ.1)KYES=KYES+1
      IF(KVOTE(I,J).EQ.6)KNO =KNO +1
  1   CONTINUE
      WRITE(21,250)I,KYES,KNO
      GO TO 500
  400 WRITE(*,310)I
      NQ=I
C
C  READ HEADER FILE IN SEMI-KREH[N].SRT FORMAT 
C
      IELEC1=0
      IELEC2=0
      IZERO=0
      I=0
  550 READ(20,150,END=450)ICONG,ID1,ISTATE,IDIST,
     C                       (KB(J),J=1,7),IPARTY,
C     C                       (KB(J),J=1,7),IPARTY,IELEC1,IELEC2,
     C                                         (KA(J),J=1,11)
      I=I+1
C
      WRITE(24,210)ICONG,ID1,ISTATE,IDIST,(KB(J),J=1,7),
     C             IPARTY,IELEC1,IELEC2,(KA(J),J=1,11),
     C             (KVOTE(J,I),J=1,NQ)
      WRITE(22,200)ICONG,ISTATE,IDIST,IPARTY,ID1,(KA(J),J=1,11),
     C             (KVOTE(J,I),J=1,NQ)
      KYES=0
      KNO =0
      DO 2 J=1,NQ
      IF(KVOTE(J,I).EQ.1)KYES=KYES+1
      IF(KVOTE(J,I).EQ.6)KNO =KNO +1
  2   CONTINUE
      KMISS=NQ-KYES-KNO
      WRITE(21,225)ICONG,ISTATE,IDIST,IPARTY,ID1,(KA(J),J=1,11),
     C               KYES,KNO,KMISS
      GO TO 550
  450 WRITE(*,301)I
      call gettim(jtim1,jtim2,jtim3,jtim4)
      write(*,1000)itim1,itim2,itim3,itim4
      write(*,1001)jtim1,jtim2,jtim3,jtim4
      stop
      end
