	PROGRAM ADRSIM
C	PROGRAMMER: S.C. CHERUKURI
C
C **	PROGRAM TO CONVERT ALFRED ADR FILES TO SIEMENS ADR FILES
C
	BYTE IARRAY(200,80),NFILE(16),IDEC,NUFILE(16)
C
5	WRITE(7,1000)
1000	FORMAT(//,X,'	*** PROGRAM TO CONVERT ALFRED ADR FILES ***',
     +	/,X,'         	TO SIEMENS ADR FILES',//,
     +	'$ENTER THE NAME OF THE FILE TO BE CONVERTED:')
	READ(5,1010) NFILE
1010	FORMAT(16A1)
	OPEN(UNIT=10,NAME=NFILE,TYPE='OLD',READONLY,ERR=20)
	GO TO 30
20	WRITE(7,1020)
1020	FORMAT(X,'ERROR OPENING FILE: CHECK THE NAME ')
	GO TO 5
30	WRITE(7,1005)
1005	FORMAT(/,'$ENTER OUTPUT FILE NAME <RETURN FOR THE SAME NAME>:')
	READ(5,1010) NUFILE
	DO 40 I=1,200
	II=I
	READ(10,1030,END=50)(IARRAY(II,J), J=1,80)
1030	FORMAT(80A1)
40	CONTINUE
50	NUM=I-1
	CLOSE(UNIT=10)
	IF(NUFILE(1).EQ.1H ) GO TO 55
	OPEN(UNIT=10,NAME=NUFILE,TYPE='NEW')
	GO TO 57
55	OPEN(UNIT=10,NAME=NFILE,TYPE='NEW')
57	DO 60 I=1,NUM
	II=I
	IF(II.LT.4.OR.II.EQ.9) GO TO 60
	WRITE(10,1040) (IARRAY(II,J), J=1,80)
1040	FORMAT(80A1)
60	CONTINUE
	CLOSE(UNIT=10)
	WRITE(7,1050)
1050	FORMAT(//,'$ANOTHER FILE TO CONVERT (Y OR N):')
	READ(5,1010) IDEC
	IF(IDEC.EQ.1HY) GO TO 5
	CALL EXIT
	END
