
C**************************************************************
C	Allocates each 2 digit SIC code to a portfolio number
C	Input:	sic25.inp. Each row of sic.inp is a portoflio
C		3 10 12 14
C		number of 2-digit ranges
C		  list of 2-digit ranges
C	Output: sic.out: 2-digit range, portfolio number
C
	PROGRAM port1
	Implicit	Real*8 (A-H,O-Z)
	Dimension	iportofsic(99)
	Dimension	isicofport(99)
C
	Do i = 1 , 99
	  iportofsic(i) = 0
	Enddo
C
10      OPEN (10,file='dm03.inp',STATUS='old')
	read (10,*) numport
	do i = 1 , numport
	  read (10,*) numsic,(isicofport(j),j=1,numsic)
	  do j = 1 , numsic
	   if (iportofsic(isicofport(j)).ne. 0) 
     1		write(*,*) 'Can not allocate to 2 portfolios!'
	   iportofsic(isicofport(j)) = i
	  Enddo
	enddo
	close(10)
	open(10,file='dm03.out',status='unknown')
	write(10,'(2x,i5)')  numport
	do i = 1 , 99
	  write(10,'(2(1x,i2))') i, iportofsic(i)
	enddo
	close(10)
	End

