Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29003 Discussions

Error: This name does not match the unit name. [DO_COMBINE]

rawood11
Beginner
2,300 Views

Please help me identify the source of this error. My code is as follows:

program do_combine

use decarrays
implicit none
!include 'arrays_combine.for'
! integer bidx,ofrx,bidy,ofry,bid,ofr
integer :: count,len,dot,fdate,j,k,cal,crsp
integer :: begrec,endrec,recnum,nrsym=0,qdfile=0
integer :: price,null,lttim,num1,nn,t,q
character*1 mcusip*12,mname*30,msymbl*10,yy*4
character tif*1,flrind*1,ocode*2, ocond*1,omni*1,order*1,oside*3
character cusip*12,name*30
integer f /1/

integer :: tbegrec,tendrec,qbegrec,qendrec,qfile=0,inqf
character*5 infile*70,source*3,filedate*7,outfile*3,filedate6*6
character in30*3,in20*3,nqf*1,symbol1*10,symbol2*10
integer iargc
equivalence (yy,filedate),(filedate,filedate6)

logical endqte,endtrd,okay


if (iargc() .lt. 4) then
print *, 'usage: filedate, letter extension'
stop
end if

call getarg (1, source)
call getarg (2, filedate)
call getarg (3, outfile)
!-- # qte files
call getarg (4, nqf)
inqt=50; inqdates=30; nout=0
if(nqf=='1')inqf=1; if(nqf=='2')inqf=2; if(nqf=='3')inqf=3
! 1=cdrom, 2=filedate--9801a, 3=outfile name,
! 4=crspdy file source

! write(66,*)' ready , source= ',source,' filedate= ',
! *filedate,' yy= ',yy,' nqf= ',nqf
! write(6,*)' outfile= ',outfile

open(20,file='e:crspdycrspdy.'//yy)

open(30,file=source//'taqp_mastsymdatequotes.'// filedate)
open(35,file=source//'taqp_mastsymdate rades.'// filedate)
! write(6,*)' 30/35 open'

open(inqt,file= source//'taqp_mastq'//filedate//'.bin', &
&form='binary',access='direct',recl=27)
! write(6,*)inqt,' open, filedate= ',filedate


open(56,file= source//'taqp_mast '//filedate//'.bin', &
&form='binary',access='direct',recl=19)

open(80,file=outfile//'taqpcomb.' // filedate ,&n bsp; &
&form='unformatted')

open(90,file='new_modes' // filedate)

!===============================read in date conversion ===============
if(yy.eq.'2006')then
year=20060000
else if(yy.eq.'2007')then
year=20070000
endif

501 read(20,9388,end=502)crsp,cal
9388 format(i5,i11)
! write(6,*)' crsp/cal= ',crsp,cal,cal-year
crspd(cal-year)=crsp
goto 501

502 write(6,*)' last crsp/cal=',crsp,cal,cal-year
lsym=' '; n=0; nn=0

1 read(inqdates,2778,end=98)symbol1,date,qbegrec,qendrec
2778 format(a10,i11,2i10)

! if(symbol>='GY')write(66,*)' read35= ',symbol1,date,inqdates
read(35,2778,end=199)symbol2,date,tbegrec,tendrec

! if(symbol.ge.'B')goto 99
2 continue
!write(6,*)' 30/35 in= ',symbol1,symbol2,date,tbegrec,tendrec,
!*qbegrec,qendrec,' lsym= ',lsym
! write(66,*)' 30/35 in= ',symbol1,symbol2,date,tbegrec,tendrec,
! *qbegrec,qendrec,' lsym= ',lsym,inqt,inqdates
if(symbol1==symbol2)then
symbol=symbol1
!-- quotes but no trades
else
!write(6,*)' symbols not equal!!',symbol1,symbol2
! write(66,*)' symbols not equal!!',symbol1,symbol2
if(symbol1 read(inqdates,2778,end=98)symbol1,date,qbegrec,qendrec
goto 2
else
! if(symbol>='GY')write(66,*)' ready to read 35'
read(35,2778,end=199)symbol2,date,tbegrec,tendrec
goto 2
endif
endif
!-- new symbol, initialize counters
if(lsym.ne.symbol)then
nrsym=nrsym+1
! if(mod(nrsym,10).eq.0)
!write(6,*)' new symbol= ',symbol,lsym,n
! write(66,*)' new symbol= ',symbol,lsym,n
!& nbsp; write(66,*)ndays,ncon,nq,n,ncor,ng127
if(n.gt.0)call writesym
n=0
nq=0
ndays=0
ncon=0
lsym=symbol
! !write(6,*)' date/year= ',date,year
days(1)=crspd(date-year)
idays(1)=1
! !write(6,*)'first dates= ',date,year,' days1=',days(1),idays(1)
if(days(1).eq.0)then
! write(6,*)' need to run crspday.sas!!!'
stop
endif
ndays=1
ldate=date
lsym=symbol
endif

nn=nn+1

!if(mod(nn,300).eq.0)
!write(6,*)' nn=',nn,' sy= ',symbol,date,tbegrec,tendrec,qbegrec,
!*qendrec
! write(66,*)' nn=',nn,' sy= ',symbol,date,tbegrec,tendrec,qbegrec,
! *qendrec

endtrd=.false.
endqte=.false.
t = tbegrec
q = qbegrec

read(56,rec=t)ttim,pricex,siz,g127,corr,cond,tex
! if(cond.ne.' ')
! if(symbol>='GYRO')write(66,*)' 56 in= ',symbol,ttim,q,t

! !write(6,*)' read 55, q=',q
555 read(inqt,rec=q,err=98)qtim,bidx,ofrx,bidsiz,asksiz,mode,qex,mmid
! if(symbol>='GYRO')write(66,*)' 55 in= ',symbol,date,qtim

okay=.true.
! if(symbol>='GY')write(66,*)' first tq',qtim,ttim,q,t,inqt,inqdates
!================= read in quote ==================================

10 if((qtim.le.ttim.or.endtrd).and..not.endqte)then
! if(symbol>='GYRO')write(66,*)' qtim! * endtrd,endqte
!------------ write quote and read a new one
tq='Q'
bid1=bidx/10000.
ofr1=ofrx/10000.
!-- after 8am
& nbsp; if(okay.and.qtim>=28800)call prepout
q=q+1
if(q.le.qendrec)then
read(inqt,rec=q,err=98)qtim,bidx,ofrx,bidsiz,asksiz &
& ,mode,qex,mmid
! !write(6,8391)symbol,date,qtim,bid1,ofr1,qex,
! * bidsiz,asksiz,mode,q,qendrec
8391 format(' new qte= ',a6,i12,i7,2f9.3,1x,a2,2i5,i4,2i8)
! endif
okay=.true.
else
endqte=.true.
!write(6,*)' end of quotes'
! write(66,*)' end of quotes'
endif
goto 10
endif

if((qtim.gt.ttim.or.endqte).and..not.endtrd)then
!------------------write trade and read a new one
price1=pricex/10000.

if(corr.eq.1)then
lttim = ttim
else
if(corr.eq.12)then
ttim = lttim
!-----------------------NOTE: THIS ALTERS THE OUTPUT SEQUENCE--IT WILL
!-----------------------NOT BE IN SORT ORDER!!!
endif
tq='T'
call prepout
endif
t=t+1
if(t.le.tendrec)then
! if(symbol.eq.'CCI')
! * !write(6,*)' ready to read trade, t,tendr=',t,tendrec
read(56,rec=t)ttim,pricex,siz,g127,corr,  ; &
& cond,tex

! if((symbol.eq.'AA'.or.symbol.eq.'AAABB')
! * .and.date.eq.981016)then
! price1=pricex/100000.0
! !write(6,2829)symbol,date,ttim,price1,siz,
! * tex,t,cond,corr
2829 format(' new trd=',a6,i10,i8,f9.3,i8,1x,a2,i8,1x,a1, &
& ' corr=',i3)
! endif
okay=.true.
else
endtrd=.true.
!write(6,*)' end of trades'
! write(66,*)' end of trades'
endif
endif

if(endtrd.and.endqte)then
endtrd=.false.
endqte=.false.
! write(66,*)' end of trades and quotes for sy= ',lsym,symbol
!-- read next symbol
goto 1
endif
! if(symbol>='GYRO')
! * write(66,*)' going to 10',endtrd,endqte,' qt/tt=',qtim,ttim
goto 10

98 qdfile=qdfile+1
!write(6,*)' at 98= ',lsym,inqt,qdfile,nqf
! write(66,*)' at 98= ',lsym,inqdates,inqt,qdfile,nqf,symbol1,symbol
if((qdfile==1.and.nqf=='1').or.(qdfile==2.and.nqf=='2').or. &
&(qdfile==3.and.nqf=='3'))then
!-- end reading quote f
endqte=.true.
!write(6,*)' end of quotes ',inqf,qfile
! write(66,*)' end of quotes at 98',inqf,qfile
goto 10
endif
inqdates=inqdates+1
!-- update pointer to bin file
inqt=inqt+1;
if(inqdates==31)then
open(inqdates,file=source//'taqp_mastsymdatequotes_2.' &
& // filedate)
open(inqt,file= source//'taqp_mastq'//filedate//'_2.bin', &
& form='binary',access='direct',recl=27)
q=1
read(inqdates,2778,end=98)symbol1,date,qbegrec,qendrec
!write(6,*)inqdates,' open, sym/qbeg=',qbegrec,qendrec
! write(66,*)inqdates,' open, sym1/2= ',symbol1,symbol2
goto 2
endif
if(inqdates==32)then
open(inqdates,file=source//'taqp_mastsymdatequotes_3.' &
& // filedate)
open(inqt,file= source//'taqp_mastq'//filedate//'_3.bin', &
& form='binary',access='direct',recl=27)
q=1
read(inqdates,2778,end=98)symbol1,date,qbegrec,qendrec
!write(6,*)inqdates,' open, sym/qbeg=',qbegrec,qendrec
! write(66,*)inqdates,' open, sym1/2= ',symbol1,symbol2
goto 2
endif

99 continue
!99 qfile=qfile+1 !-- # qte files processed
! !write(6,*)' at 99= ',lsym,inqt,qfile,nqf,inqf
! write(66,*)' at 99= ',lsym,inqt,qfile,nqf,inqf
! if((qfile==1.and.nqf=='1').or.(qfile==2.and.nqf=='2').or.
! *(qfile==3.and.nqf=='3'))then !-- end reading quote fi
! endqte=.true.
! !write(6,*)' end of quotes at 99',inqf,qfile
! write(66,*)' end of quotes at 99',inqf,qfile
! goto 10
! endif
! inqt=inqt+1;&n bsp; !-- update pointer to bin file
! write(6,*)' new inqt= ',inqt,' qfile= ',qfile
! if(inqt==51)then
! open(inqt,file= source//'taqp_mastq'//filedate//'_2.bin',
! * form='binary',access='direct',recl=27)
! q=1
! goto 555 !-- read next quote--save current trade record
! endif
! if(inqt==52)then
! open(inqt,file= source//'taqp_mastq'//filedate//'_3.bin',
! * form='binary',access='direct',recl=27)
! q=1
! !write(6,*)inqt,' open, sym/qbeg='
! write(66,*)inqt,' open, sym/qbeg='
! goto 555
! endif
!
199 write(6,*)' close, sy/inqt/inqdates=',symbol,inqt,inqdates

! write(66,*)' close, sy/inqt/inqdates=',symbol,inqt,inqdates
close(80)

stop
END
end program do_combine

0 Kudos
1 Reply
Steven_L_Intel1
Employee
2,300 Views
You have two END statements. Remove the first one.
0 Kudos
Reply