%LET DRIVE  = \\filer6\dces\dces-public\Branches\Phase 4 Production (BIA)\Microdata\Historic PUMD\Pre-96-data-doc\Data\Data-1990-91\INTRVW90;
LIBNAME OUTPUT 'P:\Branches\Phase 4 Production (BIA)\Microdata\Historic PUMD\Pre-96-data-doc\1990SASCD';
%LET YR = 90;

%MACRO FMLI(FILE=, YEAR=, QUARTER=);
DATA &FILE.&YEAR.&QUARTER;
INFILE "&DRIVE.\FMLYI&YEAR.&QUARTER..txt";
INPUT 
@1 NEWID 8.
@9 ACCESS $1.
@10 ACCESS_ $1.
@11 AGE_REF 3.
@14 AGE_REF_ $1.
@15 AGE2 3.
@18 AGE2_ $1.
@21 AIR_TYPE $1.
@22 AIR__YPE $1.
@23 AIRCOND $1.
@24 AIRCOND_ $1.
@25 ALIMOX 8.
@33 ALIMOX_ $1.
@34 APARTMNT $1.
@35 APAR_MNT $1.
@36 APT_NOQ 4.
@40 APT_NOQ_ $1.
@41 AS_COMP1 2.
@43 AS_C_MP1 $1.
@44 AS_COMP2 2.
@46 AS_C_MP2 $1.
@47 AS_COMP3 2.
@49 AS_C_MP3 $1.
@50 AS_COMP4 2.
@52 AS_C_MP4 $1.
@53 AS_COMP5 2.
@55 AS_C_MP5 $1.
@56 BARN $1.
@57 BARN_ $1.
@62 BATHRMQ 3.
@65 BATHRMQ_ $1.
@66 BEDROOMQ 3.
@69 BEDR_OMQ $1.
@70 BLS_URBN $1.
@71 BOTTLED $2.
@73 BOTTLED_ $1.
@74 BSINVSTX 10.
@84 BSIN_STX $1.
@85 BUILDING $2.
@87 BUIL_ING $1.
@88 BUILT $2.
@90 BUILT_ $1.
@91 CBSGFTX 8.
@99 CBSGFTX_ $1.
@100 CHLDSUPX 8.
@108 CHLD_UPX $1.
@109 CKBKACTX 10.
@119 CKBK_CTX $1.
@120 CLLGEQTR $1.
@121 CLLG_QTR $1.
@122 CNTEDORX 8.
@130 CNTE_ORX $1.
@131 CNTRCHRX 8.
@139 CNTR_HRX $1.
@140 CNTRELGX 8.
@148 CNTR_LGX $1.
@149 CNTRPOLX 8.
@157 CNTR_OLX $1.
@158 COALCOOK $2.
@160 COAL_OOK $1.
@161 COLLEXPX 8.
@169 COLL_XPX $1.
@172 COMPBND $1.
@173 COMPBND_ $1.
@174 COMPBNDX 8.
@182 COMP_NDX $1.
@183 COMPCKG $1.
@184 COMPCKG_ $1.
@185 COMPCKGX 8.
@193 COMP_KGX $1.
@194 COMPENSX 8.
@202 COMP_NSX $1.
@207 COMPOWD $1.
@208 COMPOWD_ $1.
@209 COMPOWDX 8.
@217 COMP_WDX $1.
@218 COMPSAV $1.
@219 COMPSAV_ $1.
@220 COMPSAVX 8.
@228 COMP_AVX $1.
@229 COMPSEC $1.
@230 COMPSEC_ $1.
@231 COMPSECX 8.
@239 COMP_ECX $1.
@254 CSHCNTBX 8.
@262 CSHC_TBX $1.
@263 CUREMPL1 $1.
@264 CURE_PL1 $1.
@265 CUREMPL2 $1.
@266 CURE_PL2 $1.
@267 CUTENURE $1.
@268 CUTE_URE $1.
@269 DONTKNOW $2.
@271 DONT_NOW $1.
@272 EARNCOMP $1.
@273 EARN_OMP $1.
@274 EARNINCX 9.
@283 EARN_NCX $1.
@284 EDUC_REF $1.
@285 EDUC0REF $1.
@286 EDUCA2 $1.
@288 EDUCA2_ $1.
@289 ELECCOOK $2.
@291 ELEC_OOK $1.
@292 ELECTRIC $2.
@294 ELEC_RIC $1.
@295 ENCPORCH $1.
@296 ENCP_RCH $1.
@297 ERANK 9.
@306 ERANK_ $1.
@307 ERANKU 9.
@316 ERANKU_ $1.
@335 FAM_SIZE 2.
@337 FAM__IZE $1.
@338 FAM_TYPE $1.
@339 FAM__YPE $1.
@340 FAMTFEDX 8.
@348 FAMT_EDX $1.
@349 FEDRFNDX 8.
@357 FEDR_NDX $1.
@358 FEDTAXX 8.
@366 FEDTAXX_ $1.
@367 FFRMINCX 9.
@376 FFRM_NCX $1.
@377 FGOVRETX 8.
@385 FGOV_ETX $1.
@386 FINCATAX 9.
@395 FINCAT_X $1.
@396 FINCBTAX 9.
@405 FINCBT_X $1.
@406 FINDRETX 8.
@414 FIND_ETX $1.
@415 FININCX 8.
@423 FININCX_ $1.
@424 FINLWT21 11.
@439 FJSSDEDX 8.
@447 FJSS_EDX $1.
@448 FNONFRMX 9.
@457 FNON_RMX $1.
@458 FORCEAIR $2.
@460 FORC_AIR $1.
@463 FPRIPENX 8.
@471 FPRI_ENX $1.
@472 FRRDEDX 8.
@480 FRRDEDX_ $1.
@481 FRRETIRX 8.
@489 FRRE_IRX $1.
@490 FSALARYX 8.
@498 FSAL_RYX $1.
@499 FSLTAXX 8.
@507 FSLTAXX_ $1.
@508 FSSIX 8.
@516 FSSIX_ $1.
@517 FUEL_OIL $2.
@519 FUEL0OIL $1.
@520 GAS $2.
@522 GAS_ $1.
@523 GOVTCOST $1.
@524 GOVT_OST $1.
@525 GRAVTAIR $2.
@527 GRAV_AIR $1.
@528 GREENHSE $1.
@529 GREE_HSE $1.
@530 GUESTHSE $1.
@531 GUES_HSE $1.
@532 HALFSAMP $1.
@533 HALF_AMP $1.
@534 HEATFUEL $1.
@535 HEAT_UEL $1.
@538 HLFBATHQ 3.
@541 HLFB_THQ $1.
@542 HTPUMPCT $2.
@544 HTPU_PCT $1.
@545 HTPUMPWL $2.
@547 HTPU_PWL $1.
@548 INC_HRS1 3.
@551 INC__RS1 $1.
@552 INC_HRS2 3.
@555 INC__RS2 $1.
@556 INC_RANK 9.
@565 INC__ANK $1.
@566 INC_RNKU 9.
@575 INC__NKU $1.
@576 INCCONTX 8.
@584 INCC_NTX $1.
@585 INCLASS $1.
@586 INCLOSSA 8.
@594 INCL_SSA $1.
@595 INCLOSSB 8.
@603 INCL_SSB $1.
@604 INCNONW1 $1.
@605 INCN_NW1 $1.
@606 INCNONW2 $1.
@607 INCN_NW2 $1.
@608 INCOMEY1 $1.
@609 INCO_EY1 $1.
@610 INCOMEY2 $1.
@611 INCO_EY2 $1.
@612 INCSTAT1 $1.
@613 INCS_AT1 $1.
@614 INCSTAT2 $1.
@615 INCS_AT2 $1.
@616 INCWEEK1 2.
@618 INCW_EK1 $1.
@619 INCWEEK2 2.
@621 INCW_EK2 $1.
@622 INSRFNDX 8.
@630 INSR_NDX $1.
@631 INTEARNX 8.
@639 INTE_RNX $1.
@640 JFDSTMPA 8.
@648 JFDS_MPA $1.
@649 MISCTAXX 8.
@657 MISC_AXX $1.
@658 KEROSENE $2.
@660 KERO_ENE $1.
@661 LOT_SIZE $2.
@663 LOT__IZE $1.
@664 LUMPSUMX 8.
@672 LUMP_UMX $1.
@673 MARITAL1 $1.
@674 MARI_AL1 $1.
@675 MISCNTRX 8.
@683 MISC_TRX $1.
@684 MONYOWDX 8.
@692 MONY_WDX $1.
@693 NO_EARNR 2.
@695 NO_E_RNR $1.
@696 NO_EARNX 9.
@705 NO_E_RNX $1.
@706 NO_FUEL $2.
@708 NO_FUEL_ $1.
@709 NO_HEAT $2.
@711 NO_HEAT_ $1.
@712 NONINCMX 8.
@720 NONI_CMX $1.
@721 NUM_AUTO 2.
@723 NUM__UTO $1.
@724 OCCEXPNX 8.
@732 OCCE_PNX $1.
@733 OCCUPRE1 $2.
@735 OCCU_RE1 $1.
@736 OCCUPRE2 $2.
@738 OCCU_RE2 $1.
@739 ORIGIN1 $1.
@740 ORIGIN1_ $1.
@741 ORIGIN2 $1.
@742 ORIGIN2_ $1.
@743 OTH_COOK $2.
@745 OTH__OOK $1.
@746 OTHERHT $2.
@748 OTHERHT_ $1.
@749 OTHRFNDX 8.
@757 OTHR_NDX $1.
@758 OTHRINCX 8.
@766 OTHR_NCX $1.
@773 PATIO $1.
@774 PATIO_ $1.
@775 PENSIONX 8.
@783 PENS_ONX $1.
@784 PERSLT18 2.
@786 PERS_T18 $1.
@787 PERSOT64 2.
@789 PERS_T64 $1.
@792 POPSIZE $1.
@793 PRINEARN $2.
@795 PRIN_ARN $1.
@796 PTAXRFDX 8.
@804 PTAX_FDX $1.
@805 PUBLHOUS $1.
@806 PUBL_OUS $1.
@809 PURSSECX 8.
@817 PURS_ECX $1.
@818 QINTRVMO $2.
@820 QINTRVYR $2.
@822 QPREVIN1 $2.
@824 QPRE_IN1 $1.
@825 QPREVIN2 $2.
@827 QPRE_IN2 $1.
@828 RACE2 $1.
@829 RACE2_ $1.
@830 REF_RACE $1.
@831 REF__ACE $1.
@832 REGION $1.
@833 RENTEQVX 6.
@839 RENT_QVX $1.
@840 RESPSTAT $1.
@841 RESP_TAT $1.
@842 RMWFLUE $2.
@844 RMWFLUE_ $1.
@845 RMWOFLUE $2.
@847 RMWO_LUE $1.
@848 ROOMSQ 3.
@851 ROOMSQ_ $1.
@852 SALEINCX 8.
@860 SALE_NCX $1.
@861 SAVACCTX 10.
@871 SAVA_CTX $1.
@872 SECESTX 10.
@882 SECESTX_ $1.
@883 SELLSECX 10.
@893 SELL_ECX $1.
@894 SETLINSX 8.
@902 SETL_NSX $1.
@903 SEX_REF $1.
@904 SEX_REF_ $1.
@905 SEX2 $1.
@906 SEX2_ $1.
@907 SIMHOUS $1.
@908 SIMHOUS_ $1.
@909 SIMHOUSX 6.
@915 SIMH_USX $1.
@916 SLOCTAXX 8.
@924 SLOC_AXX $1.
@925 SLRFUNDX 8.
@933 SLRF_NDX $1.
@934 SMSASTAT $1.
@935 SOLARCK $2.
@937 SOLARCK_ $1.
@938 SOLARHT $2.
@940 SOLARHT_ $1.
@941 SSOVERPX 8.
@949 SSOV_RPX $1.
@950 ST_HOUS $1.
@951 ST_HOUS_ $1.
@952 STEAMSYS $2.
@954 STEA_SYS $1.
@955 STORIES $2.
@957 STORIES_ $1.
@958 SWIMPOOL $1.
@959 SWIM_OOL $1.
@960 TAXPROPX 8.
@968 TAXP_OPX $1.
@969 TENNISCT $1.
@970 TENN_SCT $1.
@971 TERRACE $1.
@972 TERRACE_ $1.
@973 TOTTXPDX 9.
@982 TOTT_PDX $1.
@983 UNEMPLX 8.
@991 UNEMPLX_ $1.
@992 USBNDX 8.
@1000 USBNDX_ $1.
@1001 VEHQ 2.
@1003 VEHQ_ $1.
@1004 WALLFURN $2.
@1006 WALL_URN $1.
@1007 WATER $1.
@1008 WATER_ $1.
@1009 WATERHT $1.
@1010 WATERHT_ $1.
@1011 WDBSASTX 10.
@1021 WDBS_STX $1.
@1022 WDBSGDSX 8.
@1030 WDBS_DSX $1.
@1031 WELFAREX 8.
@1039 WELF_REX $1.
@1040 WOODCOOK $2.
@1042 WOOD_OOK $1.
@1043 WTREP01 11.
@1054 WTREP02 11.
@1065 WTREP03 11.
@1076 WTREP04 11.
@1087 WTREP05 11.
@1098 WTREP06 11.
@1109 WTREP07 11.
@1120 WTREP08 11.
@1131 WTREP09 11.
@1142 WTREP10 11.
@1153 WTREP11 11.
@1164 WTREP12 11.
@1175 WTREP13 11.
@1186 WTREP14 11.
@1197 WTREP15 11.
@1208 WTREP16 11.
@1219 WTREP17 11.
@1230 WTREP18 11.
@1241 WTREP19 11.
@1252 WTREP20 11.
@1263 WTREP21 11.
@1274 WTREP22 11.
@1285 WTREP23 11.
@1296 WTREP24 11.
@1307 WTREP25 11.
@1318 WTREP26 11.
@1329 WTREP27 11.
@1340 WTREP28 11.
@1351 WTREP29 11.
@1362 WTREP30 11.
@1373 WTREP31 11.
@1384 WTREP32 11.
@1395 WTREP33 11.
@1406 WTREP34 11.
@1417 WTREP35 11.
@1428 WTREP36 11.
@1439 WTREP37 11.
@1450 WTREP38 11.
@1461 WTREP39 11.
@1472 WTREP40 11.
@1483 WTREP41 11.
@1494 WTREP42 11.
@1505 WTREP43 11.
@1516 WTREP44 11.
@1527 TOTEXPPQ 12.
@1539 TOTEXPCQ 12.
@1551 FOODPQ 12.
@1563 FOODCQ 12.
@1575 FDHOMEPQ 12.
@1587 FDHOMECQ 12.
@1599 FDAWAYPQ 12.
@1611 FDAWAYCQ 12.
@1623 ALCBEVPQ 12.
@1635 ALCBEVCQ 12.
@1647 HOUSPQ 12.
@1659 HOUSCQ 12.
@1671 SHELTPQ 12.
@1683 SHELTCQ 12.
@1695 OWNDWEPQ 12.
@1707 OWNDWECQ 12.
@1719 RENDWEPQ 12.
@1731 RENDWECQ 12.
@1743 OTHLODPQ 12.
@1755 OTHLODCQ 12.
@1767 UTILPQ 12.
@1779 UTILCQ 12.
@1791 HOUSOPPQ 12.
@1803 HOUSOPCQ 12.
@1815 HOUSEQPQ 12.
@1827 HOUSEQCQ 12.
@1839 APPARPQ 12.
@1851 APPARCQ 12.
@1863 TRANSPQ 12.
@1875 TRANSCQ 12.
@1887 VEHICLPQ 12.
@1899 VEHICLCQ 12.
@1911 GASMOPQ 12.
@1923 GASMOCQ 12.
@1935 OTHVEHPQ 12.
@1947 OTHVEHCQ 12.
@1959 PUBTRAPQ 12.
@1971 PUBTRACQ 12.
@1983 HEALTHPQ 12.
@1995 HEALTHCQ 12.
@2007 ENTERTPQ 12.
@2019 ENTERTCQ 12.
@2031 PERSCAPQ 12.
@2043 PERSCACQ 12.
@2055 READPQ 12.
@2067 READCQ 12.
@2079 EDUCAPQ 12.
@2091 EDUCACQ 12.
@2103 TOBACCPQ 12.
@2115 TOBACCCQ 12.
@2127 MISCPQ 12.
@2139 MISCCQ 12.
@2151 CASHCOPQ 12.
@2163 CASHCOCQ 12.
@2175 PERINSPQ 12.
@2187 PERINSCQ 12.
@2199 LIFINSPQ 12.
@2211 LIFINSCQ 12.
@2223 RETPENPQ 12.
@2235 RETPENCQ 12.
@2247 PARKOFST $1.
@2248 PARK_FST $1.
@2249 HH_CU_Q 2.
@2251 HH_CU_Q_ $1.
@2252 HHID 3.
@2255 HHID_ $1.
@2256 POV_CY $1.
@2257 POV_CY_ $1.
@2258 POV_PY $1.
@2259 POV_PY_ $1.
;

RUN;

%MEND FMLI;
%MACRO MEMI(FILE=, YEAR=, QUARTER=);
DATA &FILE.&YEAR.&QUARTER;
INFILE "&DRIVE.\MEMBI&YEAR.&QUARTER..txt";
INPUT 
@1 NEWID 8.
@9 AGE 3.
@12 AGE_ $1.
@13 AMTFED 8.
@21 AMTFED_ $1.
@22 ANFEDTX 8.
@30 ANFEDTX_ $1.
@31 ANGOVRTX 8.
@39 ANGO_RTX $1.
@40 ANPRVPNX 8.
@48 ANPR_PNX $1.
@49 ANRRDEDX 8.
@57 ANRR_EDX $1.
@58 ANSLTX 8.
@66 ANSLTX_ $1.
@67 ARM_FORC $1.
@68 ARM__ORC $1.
@71 BSNSSTAT $1.
@72 BSNS_TAT $1.
@73 COMPLET $1.
@74 COMPLET_ $1.
@75 CU_CODE $1.
@76 CU_CODE_ $1.
@77 CUREMPL $1.
@78 CUREMPL_ $1.
@79 EARNER $1.
@80 EARNER_ $1.
@81 EARNTYPE $1.
@82 EARN_YPE $1.
@83 EDUCA $2.
@85 EDUCA_ $1.
@86 EMPLCONT $1.
@87 EMPL_ONT $1.
@88 FARMINCX 10.
@98 FARM_NCX $1.
@99 FARMLOSS $1.
@100 FARM_OSS $1.
@101 GOVRETX 8.
@109 GOVRETX_ $1.
@110 GROSPAYX 10.
@120 GROS_AYX $1.
@121 IN_COLL $1.
@122 IN_COLL_ $1.
@123 INC_HRSQ 3.
@126 INC__RSQ $1.
@127 INCMEDCR $1.
@128 INCM_DCR $1.
@129 INCNONWK $1.
@130 INCN_NWK $1.
@131 INCOMEY $1.
@132 INCOMEY_ $1.
@133 INCORP $1.
@134 INCORP_ $1.
@135 INCSTAT $1.
@136 INCSTAT_ $1.
@137 INCWEEKQ 2.
@139 INCW_EKQ $1.
@140 INDRETX 10.
@150 INDRETX_ $1.
@151 JSSDEDX 6.
@157 JSSDEDX_ $1.
@158 MARITAL $1.
@159 MARITAL_ $1.
@160 MEDICOV $1.
@161 MEDICOV_ $1.
@162 MEMBNO 2.
@164 NFRMLOSS $1.
@165 NFRM_OSS $1.
@166 NONFARMX 10.
@176 NONF_RMX $1.
@177 OCCUPREV $2.
@179 OCCU_REV $1.
@180 ORIGINR $1.
@181 PAYPERD $1.
@182 PAYPERD_ $1.
@183 PRIVPENX 8.
@191 PRIV_ENX $1.
@193 PWRK_TAT $1.
@194 QPREVIND $2.
@196 QPRE_IND $1.
@197 RACE $1.
@198 RACE_ $1.
@199 RRRDEDX 8.
@207 RRRDEDX_ $1.
@208 RRRETIRX 8.
@216 RRRE_IRX $1.
@217 SALARYX 10.
@227 SALARYX_ $1.
@232 SCHMLWKQ 2.
@234 SCHM_WKQ $1.
@235 SCHMLWKX 3.
@238 SCHM_WKX $1.
@239 SEX $1.
@240 SEX_ $1.
@241 SLFEMPSS 6.
@247 SLFE_PSS $1.
@248 SLTAXX 8.
@256 SLTAXX_ $1.
@257 SOCRRX 8.
@265 SOCRRX_ $1.
@266 SS_RRQ 2.
@268 SS_RRQ_ $1.
@269 SSIX 8.
@277 SSIX_ $1.
@278 SSNORM $1.
@279 SSNORM_ $1.
;
RUN;

%MEND MEMI;

%MACRO ITBI(FILE=, YEAR=, QUARTER=);
DATA &FILE.&YEAR.&QUARTER;
INFILE "&DRIVE.\ITABI&YEAR.&QUARTER..txt";
INPUT 
	@1 NEWID $8.
	@9 REFMO $2.
	@11 REFYR $2.
    @13 UCC $6.
	@19 PUBFLAG $1.
    @20 VALUE 12.4
	@32 VALUE_ $1. 
	@33 GIFT $1.;
RUN;
%MEND ITBI;

%MACRO MTBI(FILE=, YEAR=, QUARTER=);
DATA &FILE.&YEAR.&QUARTER;
INFILE "&DRIVE.\MTABI&YEAR.&QUARTER..txt";
 INPUT 
	@1 NEWID 8.       
	@9 UCC $6.
    @15 COST 12.4 
    @27 COST_ $1. 
	@28 GIFT $1.
	@29 PUBFLAG $1.
    @30 REF_MO $2.    
	@32 REF_YR $2.;
RUN;
%MEND MTBI;

%MACRO APL(FILE=, YEAR=);
DATA &FILE.&YEAR;
INFILE "&DRIVE.\APL&YEAR..txt";
 INPUT 
@1 QYEAR $3.
@4 NEWID 8.
@12 SEQNO 3.
@15 ALCNO 3.
@18 REC_ORIG $1.
@19 MAJCODE $2.
@21 MAJCODE_ $1.
@22 MAJAPPLQ $2.
@24 MAJA_PLQ $1.
@25 APPLSTAT $1.
@26 APPL_TAT $1.
@27 APPLCOND $1.
@28 APPL_OND $1.
;
RUN;
%MEND APL;

%MACRO APA(FILE=, YEAR=);
DATA &FILE.&YEAR;
INFILE "&DRIVE.\APA&YEAR..txt";
 INPUT 
@1 QYEAR $3.
@4 NEWID 8.
@12 SEQNO 3.
@15 ALCNO 3.
@18 REC_ORIG $1.
@19 MAJAPPLY $3.
@22 MAJA_PLY $1.
@23 GFTC_MAJ $1.
@24 GFTC0MAJ $1.
@25 MAJ_MO $2.
@27 MAJ_MO_ $1.
@28 MAJPURX 6.
@34 MAJPURX_ $1.
@35 MAJNEWU $1.
@36 MAJNEWU_ $1.
@37 MAJRENTX 6.
@43 MAJR_NTX $1.
@44 MAJTAX $1.
@45 MAJTAX_ $1.
@46 MAJINSTX 6.
@52 MAJI_STX $1.;
RUN;
%MEND APA;

%MACRO OVB(FILE=, YEAR=);
DATA &FILE.&YEAR;
INFILE "&DRIVE.\OVB&YEAR..txt";
 INPUT 
@1 QYEAR $3.
@4 NEWID 8.
@12 SEQNO 3.
@15 ALCNO 3.
@18 REC_ORIG $1.
@19 VEHICIB $2.
@21 VEHICIB_ $1.
@22 VEHICYB $3.
@25 VEHICYB_ $1.
@26 VEHICYR $2.
@28 VEHICYR_ $1.
@29 MKMDLY $3.
@32 MKMDLY_ $1.
@33 CYLQ 2.
@35 CYLQ_ $1.
@36 AUTOTRAN $1.
@37 AUTO_RAN $1.
@38 PWRSTEER $1.
@39 PWRS_EER $1.
@40 PWRBRAKE $1.
@41 PWRB_AKE $1.
@42 AIRCAR $1.
@43 AIRCAR_ $1.
@44 RADIO $1.
@45 RADIO_ $1.
@46 VINYLTOP $1.
@47 VINY_TOP $1.
@48 DIESEL $1.
@49 DIESEL_ $1.
@50 VEHBSNS $1.
@51 VEHBSNS_ $1.
@52 VEHBSNZ 4.
@56 VEHBSNZ_ $1.
@57 VEHNEWU $1.
@58 VEHNEWU_ $1.
@59 VPURSRCE $1.
@60 VPUR_RCE $1.
@61 VEHGFTC $1.
@62 VEHGFTC_ $1.
@63 MILEAGEB 6.
@69 MILE_GEB $1.
@70 VEHPURMO $2.
@72 VEHP_RMO $1.
@73 VEHPURYR $2.
@75 VEHP_RYR $1.
@76 VFINANCE $1.
@77 VFINANC_ $1.
@78 VFINSTAT $1.
@79 VFIN_TAT $1.
@80 TRADE $1.
@81 TRADE_ $1.
@82 TRADEX 6.
@88 TRADEX_ $1.
@89 NETPURX 6.
@95 NETPURX_ $1.
@96 SALESTAX $1.
@97 SALESTA_ $1.
@98 EMPLEXP $1.
@99 EMPLEXP_ $1.
@100 EMPLEXPX 6.
@106 EMPL_XPX $1.
@107 DNPAYMTX 6.
@113 DNPA_MTX $1.
@114 FIN_INST $1.
@115 FIN__NST $1.
@116 PRINCIPX 6.
@122 PRIN_IPX $1.
@123 VEHQPMT 4.
@127 VEHQPMT_ $1.
@128 PMT1MO $2.
@130 PMT1MO_ $1.
@131 PMT1YR $2.
@133 PMT1YR_ $1.
@134 PAYMENTX 4.
@138 PAYM_NTX $1.
@139 PMTPERD $1.
@140 PMTPERD_ $1.
@141 AUTOINS $1.
@142 AUTOINS_ $1.
@143 LIFEINS $1.
@144 LIFEINS_ $1.
@145 QINTRSTZ 5.
@150 QINT_STZ $1.
@151 QLOANM1Q 4.
@155 QLOA_M1Q $1.
@156 QBALNM1X 10.
@166 QBAL_M1X $1.
@167 QVINTM1X 10.
@177 QVIN_M1X $1.
@178 QVPRIM1X 10.
@188 QVPR_M1X $1.
@189 QLOANM2Q 4.
@193 QLOA_M2Q $1.
@194 QBALNM2X 10.
@204 QBAL_M2X $1.
@205 QVINTM2X 10.
@215 QVIN_M2X $1.
@216 QVPRIM2X 10.
@226 QVPR_M2X $1.
@227 QLOANM3Q 4.
@231 QLOA_M3Q $1.
@232 QBALNM3X 10.
@242 QBAL_M3X $1.
@243 QVINTM3X 10.
@253 QVIN_M3X $1.
@254 QVPRIM3X 10.
@264 QVPR_M3X $1.
@265 QTRADEX 10.
@275 QTRADEX_ $1.
@276 QZBUSEXP 4.
@281 QZBU_EXP $1.
@282 QVEHDDZ 4.
@287 QVEHDDZ_ $1.
@288 QADMILEQ 6.
@294 QADM_LEQ $1.
@295 QREIMBRZ 4.
@299 QREI_BRZ $1.
@300 QREIMDDZ 4.
@305 QREI_DDZ $1.
@306 QADITR1X 10.
@316 QADI_R1X $1.
@317 QADITR2X 10.
@327 QADI_R2X $1.
@328 QADITR3X 10.
@338 QADI_R3X $1.
;
RUN;
%MEND OVB;

%MACRO OVC(FILE=, YEAR=);
DATA &FILE.&YEAR;
INFILE "&DRIVE.\OVC&YEAR..txt";
 INPUT 
@1 QYEAR $3.
@4 NEWID 8.
@12 SEQNO 3.
@15 ALCNO 3.
@18 REC_ORIG $1.
@19 VEHICIC $2.
@21 VEHICIC_ $1.
@22 VEHICYC $3.
@25 VEHICYC_ $1.
@26 VEHDISP $1.
@27 VEHDISP_ $1.
@28 VDISPMO $2.
@30 VDISPMO_ $1.
@31 SALEX 6.
@37 SALEX_ $1.
@38 REIMBURS $1.
@39 REIM_URS $1.
@40 REIMBURX 6.
@46 REIM_URX $1.
@47 EXREIMB $1.
@48 EXREIMB_ $1.
@49 EXREIMBX 6.
@55 EXRE_MBX $1.
@56 LOANSTAT $1.
@57 LOAN_TAT $1.
@58 FINPAYMT $1.
@59 FINP_YMT $1.
@60 FINPAYMX 6.
@66 FINP_YMX $1.
;
RUN;
%MEND OVC;
%MACRO TRB(FILE=, YEAR=);
DATA &FILE.&YEAR;
INFILE "&DRIVE.\TRB&YEAR..txt";
 INPUT 
@1 QYEAR $3.
@4 NEWID 8.
@12 SEQNO 3.
@15 ALCNO 3.
@18 REC_ORIG $1.
@19 TRIPTYPE $1.
@20 TRIP_YPE $1.
@21 MODECAR $2.
@23 MODECAR_ $1.
@24 MODEVEH $2.
@26 MODEVEH_ $1.
@27 MODEOCR $2.
@29 MODEOCR_ $1.
@30 MODERNT $2.
@32 MODERNT_ $1.
@33 MODEPLN $2.
@35 MODEPLN_ $1.
@36 MODETRN $2.
@38 MODETRN_ $1.
@39 MODEBUS $2.
@41 MODEBUS_ $1.
@42 MODESHP $2.
@44 MODESHP_ $1.
@45 MODETXI $2.
@47 MODETXI_ $1.
@48 MODEOTH $2.
@50 MODEOTH_ $1.
@51 MAINMD $2.
@53 MAINMD_ $1.
@54 EOTRIPMO $2.
@56 EOTR_PMO $1.
@57 DUPTRIPQ 2.
@59 DUPT_IPQ $1.
@60 MAINPURP $1.
@61 MAIN_URP $1.
@62 TRIPPDBY $1.
@63 TRIP_DBY $1.
@64 TRIPBSNS $1.
@65 TRIP_SNS $1.
@66 TRPBSNSZ 5.
@71 TRPB_NSZ $1.
@72 TRIPGASX 6.
@78 TRIP_ASX $1.
@79 TRIPOILX 6.
@85 TRIP_ILX $1.
@86 TRPTOLLX 6.
@92 TRPT_LLX $1.
@93 TRPOTVEX 6.
@99 TRPO_VEX $1.
@100 TRPCOMBX 6.
@106 TRPC_MBX $1.
;
RUN;
%MEND TRB;

%MACRO STATE(FILE=, YEAR=, QUARTER=);
DATA &FILE.&YEAR.&QUARTER;
INFILE "&DRIVE.\PUST&YEAR.&QUARTER..txt";
 INPUT 
	@1 NEWID 8.       
	@10 STATE $2.;
RUN;
%MEND STATE;


/****PRODUCE FMLI FILES*****/
%FMLI(FILE=FMLI,YEAR=&YR.,QUARTER=1);
%FMLI(FILE=FMLI,YEAR=&YR.,QUARTER=2);
%FMLI(FILE=FMLI,YEAR=&YR.,QUARTER=3);
%FMLI(FILE=FMLI,YEAR=&YR.,QUARTER=4);
/****PRODUCE FMLI FILES*****/
%MEMI(FILE=OUTPUT.MEMI,YEAR=&YR.,QUARTER=1);
%MEMI(FILE=OUTPUT.MEMI,YEAR=&YR.,QUARTER=2);
%MEMI(FILE=OUTPUT.MEMI,YEAR=&YR.,QUARTER=3);
%MEMI(FILE=OUTPUT.MEMI,YEAR=&YR.,QUARTER=4);
/****PRODUCE FMLI FILES*****/
%ITBI(FILE=OUTPUT.ITBI,YEAR=&YR.,QUARTER=1);
%ITBI(FILE=OUTPUT.ITBI,YEAR=&YR.,QUARTER=2);
%ITBI(FILE=OUTPUT.ITBI,YEAR=&YR.,QUARTER=3);
%ITBI(FILE=OUTPUT.ITBI,YEAR=&YR.,QUARTER=4);
/****PRODUCE FMLI FILES*****/
%MTBI(FILE=OUTPUT.MTBI,YEAR=&YR.,QUARTER=1);
%MTBI(FILE=OUTPUT.MTBI,YEAR=&YR.,QUARTER=2);
%MTBI(FILE=OUTPUT.MTBI,YEAR=&YR.,QUARTER=3);
%MTBI(FILE=OUTPUT.MTBI,YEAR=&YR.,QUARTER=4);

%APL(FILE=OUTPUT.APL,YEAR=&YR.);
%APA(FILE=OUTPUT.APA,YEAR=&YR.);
%OVB(FILE=OUTPUT.OVB,YEAR=&YR.);
%OVC(FILE=OUTPUT.OVC,YEAR=&YR.);
%TRB(FILE=OUTPUT.TRB,YEAR=&YR.);

/****PRODUCE STATE FILES*****/
%STATE(FILE=STATE,YEAR=&YR.,QUARTER=1);
%STATE(FILE=STATE,YEAR=&YR.,QUARTER=2);
%STATE(FILE=STATE,YEAR=&YR.,QUARTER=3);
%STATE(FILE=STATE,YEAR=&YR.,QUARTER=4);



PROC SORT DATA = STATE&YR.1; BY NEWID; RUN;
PROC SORT DATA = STATE&YR.2; BY NEWID; RUN;
PROC SORT DATA = STATE&YR.3; BY NEWID; RUN;
PROC SORT DATA = STATE&YR.4; BY NEWID; RUN;


DATA OUTPUT.FMLI&YR.1;
	MERGE	FMLI&YR.1 (IN = A)
			STATE&YR.1 (IN = B);
		BY NEWID; 
	IF A;
	RUN;

DATA OUTPUT.FMLI&YR.2;
	MERGE	FMLI&YR.2 (IN = A)
			STATE&YR.2 (IN = B);
		BY NEWID; 
	IF A;
	RUN;

DATA OUTPUT.FMLI&YR.3;
	MERGE	FMLI&YR.3 (IN = A)
			STATE&YR.3 (IN = B);
		BY NEWID; 
	IF A;
	RUN;

DATA OUTPUT.FMLI&YR.4;
	MERGE	FMLI&YR.4 (IN = A)
			STATE&YR.4 (IN = B);
		BY NEWID; 
	IF A;
	RUN;