Y2K Millennium Compliance - University of Delaware


Fortran Program bridge.f


C**		Program bridge.f
C
C Program bridge converts input 2-digit base 10 year data 
C into 2-digit base hexadeicmal data where the century is 
C computed using a fixed window subroutine, window with a pivot
C value of 3.
C
C The logic of window is 
C
C	if y >= ipivot  y -> y
C	if y <  ipivot  y-> y+100 
C
C    where ipivot = 3
C
C Ipivot =3 defines the window from 1903-2002. 
C
C The resulting hexadeciaml 2-digit year values are printed to file output.dat.
C File output.dat then can  be used as input to samp1comp.f which assumes 
C input data to be  2-digit hexadecimal year values.  
C
C Program bridge.f reads in 4 lines of data consiting of:
C
C    Name1
C    Birthdate1
C    Name2
C    Birthdate2
C
C
C where all entries are character strings and the birthdates are in
C date format:  MMDDYY.  Input is keyboard input or from a file via
C redirection.
C
C Example:
C
C    John Smith
C    991201
C    Joe Public
C    981131
C
C The program prints the input data to file output.dat but with the 
C 2-digit year values in hexadeciaml.

	character*20 name1, name2
	character*6 date1, date2
	integer y1,y2
	open (3,file='output.dat')
        read(5,'(a)')name1
	read (5,'(a)')date1 
        read(5,'(a)')name2
	read (5,'(a)')date2 
	read(date1,'(3i2)')m1,d1,y1
        read(date2,'(3i2)')m2,d2,y2
	call window(y1,3)
	call window(y2,3)
	print *, y1
	print *, y2
	write(date1,'(2i2,z2)')m1,d1,y1
	write(date2,'(2i2,z2)')m2,d2,y2
	write(3,'(a)')name1,date1,name2,date2
	close(2)
	close(3)
	end
	subroutine window (y,ipivot)
	integer y
	if(y.ge.ipivot) then
	  y = y 
	else
	  y = y + 100
	endif
	return
	end