x cd /pub/data/bankdeps/Tools; %let pgm=mobrnchs05; filename pgm "&pgm..sas"; ****See instidata_layout.txt on my c: drive for template to help read the institutions data***; *--modified 5-23-05 -; *---Read the .csv file downloaded from the FDIC web site with June 30 (year) bank deposits by branch for Missouri. FIPS county codes now provided on file. ( and HQ state fips codes?) ******** (Note: edited input, changing all trailing '0d'x crs to commas or nulls.) ***** See job modpsts.sas (or modpsts04.sas) for setup to aggregate these data. ---*; %let datadate=30JUN04; %let yy=%substr(&datadate,6,2); libname bankdeps '/pub/data/bankdeps'; filename text 'sasfmat.sas'; *--the branch level input data was downloaded by going to the FDIC site at http://www2.fdic.gov/sod/ , clicking on "download" and then selecting Missouri. All variables for the branch file were specified. The institutions.csv file was downloaded from the same site, via an exe file that had 2 files inside it, 1 with the latest institution directory data and the other with metadata. We renamed these. We probably will not have to read these every cycle. --; filename in "/pub/data/bankdeps/mo_20&yy..csv"; filename inst_in '/pub/data/bankdeps/institutions.csv'; title "Missouri Bank Branch Deposits File"; options ls=120 ps=119 ; data branches; infile in dsd missover firstobs=2 lrecl=1024 ; length date 8 cert $5 BankName $64 branchname address $64 city $16 zip $5 county $5 cntyname $16 deposits 5 city2m brcenm $1; length brnum $4 brtype $4; label cert='FDIC Cert No' docket='OTS Docket No' bankname='Branch name' deposits='Deposits ($000)' address='Branch Address' brcenm='Branch code'; length _msanambr _regnambr _cmsanamb _cntrynab $32 ; retain date "&datadate"d; *<=====; format date mmddyy6.; *--2004 input stmt--; input _certin BankName $ _callymd $ brnum $ address $ _bkbr $ _BRHQRT $ _BRSERTYP $ _FORMCFRB $ brcenm city city2m _csaname $ _csabr $ _CENCODE $ _cbsaname $ _cbsabr $ cntyname _cnty _RECTYPE $ deposits _REGNAMBR $ _REGNUMBR $ _CMSABR $ _CMSANAMB $ _CNTRYNAB $ _BKMO $ _MetroBR $ _cbsa_div_namb _divisionb $ _cbsa_metro_nameb $ _cbsa_metrob $ _mircrobr $ _msabr $ _msanambr branchname $ _necnamb $ _necmsasbr $ brtype $ _placenum $ _reptdte $ _BOOK $ county $ _STALPBR $ _STNAMEBR $ _STNUMBR _FORMTFRB _uninumbr$ zip $; if _certin=. then delete; if brcenm='"' then brcenm=' '; cert=put(_certin,z5.); county=put(_stnumbr,z2.)||put(_cnty,z3.); format deposits dollar12.; drop _: ; if _n_ le 5 then put / _all_; run; proc sort out=bankdeps.mobrn&yy(label="MO bank branch deposits, 6/30/20&yy"); by cert; run; ods proclabel 'Proc Print Output'; ods pdf file="&pgm..pdf"; ods listing close; proc print data=bankdeps.mobrn&yy(obs=200 ); title "bankdeps.mobrn&yy"; run; ods proclabel 'Proc Contents Output'; proc contents data=bankdeps.mobrn&yy; run; ods proclabel 'Proc Freq Output'; proc freq data=bankdeps.mobrn&yy; table brtype brcenm; tables county*cntyname/list missing; run; ods pdf close;