/***************************************** Program to create all the non Credit Card Created Variables for the Consumer Finance Monthly (CFM, like net worth and income. *******************************************/ OPTIONS PAGESIZE=59 LINESIZE=80 PAGENO=1 NODATE ERRORS=1 NOLABEL; %Macro Range (TheValue, Low, High); if (&Low >= 0) and (&High > 0) then do; /* Did the respondent use a range? */ /* Check to make sure the low value is smaller than the high */ if (&Low >= 0) and (&High >= 0) and (&Low > &High) then do; TempSwap = &High; &High = &Low; &Low = TempSwap; end; /* Now split the difference */ &TheValue = int((&High - &Low) / 2) + &Low; end; %Mend Range; %Macro Unfolding (TheValue, LowBracket, HighBracket, ENTRY_AMT, LowValue, HighValue); if (&LowBracket = 0) then &TheValue = &LowValue / 2; if (&LowBracket = 1) then &TheValue = (&ENTRY_AMT - &LowValue)/2 + &LowValue; if (&HighBracket = 0) then &TheValue = (&HighValue - &ENTRY_AMT)/2 + &ENTRY_AMT; if (&HighBracket = 1) then &TheValue = &HighValue; %Mend Unfolding; %Macro UnfoldingTotInc (TheValue, LowBracket, HighBracket); ENTRY_AMT = 50000; if (&LowBracket = 0) then &TheValue = 15000; if (&LowBracket = 1) then &TheValue = (ENTRY_AMT - 30000)/2 + 30000; if (&HighBracket = 0) then &TheValue = (80000 - ENTRY_AMT)/2 + ENTRY_AMT; if (&HighBracket = 1) then &TheValue = 80000; %Mend UnfoldingTotInc; %Macro Unfold (TheValue, LowBracket, HighBracket, ENTRY_AMT, LowValue, HighValue); if (&LowBracket = 0) then &TheValue = &LowValue / 2; if (&LowBracket = 1) then &TheValue = (&ENTRY_AMT - &LowValue)/2 + &LowValue; if (&HighBracket = 0) then &TheValue = (&HighValue - &ENTRY_AMT)/2 + &ENTRY_AMT; if (&HighBracket = 1) then &TheValue = &HighValue; %Mend Unfold; /************************/ /* READ DATA SECTION */ /************************/ /* Extract all CFM variables. Put file name of SAS file created by NLS Investigator is below. EDIT this file by dropping the format; proc means; and run; commands at the end of the file. */ %Include "C:\Documents and Settings\All Users\Desktop\CFM\AllCFMVariables.sas"; /* Comment the next line out if you want created variables for ALL CFM cases */ %Include "C:\Documents and Settings\All Users\Desktop\CFM\DatesToUse.sas"; ID = R0000100; keep ID SAS_Q13_ANY_INCOME2_000001 SAS_Q13_ANY_INCOME2_000003 SAS_Q13_ANY_INCOME2_000004 CV_EMPLOYMENT I9B I9B2 EI_1 EI_5 EI_7 EI_11; run; DATA CFM6; SET new_data; /* Create the CV_Employment variable tosee if the respondent or spouse is working. This variable's specific definition was determined by Curtis. 0 - means neither the respondent or spouse is working 1 - means either the respondent or spouse currently works */ CV_EMPLOYMENT = 0; /* Set all households to NOT working */ /* I9 questions ask how long in months and years R has worked at their present job. Peoplw who are working provide figures which are greater than zero. */ if (I9B >= 1) then CV_EMPLOYMENT = 1; if (I9B2 >= 1) then CV_EMPLOYMENT = 1; /* The EI-X quesitons were added by the Boston Fed in 2010. EI-1 and EI-7 ask if R or spouse are presently employed. EI-5 and EI-11 ask if R or spouse were working for the past 12 months */ if (EI_1 = 1) or (EI_5 = 1) then CV_EMPLOYMENT = 1; if (EI_7 = 1) or (EI_11 = 1)then CV_EMPLOYMENT = 1; /* Curtis also checked is the spouse provided any wage, salary, farm or business income. */ if (SAS_Q13_ANY_INCOME2_000001 = 1) OR (SAS_Q13_ANY_INCOME2_000003 = 1) OR (SAS_Q13_ANY_INCOME2_000004 = 1) then CV_EMPLOYMENT = 1; file 'C:\Documents and Settings\All Users\Desktop\CFM\Step2_CreatedVariables\CV_Employment_out.dat' dlm=','; put ID "CV_EMPLOYMENT," CV_EMPLOYMENT; proc means; RUN;