x cd /pub/data/bankdeps/Tools; %let pgm=mobrnchs04; filename pgm "&pgm..sas"; ****See instidata_layout.txt on my c: drive for template to help read the institutions data***; *--modified 1-7-04 to process new June 2003 deposit data downloaded from fdic site in new format--; *---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=30JUN03; %let yy=%substr(&datadate,6,2); 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 file was downloaded to oseda via the AIX Netscape browser using the download function on FDIC page. 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'; libname bankdeps '/pub/data/bankdeps'; title "Missouri Bank Branch Deposits File"; options ls=120 ps=119 ; proc format ddname=library; %include '/pub/sas/formats/Sstnmfps.sas'; run cancel; /*<=========================Comment out===================================== *---------Step 1: Read the institutions directory CSV file, creating bankdeps.usinstitutions-----*; data institutions (compress=yes); infile inst_in missover dsd lrecl=32767 firstobs=2 ; length _STNAME $16 CERT $5 DOCKET $8 Name $48 ADDRESS $29 city $11 ZIP $5 County $5 State $2 CntyName $11; informat ACTIVE best32. ; informat ASSET comma14. BKCLASS $2. CHANGEC1 best32. ; informat CHANGEC2 best32. CHANGEC3 best32. CHANGEC4 best32. CHANGEC5 best32. CHARTER best32. CHRTAGNT $5. CONSERVE $1. CLCODE best32. DATEUPDT yymmdd10. DENOVO best32. DEP comma14. EFFDATE yymmdd10. ENDEFYMD yymmdd10. EQ comma14. ESTYMD yymmdd10. FDICDBS best32. FED best32. FED_RSSD best32. FEDCHRTR best32. IBA best32. INACTIVE best32. INSAGNT1 $3. INSAGNT2 $5. INSDATE yymmdd10. INSTCRCD best32. INSBIF best32. INSCOML best32. INSFDIC best32. INSSAIF best32. INSSAVE best32. NEWCERT best32. OAKAR best32. OCCDIST best32. OTSDIST best32. PROCDATE yymmdd10. QBPRCOML best32. REPDTE yymmdd10. RISDATE yymmdd10. STCHRTR best32. ; informat ROA best32. ROAQ comma12.2 ROE best32. ROEQ best32. RUNDATE yymmdd10. SASSER best32. STALP $2. WEBADDR $39. FLDOFF $14. REGAGNT $4. ; informat MSAName $50. CMSAName $72. OTSREGNM $1. ; informat FDICREGN $12. OFFICES best32. CITYHCR $14. ; informat DEPDOM comma16. FORM31 best32. HCTMULT best32. ; informat INSTAG best32. MUTUAL best32. NAMEHCR $50. ; informat NETINC comma12. NETINCQ comma12. OFFDOM best32. ; informat OFFFOR best32. RSSDHCR best32. STALPHCR $3. ; informat STMULT best32. SUBCHAPS best32. FDICSUPV $8. ; informat PARCERT comma12. ROAPTX best32. ROAPTXQ best32. ; informat TRUST best32. CERTCONS comma12. MSA $4. CMSA2 $2. SPECGRP best32. SPECGRPN $43. ; format DATEUPDT yymmdd10. ; format EFFDATE yymmdd10. ; format ENDEFYMD yymmdd10. ; format ESTYMD yymmdd10. ; format INSDATE yymmdd10. ; format PROCDATE yymmdd10. ; format REPDTE yymmdd10. ; format RISDATE yymmdd10. ; format RUNDATE yymmdd10. ; format asset dep comma13. parcert certons comma12. netinc netincq comma12. depdom eq comma13.; input _STNAME $ _CERT _docket ACTIVE ADDRESS $ ASSET BKCLASS $ CHANGEC1 CHANGEC2 CHANGEC3 CHANGEC4 CHANGEC5 CHARTER CHRTAGNT $ CONSERVE $ CITY $ CLCODE DATEUPDT DENOVO DEP EFFDATE ENDEFYMD EQ ESTYMD FDICDBS FED FED_RSSD FEDCHRTR IBA INACTIVE INSAGNT1 $ INSAGNT2 $ INSDATE INSTCRCD INSBIF INSCOML INSFDIC INSSAIF INSSAVE NAME $ NEWCERT OAKAR OCCDIST OTSDIST PROCDATE QBPRCOML REPDTE RISDATE STCHRTR ROA ROAQ ROE ROEQ RUNDATE SASSER STALP $ County WEBADDR $ ZIP FLDOFF $ REGAGNT $ CntyName $ MSAName $ CMSAName $ OTSREGNM $ FDICREGN $ OFFICES CITYHCR $ DEPDOM FORM31 HCTMULT INSTAG MUTUAL NAMEHCR $ NETINC NETINCQ OFFDOM OFFFOR RSSDHCR STALPHCR $ STMULT SUBCHAPS FDICSUPV $ PARCERT ROAPTX ROAPTXQ TRUST CERTCONS MSA $ CMSA2 $ SPECGRP SPECGRPN $ ; if _cert then cert=put(_cert,z5.); if _docket then docket=put(_docket,z8.); *--create as char strings with leading zeroes--; if length(county)=4 then county='0'||county; State=substr(county,1,2); *--chop extra cr character off last field--; _l=length(specgrpn); if _l> 1 then specgrpn=substr(specgrpn,1,_l-1); else if _l=1 then specgrpn=' '; drop _:; run; proc sort out=bankdeps.usinstitutions(index=(state)); by state cert docket; run; proc sql ; create view bankdeps.moinstitutions as select * from usinstitutions where state='29'; quit; ===========================End commented out================================ */ data branches; infile in dsd missover firstobs=2 lrecl=512 ; length date 8 cert $5 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.; input _CERTin _CALLYMD $ _UNINUMBR $ address _BKBR $ _BRHQRT $ _BRSERTYP $ _FORMCFRB $ brcenm city city2m _CENCODE $ cntyname _cnty _RECTYPE $ deposits _REGNAMBR $ _REGNUMBR $ _CMSABR $ _CMSANAMB $ _CNTRYNAB $ _BKMO $ _MSABR $ _MSANAMBR $ branchname $ BRNUM $ BRTYPE $ _PLACENUM $ _REPDTE $ _BOOK $ county $ _STALPBR $ _STNAMEBR $ _STNUMBR _FORMTFRB $ zip $; ** if hqstname='Missouri' then hqstate='29'; ** else hqstate=put(hqstname,$stnmfps.); if _certin=. then delete; if brcenm='"' then brcenm=' '; cert=put(_certin,z5.); *docket=put(_dockin,z8.); if _n_ le 5 then put / _all_; county=put(_stnumbr,z2.)||put(_cnty,z3.); format deposits dollar12.; drop _: ; run; proc contents data=branches position; run; proc sort; by cert; run; *---Use the institution level set to add some variables for the bank as opposed to the branch--; data bankdeps.mobrn&yy(label="MO Bank Branch Deposits, 6/30/20&yy"); merge branches(in=inbr) bankdeps.moinstitutions(in=ininst keep=cert docket name bkclass rename=(name=Bankname)); by cert; if inbr; run; ods proclabel 'Proc Print Output'; ods pdf file="/pub/reports/temp/&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;