x cd /mscdc/data/bankdeps/Tools; %let pgm=mobrnchs; filename pgm "&pgm..sas"; *--modified 1-29-01 to process new June 2000 deposit data downloaded from fdic site--; *---Read the .csv file downloaded from the FDIC web site with July 99 bank deposits by branch for Missouri. Add FIPS county codes and HQ state fips codes. ******** (Note: edited input, changing all trailing '0d'x crs to commas or nulls.) ***** Coded 6-00, jgb, to process 1999 data, from the model setup used for '97 data. See job modpsts.sas (or modpsts99.sas) for setup to aggregate these data. ---*; *let datadate=30JUN99; *--we also changed all occurrences of '99' to '00'---; %let datadate=30JUN00; filename text 'sasfmat.sas'; *--the input data was downloaded by going to the FDIC site at http://www2.fdic.gov/sod/ , clicking on "download" and then selecting Missouri. The zip file was ftped to oseda and then unzipped to create mo_2000.csv .--; filename in '/mscdc/data/bankdeps/mo_2000.csv'; *<====edit==; libname bankdeps '/mscdc/data/bankdeps'; title "Missouri Bank Branch Deposits File"; options ls=120 ps=119 ; proc format ddname=library; %include '/mscdc/sas/formats/Sstnmfps.sas'; run; data bankdeps.mobrn00(label='MO Bank Branch Deposits, 6/00'); infile in dsd missover firstobs=2 ; ****obs=10; length date 8 cert $5 docket $8 bankname $64 address $64 city $16 zip $5 county $5 cntyname $16 deposits 5 bkclass $2 city2m hqcity $16 brcenm $1; label cert='FDIC Cert No' docket='OTS Docket No' bankname='Branch name' deposits='Deposits ($000)' address='Branch Address' bkclass='Institution Class' hqcity='Headquarters City' brcenm='Branch code'; length statenm hqstname city2m msaname cmsaname dum $20; *--these varaiables are not kept because declaring them here means they are not in the data--brcenm var. interval we use in the keep stmt, below---; retain date "&datadate"d; *<=====; format date mmddyy6.; *<===note that we have city in here twice(?) Appears to be a problem with input file-; input dum certin dockin bankname address city city statenm zip cntyname msaname cmsaname deposits bkclass city2m hqcity hqstname brcenm; *--create edited arg to use for looking up the fips county code--; _ic=index(cntyname,'(City)'); if _ic then county='29510'; else do; _arg=compress(cntyname,"'."); *<--remove periods and apostrophes-; Length _arg $16; _arg=upcase( "MO "||_arg); *-e.g. "MO ADAIR"-; county=put(_arg,$cnam2fp.); end; if county=:_arg then do; county=' '; put _arg=; end; if hqstname='Missouri' then hqstate='29'; else hqstate=put(hqstname,$stnmfps.); if brcenm='"' then brcenm=' '; cert=put(certin,z5.); docket=put(dockin,z8.); if _n_ le 5 then put / _all_; keep date--brcenm hqstate; format deposits dollar12.; run; proc print data=bankdeps.mobrn00(obs=200 ); run; proc contents; run; proc freq data=bankdeps.mobrn00; table hqstate brcenm; tables county*cntyname/list missing; run;