x cd /pub/data/bankdeps/Tools; %let pgm=mobrnchsxx; filename pgm "&pgm..sas"; *---Read the .csv files with 20xx data 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?) ---Nov. 2013 we created this re-useable XX version, where before we had a separate module for each year.---- See job modpsts.sas for setup to aggregate these data. Running with 2015 data 11-11-15. Running with 2016 data 11-09-16. ---*; libname bankdeps '/pub/data/bankdeps'; title "Missouri Bank Branch Deposits File"; *--the branch level input data was downloaded by going to the FDIC site at http://www2.fdic.gov/sod/ , clicking on "SOD download" and then selecting Missouri. All variables for the branch file were specified. --; %macro doit(datadate); %let yy=%substr(&datadate,6,2); filename in "/pub/data/bankdeps/MO_20&yy._Data.csv"; options ls=120 ps=119 ; data branches; infile in dsd termstr=crlf missover firstobs=2 lrecl=1024 ; length date 8 cert $5 BankName $64 branchname address $64 city _city2br $16 zip $5 county $5 cntyname $16 deposits 5 brcenm $3; *--brcenm length changed from 1 to 3 for 2015--; length brnum $4 brtype $4; length _Rpt_Yr $4 ; label cert='FDIC Cert No' bankname='Bankname' deposits='Deposits ($000)' address='Branch Address' brcenm='Branch code'; retain date "&datadate"d; *<=====; format date mmddyy6.; retain _yy "&yy"; if _yy=13 then input _certin BankName brnum _Rpt_yr address branchname brtype brcenm city _city2br _csanambr $ _csabr $ _consold $ _cntynamb $ _cntynum deposits _usa $ _cntrynab $ _bkmo $ _metrobr $ _cbsa_div_namb $ divisionb $ _msanambr $ _msabr $ _mircorbr $ _necnamb $ _nectabr $ _placenum _SIMS_ACQUIRED $ SIMS_Description $ SIMS_Established $ SIMS_Latitude $ SIMS_Longitude $ SIMS_Projection $ _STCNTYBR _STALPBR $ _STNAMEBR $ _STNUMBR $ UNINUMBR zip ; else input _certin BankName brnum address branchname brtype brcenm city _city2br _csanambr $ _csabr $ _consold $ _cntynamb $ _cntynum deposits _usa $ _cntrynab $ _bkmo $ _metrobr $ _cbsa_div_namb $ divisionb $ _msanambr $ _msabr $ _mircorbr $ _necnamb $ _nectabr $ _placenum _SIMS_ACQUIRED $ SIMS_Description $ SIMS_Established $ SIMS_Latitude $ SIMS_Longitude $ SIMS_Projection $ _STCNTYBR _STALPBR $ _STNAMEBR $ _STNUMBR $ UNINUMBR zip ; if _certin=. then delete; cert=put(_certin,z5.); if brcenm='"' then brcenm=' '; county=put(_stcntybr,z5.); cntyname=put(county,$county16.); format deposits dollar12.; drop _: SIMS: ; 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'; 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; *<====================NEW for 2016 data: we update the Datasets data set to add the new entry for set being created.==; %let yr=&yy; %let _year=20&yy; %doset(memname=mobrn&yr,template=_template_mobrn,libname=bankdeps, CreatePgm=mobrnchsxx); run; proc datasets library=bankdeps nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options mprint msglevel=i; %gendshtm(libname=bankdeps,debug=1,runprocc=1); %mend doit; options mprint; %***doit(30JUN12); %***doit(30JUN13); %***doit(30JUN15); %doit(30JUN16);