CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C banks94.for C --------------- C Sample program to read the updated Compustat Annual Bank file. C Written for Stanford GSB's VAX/VMS system for the 1994 data. C To use on Stanford-wide's unix system to read the 1995 data in C /afs/ir/data/gsb/compustat/bank.annual, must at least edit this C program's filename declarations. Also C are the EBCDIC references no longer applicable? Is the format C of the file different? C C This is a copy of the version of the program written by Qiang Wang. C Modified by Qihua Mao on 7/21/1994. C Tailored to gather 1994 data for BEAVER, ENGEL study by C Ellen Engel on 7/28/1994. C Renamed from bkfull94.for, and comments added by Don Cram 9/29/96. C Thank you to Ellen Engel for sharing this. C C The output will be in the files specified by the "open" statements. C C How to run the program (on VAX/VMS): C for bkfull94.for (compile) C link bkfull94 (link) C run bkfull94 (execute) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC character*9954 in_data(4) ! data for read character*70 bbb(143) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C The physical record contains all dta for five (5) consecutive fiscal C years. Since the tape is formatted to carry 20 years of data for each C bank, there are 4 physical records per bank. All data fields on the C tape are presented in IBM EBCDIC code which is compatible with most C non-IBM computers as well as older generation IBM computers. C ------------------------------------------------------------------------- C Format Var Names Description Cumulative Char CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC integer rec ! Record Number(1,2,3 or 4) 1 integer dnum ! Industry classification number 5 character*6 cnum ! CUSIP Issuer Code 11 integer cic ! Issuer Number 14 integer file ! File Identification Code 16 integer zlist ! Exchange Listing 18 integer blank ! Blank(Zero-filled) 20 character*28 coname ! Company Name 48 character*28 iname ! Industry Name 76 character*8 smbl ! Stock Ticker Symbol 84 character*2 aftnt(40,5) ! Annual Footnotes 484 real data(232,5) ! Data Array 9934 integer fyr(5) ! Fiscal Year 9944 integer year(5) ! Data Year 9954 equivalence(in_data,bbb(1)) integer nrec open (unit=1,file= * 'research:[scratch.newbank]1994_bank_annual.dat', * status='old', form='formatted',access='sequential', * readonly) open (unit=2,name='bkfull94.dat',status='new', form= * 'formatted') open (unit=3,name='bad1994.dat',status='new', * form='formatted') do 777 ii=1,20000 C do 100 jj=1,4OOB do 100 jj=1,4 nrec = nrec + 1 read (1,10,end=900) in_data(jj) 10 format(a9954) 100 continue do 200 kk=1,4 k1=kk decode(9954,22,in_data(k1),err=776) rec,dnum,cnum,cic,file, * zlist,blank,coname,iname,smbl,aftnt,data,fyr,year 22 format(i1,i4,a6,i3,3i2,2a28,a8,200a2, * 5(22f8.3,f10.3,12f8.3,f10.3,9f8.3,2f10.3,5f8.3,f10.3, * 22f8.3,f10.3,24f8.3,f10.3,54f8.3,f10.3,53f8.3,3f10.3, * 3f8.3,2f10.3,7f8.3,2f10.3,f8.3,f10.3,3f8.3,f10.6),10i2) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C Insert your code here C 9=geographic code; 23=loans (gross); 36=total assets (gross); C 53=total deposits(worldwide); 54=total domestic deposits; C 55=total foreign deposits; 67=ltd (not class. as capital); C 69=total borrowings; 76=total liabilities; 78=allowance for loan losses; C 84=capital notes and debentures; 86=preferred stock; 88=common stock-par val; C 90=#of shares outstanding; 99=total book value; 105=interest and loan fees; C 116=aggregate loan and investment revenue; 124=total current oper revenue; C 125=# of employtees; 126=salaries of officers and employees; C 135=provision for loan losses; 137=total interest expense; C 144=total current operating expense; 145=income before income taxes; C 146=taxes on curr. operating earnings; 160=after-tax&min int SGL; C 161=net income; 177=cash dividends; C 190=net charge-offs; 193= net current operating EPS (bef x-items); C 196=common shares; 201=common dividends; 205=closing price; C 232=adjustment factor; 42=net interest margin; 48=RACR-tier 1; C 64=RACR-total; 19=interst income -total fin serv C 8=total investment securities; 10=trading account securities; C 11=federal funds sold and sec purch to resell; C 114=trading account interest; 122=interest due from banks C 113=other interest income; CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC do 300 i1 = 1,5 write(2,30) ii,coname,dnum,cnum,smbl, * cic,year(i1),data(9,i1), * data(23,i1),data(36,i1),data(53,i1),data(54,i1), * data(55,i1),data(67,i1),data(69,i1),data(76,i1), * data(78,i1),data(84,i1),data(86,i1),data(88,i1), * data(90,i1),data(99,i1),data(105,i1),data(116,i1), * data(124,i1),data(125,i1),data(126,i1),data(135,i1), * data(137,i1),data(144,i1),data(145,i1),data(146,i1), * data(160,i1),data(161,i1),data(177,i1),data(190,i1), * data(193,i1),data(196,i1),data(201,i1),data(205,i1), * data(232,i1),data(42,i1),data(48,i1),data(64,i1), * data(19,i1),data(8,i1),data(10,i1),data(11,i1), * data(113,i1),data(114,i1),data(122,i1) 30 format(x,i6,x,a28,x,i4,x,a6,x,a8,x,i3,x,i4,x,f12.4,x,/, * 4(3x,9f12.4,/),7f12.4,x) 300 continue 200 continue goto 777 776 write(2,400) ii 400 format(1x,'ERROR at ii=',i6,/) 500 write(3,501) ii, bbb 501 format(x,'ii= ',i6,143(3x,a70,/)) 777 continue 900 write(*,9000) nrec 9000 format(x,'Number of records = ',i6) close (unit=1) close (unit=2) close (unit=3) stop end