      program rewritehss3
C...................................................Feb 2020
C combine 253 events Pch+Hss 2011/03/-2019/09
C
      CHARACTER*47 infile1,infile2,outfile,txt,txthss
	CHARACTER*40 text
	infile1='catpch2thr304n.res'   ! Pch-cat2
	infile2='catpchhss48m-.txt'		!HSS - Cat1
	outfile='cathsspch2.txt'
	OPEN(10,file=infile1,action='READ')
	read(10,*) txt !extra line
	read(10,*) txt !extra line
	OPEN(11,file=infile2,action='READ')
	read(11,*) txt !extra line
	read(11,*) txt !extra line
	read(11,*) txt !extra line
	OPEN(12,file=outfile)
C
   30 FORMAT(A47)
   31 FORMAT(A40)
   32 FORMAT(A47,A40,1X,I4)
      nn=0
    1	nn=nn+1
      read(11,30,end=40) txthss
	read(10,31,end=41) text
	write(*,32) txthss,text,nn
	write(12,32) txthss,text,nn
	if (nn.lt.254) goto 1
   40	close(unit=10)
   41 close(unit=11)
      close(unit=12)
	pause ' '
	STOP
	end


