Skip to main content

NLSY79

NLSY79 Appendix 26: Non-Response to Financial Questions and Entry Points

Financial questions often elicit from respondents either a "refusal" or a "don't know" response. From 1979 to 2000 the NLSY79 interviewers faced with a "refusal" or a "don't know" simply went on to the next question. Starting in 2002, respondents have been asked to estimate financial values if they could not provide an exact value.

To determine which of several methods of estimation was best for financial questions, an "income experiment" was run during the 2002 survey. Respondents were randomly assigned to one of three methods (unfolding bracket, nearest $10k, range) when they stated "don't know" or "refused" to an income question. Additionally, among respondents who were given unfolding brackets, some respondents were given relatively high starting points (referred to as the 60 percent group) or relatively low starting points (referred to as the 40 percent group).

Important information: SYMBOL_ENTRY_[NAME]

Researchers interested in knowing which starting point a respondent was selected to receive should look at questions named SYMBOL_ENTRY_[NAME], which are titled "Entry Point For Income Unfolding Brackets for [Type of Income/Asset]". These variables contain the actual entry points assigned to each case for which a 40% or 60% entry point (see Table 2 and Table 3 below) was assigned.

First, some respondents were asked for a range of values. A second group of respondents was asked if they could provide an answer within $10,000. Third, some respondents were asked to place the value within "unfolding brackets," bracketing the range in which the true value fell.

The first method, the range of values questions, asks respondents to define a lower and upper bound value. Examining the data suggest that some respondents give quite precise bounds. When a respondent gives a range, researchers should note that the upper and lower bound variables are not always in the correct order. The survey always asks for the upper bound first and the lower bound second. However, if a respondent gives the smaller number first, that number will be typed into the upper bound variable and the range values will be reversed.

The second method, reporting a value to within the nearest $10,000, is designed to tell the respondent that a rough figure is an acceptable answer. Extreme precision is not demanded for these estimates.

The third method, unfolding brackets, lets respondents report if the amount is above or below a particular value. The initial value the respondent is given to compare is called the "entry point." The list of all entry points used by the NLSY79 survey since 2002 is found in Table 2 and Table 3 in this appendix.

For example, the entry point for the value of a vehicle is $20,000. If the answer to the entry point question is neither a "refusal" nor a "don't know" then the respondent is asked one more "is the value above or below" question. This results in a series of four brackets that provide researchers with a rough idea of the range into which the item's value falls. Researchers should be cautioned that while three of the brackets have a defined range, the top range is open-ended.

Important information: Household interview income recall experiment

Researchers interested in knowing the type of question a respondent was selected to receive in the 2002 experiment should look at question HH_INC_3_EXP, which has the title "Type of question R assigned for household interview income recall experiment."

Example:

An example of how item non-response to financial questions is handled is seen in the questions that ask about income from the military in the 2002 survey.

Question Q13-16_TRUNC asked respondents "About how much total income your spouse or partner received during 2001 from the military before taxes and other deductions?" If the respondent was unable to provide a specific amount, the respondent was assigned in Q13-16_EXP to one of three alternative methods to try to solicit an estimate.

In question Q13-16_E~000001 some respondents were asked if they could provide "an approximate range for that amount." If the respondent could provide a range, both the upper and lower bound values were captured.

Some respondents were asked in question Q13-16_D, "To the nearest $10,000, can you tell me about how much your spouse or partner received during 2001, from the military before taxes and other deductions?"

In question Q13-16_A some respondents were asked "Would it amount to [entry point military income] or more?" Looking at Table 2 shows that "entry point military income" has the value of either $15,000 or $30,000. This results in the interviewer asking if the income was more or less than these amounts. If the respondent stated less than $15,000 or $30,000 s/he was asked one last question "would it amount to $5,000 or more." If the respondent stated more than $15,000 or $30,000 s/he was asked "would it amount to $40,000 or more."

These questions resulted in the researcher being able to classify respondents who do not know the military pay received by their spouse into four groups; $0 to $5,000, $5,000 to $15,000/$30,000, $15,000/$30,000 to $40,000 and over $40,000. Table 2 and Table 3 provide the specific entry points and symbol names for all income and asset questions, along with related questions in the retirement section used in the bracketing questions. Note: Table 1. Number of Respondents Assigned to Income Experiment Groups has been removed because the SYMBOL_ENTRY_[NAME] variables are available in the public data release.

Table 2. Entry points for NLSY79 income and assets section in 2002 and 2004
Type Variable Name 40% Amount 60% Amount
Wages and Salary entry pt wage inc $25,000 $35,000
Military Income entry pt military inc $15,000 $30,000
Business Income entry pt business inc $10,000 $20,000
Public Assistance and Welfare entry pt pub assistance inc $5,000 $7,500
Child Support entry pt ch supt inc $2,500 $4,000
Educational Benefits and Scholarships entry pt educ benefits inc $1,500 $3,000
Inheritances and Gifts entry pt inheritance inc $3,000 $10,000
Other Income entry pt other inc $500 $1,000
Earned Income Tax Credit entry pt eitc inc $1,000 $2,000
Other Household Members Income entry pt other hh mems inc $10,000 $20,000
Table 3. Entry points for NLSY79 income section in 2006-2016, assets section in 2006-2020, retirement assets questions in 2022
Type Variable Name 40% Amount 60% Amount
Wages and Salary entry pt wage inc $28,000 $40,000
Military Income entry pt military inc $14,000 $24,000
Business Income entry pt business inc $21,000 $35,000
Public Assistance and Welfare entry pt pub assistance inc $5,000 $7,000
Child Support entry pt ch supt inc $3,000 $4,800
Educational Benefits and Scholarships entry pt educ benefits inc $1,800 $3,000
Inheritances and Gifts entry pt inheritance inc $5,500 $12,500
Other Income entry pt other inc $7,200 $13,000
Earned Income Tax Credit entry pt eitc inc $1,200 $2,000
Other Household Members Income entry pt other hh mems inc $7,200 $13,000

In 2018, while continuing to employ automated text substitutions for entry points in the assets section and several new assets-related questions in the Retirement module, specific entry points were included in the question texts for the income section and one savings-related question in the Retirement module. Entry points for the income questions and the retirement question are the mean of the original 40% and 60% entry points listed in Table 3 above. 

The list below identifies the questions in the 2020 and 2022 questionnaires that contain entry points to estimate income, asset, and retirement asset amounts.

  • Q13-5_UAB_A
  • Q13-9_UAB_A
  • RETINCR-PENSIONS-2_UAB_A
  • RETINCR-ANNUITIES-2_UAB_A
  • RETINCR-IRA-2_UAB_A
  • RETINCR-IRA-4_UAB_A
  • Q13-70_SS_UAB_A
  • Q13-70_DIS_UAB_A
  • Q13-31B_UAB_A
  • Q13-70_VET_UAB_A
  • Q13-18_UAB_A
  • Q13_24_UAB_A
  • RETINCSP-PENSIONS-2_UAB_A
  • RETINCSP-ANNUITIES-2_UAB_A
  • RETINCSP-IRA-2_UAB_A
  • RETINCSP-IRA-4_UAB­_A
  • Q13-70_SS-SP_UAB_A
  • Q13-70_DIS-SP_UAB_A
  • Q13-31B-SP_UAB_A
  • Q13-70_VET-SP_UAB_A
  • Q13-73_UAB_A
  • Q13-73A_UAB_A
  • Q13-75_UAB_A
  • Q13-81-NEW_UAB_A
  • SC_12A_UAB_A
  • SC_12B_UAB_A
  • FA_1A_UAB_A
  • FA_2A_UAB_A
  • FA_3A_UAB_A
  • FA_4A_UAB_A
  • FA_5A_UAB_A
  • FA_6D_UAB_A
  • FA_6E_UAB_A
  • FA_7B_UAB_A
  • FA_7C_UAB_A
  • FA_8C_UAB_A
  • FA_8D_UAB_A
  • FA_8D_UAB_A
  • FA_9A_UAB_A
  • FA_10A_UAB_A
  • FA_11A_UAB_A
  • NFA_1A_UAB_A
  • NFA_1B_UAB_A
  • NFA_1C_UAB_A
  • NFA_2A_UAB_A
  • NFA_2B_UAB_A
  • NFA_2C_UAB_A
  • Q13-131_UAB_A
  • Q13-132_UAB_A
  • Q13-132D_UAB_A
  • NFA_4C_UAB_A
  • NFA_4F_UAB_A
  • NFA_5B_UAB_A
  • NFA_5C_UAB_A
  • NFA_6E_UAB_A
  • NFA_7C_UAB_A
  • DEBT_1A_UAB_A
  • DEBT_2A_UAB_A
  • DEBT_2D_UAB_A
  • DEBT_3A_UAB_A
  • DEBT_4A_UAB_A
  • Q13-142_UAB_A
  • RETIRE_HOUSEVALUE_1A_UAB_A
  • RETIRE_HOUSEVALUE_1B_UAB_A
  • RETIRE_HOUSEVALUE_1C_UAB_A
  • RETIRE_SAV5_UAB_A

Important information: Asset section

Almost all questions in the Asset section use the same entry point. For example, in the 2004 survey the entry point was "entry pt other hh mems inc," which has the value of $10,000 or $20,000. This entry point value is quite low for certain categories. For instance, homeowners who do not know the value of their primary residence were asked if it was above or below $20,000. This low entry point value resulted in large number of cases all falling into the same unfolding bracket.

NLSY79 Appendix 25: Attitudinal Scale Scoring

This appendix contains descriptions of scale score computations and programs that create some of the scale scores for the most recent survey year for the following attitudinal scales:

Center for Epidemiologic Studies Depression (CES-D) Scale

Created variables: CES-D Scale scores

Question Name

Title

Survey Years

CESD_SCORE_20_ITEM 20-ITEM CES-D SCORE (CESD) 1992
CESD_FLAG FLAG – NUMBER OF MISSING ITEMS FOR 20 ITEM CES-D SCORE (CESD) 1992
CESD_SCORE_7_ITEM 7-ITEM CES-D SCORE (CESD) 1992, 1994, 2020, 2022
H40-CESD_SCORE_7_ITEM H40 7-ITEM CES-D SCORE (CESD) XRND
H50-CESD_SCORE_7_ITEM H50 7-ITEM CES-D SCORE (CESD) XRND
H60-CESD_SCORE_7_ITEM H60 7-ITEM CES-D SCORE (CESD)
Note: The H60 Module was administered to a subset of respondents in its first survey year of fielding; thereafter, it was administered to all respondents.
XRND

Scoring computations are described below.

Please note: Item response theory (IRT) parameter estimates, IRT scores, and their standard errors of measurement for the CES-D variables are also available, along with a custom-weighted z-score and percentile rank. See Appendix 27: IRT Item Parameter Estimates, Scores and Standard Errors for a detailed description and discussion of the IRT scoring for these scales.

The CES-D is a self-report scale that measures the current prevalence of depression symptoms. Respondents rate a series of statements regarding how they felt during the week prior to the interview. While the full 20-item battery was included in the 1992 (round 14) survey, a collapsed 7-item battery was administered to respondents in the 1994 (round 16) survey. A slightly expanded 9-item battery was included in the 40+ Health Module, in all years of the 50+ Health Module, in 2018 of the 60+ Health Module, and was asked of all respondents in the 2020 and 2022 interviews. The CES-D scale included in the 40+, 50+ and 60+ (initiated in 2018) Health Modules and administered to all respondents in 2020 and 2022 contained the consistent 7-item scale. Table 1 details the questions asked and the survey years and modules in which they were included.

Table 1: CES-D Scale questions including survey years and modules asked
Item Question Name Question Name Survey Years
1 I was bothered by things that usually don't bother me. CESD~000000 1992
2 I did not feel like eating; my appetite was poor.

CESD~000001

h30-CESD~000001

H50CESD~000001

H60CESD~000001

1992, 1994, 2020, 2022

XRND

XRND

XRND

3 I felt that I couldn't shake off the blues even with help from my family and friends.

CESD~000002

h30-CESD~000002

H50CESD~000002

H60CESD~000002

1992, 2020, 2022

XRND

XRND

XRND

4 I felt that I was just as good as other people. CESD~000002A 1992
5 I had trouble keeping my mind on what I was doing.

CESD~000003

h30-CESD~000003

H50CESD~000003

H60CESD~000003

1992, 1994, 2020, 2022

XRND

XRND

XRND

6 I felt depressed.

CESD~000004

h30-CESD~000004

H50CESD~000004

H60CESD~000004

1992, 1994, 2020, 2022

XRND

XRND

XRND

7 I felt that everything I did was an effort.

CESD~000005

h30-CESD~000005

H50CESD~000005

H60CESD~000005

1992, 1994, 2020, 2022

XRND

XRND

XRND

8 I felt hopeful about the future. CESD~000005A 1992
9 I thought my life had been a failure. CESD~00005B 1992
10 I felt fearful. CESD~00005C 1992
11 My sleep was restless.

CESD~000006

h30-CESD~000006

H50CESD~000006

H60CESD~000006

1992, 1994, 2020, 2022

XRND

XRND

XRND

12 I was happy. CESD~000006A 1992
13 I talked less than usual. CESD~000006B 1992
14 I felt lonely.

CESD~000007

h30-CESD~000007

H50CESD~000007

H60CESD~000007

1992, 2020, 2022

XRND

XRND

XRND

15 People were unfriendly. CESD~000007A 1992
16 I enjoyed life. CESD~000007B 1992
17 I had crying spells. CESD~000007C 1992
18 I felt sad.

CESD~000008

h30-CESD~000008

H50CESD~000008

H60CESD~000008

1992, 1994, 2020, 2022

XRND

XRND

XRND

19 I felt that people dislike me. CESD~000008A (1992) 1992
20 I could not get "going."

CESD~000009

h30-CESD~000009

H50CESD~000009

H60CESD~000009

1992, 1994, 2020, 2022

XRND

XRND

XRND

Possible responses for all 16 negative-symptom questions are as follows:

  • 0 point : Rarely or none of the time (< 1 day)
  • 1 point : Some or a little of the time (1-2 days)
  • 2 points: Occasionally or a moderate amount of the time (3-4 days)
  • 3 points: Most or all of the time (5-7 days).

Response categories for 4 positive-symptom questions asked only in 1992 (CESD~000002A, CESD~000005A, CESD~000006A, CESD~000007B) are reversed.

Scale scores for 1992 (20-item and 7-item), 1994, 2020, 2022, and the 40+, 50+, and 60+ Health Modules (7-item) CES-D are all computed by summing the points for each answer across either the 20 items or 7 items in the specific survey year or module. The 20-item scale contains both negative- and positive-symptom questions. No positive-symptom questions are included in the 7-item scales. CES-D 20-item scale score: Points for all 20 items were summed. Possible scores range from 0 to 60, with the higher scores indicating the presence of more depressive symptoms. If more than four items are missing, the scale score is coded as missing. A flag that indicates the number of missing items for CES-D 20-item scale is also present.

CESD 7-item scale score: Points are summed across 7 items (CESD~000001, CESD~000003, CESD~000004, CESD~000005, CESD~000006, CESD~000008, CESD~000009). The possible range of scores is 0 to 21. If one item is missing, the scale score is coded as missing.

Click below to view programming code.

Q11-CESD~000001
Q11-CESD~000002
Q11-CESD~000003
Q11-CESD~000004
Q11-CESD~000005
Q11-CESD~000006
Q11-CESD~000007
Q11-CESD~000008
Q11-CESD~000009
* calculate ces_d_score_7_item;
'CESD_SCORE_7_ITEM'n = -4;
array cesd7 (*) 'Q11-CESD~000001'n 'Q11-CESD~000003'n 'Q11-CESD~000004'n 'Q11-CESD~000005'n
'Q11-CESD~000006'n 'Q11-CESD~000008'n 'Q11-CESD~000009'n;
vskipnum=0;
validnum=0;
missnum=0;
do j=1 to 7;
if cesd7(j)=-4 then vskipnum=vskipnum+1;/*valid skip*/
else if cesd7(j) in (-3,-2,-1) then missnum=missnum+1; /* missing/dk/ref */
else if cesd7(j) in (0,1,2,3) then validnum=validnum+1;/*valid answer*/
end;
if vskipnum=7 then 'CESD_SCORE_7_ITEM'n=-4; /*all 7 items are "valid skip"*/
else if missnum ge 1 then 'CESD_SCORE_7_ITEM'n=-3;
else if validnum=7 then 'CESD_SCORE_7_ITEM'n=sum(of cesd7(1), cesd7(2), 
cesd7(3), cesd7(4), cesd7(5), cesd7(6), cesd7(7));
else 'CESD_SCORE_7_ITEM'n=-3;

References

Radloff, Lenore. S. 1977. "The CES-D Scale: A self-report depression scale for research in the general population." Applied Psychological Measurement, V.1, No. 3 (Summer): 385-401.

Ross, Catherine E., and John Mirowsky. 1989. "Explaining the Social Patterns of Depression: Control and Problem Solving--or Support and Talking?" Journal of Health and Social Behavior, V.30, No. 2 (June): 206-219.

Rosenberg Self-Esteem Scale

Created variables: Rosenberg Self-Esteem Scale
Question Name Title Survey Years
ROSENBERG_ESTEEM_SCORE SELF-ESTEEM SCORE 1980
ROSENBERG_ESTEEM_SCORE ROSENBERG SELF-ESTEEM SCORE 1987
ROSENBERG_ESTEEM_SCORE SELF-ESTEEM SCORE 2006

Scoring computations are described below.

Please note: Item response theory (IRT) parameter estimates, IRT scores, and their standard errors of measurement for the Rosenberg Self-Esteem variables are also available, along with a custom-weighted z-score and percentile rank. See Appendix 27 for a detailed description and discussion of the IRT scoring for these scales.

The Rosenberg Self-Esteem Scale is designed to measure the self-evaluation that an individual makes and customarily maintains. It has been administered to NLSY79 respondents in survey years 1980, 1987 and 2006. Table 2 lists the questions by survey year.

Table 2: Rosenberg Self-Esteem Scale items (1980, 1987, 2006)
Item Question Question Names
1 I am a person of worth. ROSENBERG_ESTEEM_000001
2 I have a number of good qualities. ROSENBERG_ESTEEM_000002
3 I am inclined to feel that I am a failure. ROSENBERG_ESTEEM_000003
4 I am able to do things as well as most other people. ROSENBERG_ESTEEM_000004
5 I felt I do not have much to be proud of. ROSENBERG_ESTEEM_000005
6 I take a positive attitude toward myself. ROSENBERG_ESTEEM_000006
7 I am satisfied with myself. ROSENBERG_ESTEEM_000007
8 I wish I could have more respect for myself. ROSENBERG_ESTEEM_000008
9 I certainly feel useless at times. ROSENBERG_ESTEEM_000009
10 At times I think I am no good at all. ROSENBERG_ESTEEM_000010

Possible response categories for items 3, 5, 8, 9, 10 are:

  • 0 points: strongly agree
  • 1 point: agree
  • 2 points: disagree
  • 3 points: strongly disagree

Response categories for items 1, 2, 4, 6, 7 are reversed so that a higher score indicates higher self-esteem.

Points for each of the 10 items were summed to create the scale scores. Scores range from 0 to 30 points. If one item is missing, the scale score is coded as missing.

Click below to view programming code.

ROSENBERG_ESTEEM~000001
ROSENBERG_ESTEEM~000002
ROSENBERG_ESTEEM~000003
ROSENBERG_ESTEEM~000004
ROSENBERG_ESTEEM~000005
ROSENBERG_ESTEEM~000006
ROSENBERG_ESTEEM~000007
ROSENBERG_ESTEEM~000008
ROSENBERG_ESTEEM~000009
ROSENBERG_ESTEEM~000010
* calculate rosenberg_esteem_score;
'rosenberg_esteem_score'n = -4;
array rosenberg_rev (*) 'rosenberg_esteem~000001rev'n 'rosenberg_esteem~000002rev'n
‘rosenberg_esteem~000004rev'n 'rosenberg_esteem~00000rev6'n 'rosenberg_esteem~000007rev'n;
do I = 1 to 5;
if (rosenberg_rev >= 0) then rosenberg_rev = (3 – rosenberg_rev);
end;
array rosenberg (*) 'rosenberg_esteem~000001rev'n 'rosenberg_esteem~000002rev'n
‘rosenberg_esteem~000003'n 'rosenberg_esteem~000004rev'n ‘rosenberg_esteem~000005'n
'rosenberg_esteem~000006rev'n 'rosenberg_esteem~000007rev'n 'rosenberg_esteem~000008'n
'rosenberg_esteem~000009'n 'rosenberg_esteem~000010'n;
vskipnum=0;
validnum=0;
missnum=0;
do j=1 to 10;
if rosenberg(j)=-4 then vskipnum=vskipnum+1;/*valid skip*/
else if rosenberg(j) in (-3,-2,-1) then missnum=missnum+1; /* missing/dk/ref */
else if rosenberg(j) in (0,1,2,3) then validnum=validnum+1;/*valid answer*/
end;
if vskipnum=10 then 'ROSENBERG_ESTEEM_SCORE'n=-4; /*all 10 items are "valid skip"*/
else if missnum ge 1 then 'ROSENBERG_ESTEEM_SCORE'n=-3;
else if validnum=10 then 'ROSENBERG_ESTEEM_SCORE'n=sum(of rosenberg(1), rosenberg(2), rosenberg(3), rosenberg(4), rosenberg(5), rosenberg(6), rosenberg(7), rosenberg(8), rosenberg(9), rosenberg(10);
else 'ROSENBERG_ESTEEM_SCORE'n=-3;

References

Rosenberg, Morris. 1965. Society and the Adolescent Self-Image. Princeton: Princeton University Press.

Pearlin Mastery Scale

Created variables: Pearlin Mastery Scale
Question Name Title Survey Years
PEARLIN_SCORE PEARLIN MASTERY SCORE 1992

Scoring computations are described below.

Please note: Item response theory (IRT) parameter estimates, IRT scores, and their standard errors of measurement for the Pearlin Mastery variables are also available, along with a custom-weighted z-score and percentile rank. See Appendix 27 for a detailed description and discussion of the IRT scoring for this scale.

The Pearlin Mastery scale is designed to measure self-concept and references the extent to which individuals perceive themselves in control of forces that significantly impact their lives. It was administered in NLSY79 survey year 1992 (round 14). Table 3 lists the Pearlin Mastery questions.

Table 3: Pearlin Mastery questions
Item Question Question Name
1 No way I can solve some of the problems I have. PEARLIN_1
2 Sometimes I feel that I am being pushed around in life. PEARLIN_2
3 I have little control over the things that happen to me. PEARLIN_3
4 I can do just about anything I really set my mind to. PEARLIN_4
5 I often feel helpless in dealing with the problems of life. PEARLIN_5
6 What happens to me in the future mostly depends on me. PEARLIN_6
7 There is little I can do to change many of the important things in my life. PEARLIN_7

Possible response categories for items 4, 6 are:

  • 4 points: strongly agree
  • 3 points: agree
  • 2 points: disagree
  • 1 point: strongly disagree

Response categories for items 1, 2, 3, 5, 7 are reversed so that higher scores represent greater sense of mastery.

Points for each of the 10 items were summed to create the scale scores. Scores can range from 7 to 28 points. If one item is missing, the scale score is coded as missing.

Click below to view programming code.

PEARLIN_1
PEARLIN_2
PEARLIN_3
PEARLIN_4
PEARLIN_5
PEARLIN_6
PEARLIN_7
* calculate pearlin_score;
pearlin_score = -4;
array pearlin_rev (*) pearlin_1rev pearlin_2rev pearlin_3rev pearlin_5rev pearlin_7rev;
do I = 1 to 5;
if (pearlin_rev >= 0) then pearlin_rev = (5 – pearlin_rev);
end;
array pearlin (*) pearlin_1rev pearlin_2rev pearlin_3rev pearlin_4 pearlin_5rev pearlin_6 pearlin_7rev;
vskipnum=0;
validnum=0;
missnum=0;
do j=1 to 7;
if pearlin(j)=-4 then vskipnum=vskipnum+1;/*valid skip*/
else if pearlin(j) in (-3,-2,-1) then missnum=missnum+1; /* missing/dk/ref */
else if pearlin(j) in (1,2,3,4) then validnum=validnum+1;/*valid answer*/
end;
if vskipnum=7 then PEARLIN_SCORE=-4; /*all 7 items are "valid skip"*/
else if missnum ge 1 then PEARLIN_SCORE=-3;
else if validnum=7 then PEARLIN_SCORE=sum(of pearlin(1), pearlin(2), pearlin(3), pearlin(4), pearlin(5), pearlin(6), pearlin(7);
else 'PEARLIN_SCORE'n=-3;

References

Pearlin, Leonard I.; Lieberman, Morton A.; Menaghan, Elizabeth G.; and Joseph T. Mullan. 1981. “The Stress Process.” Journal of Health and Social Behavior, V.22, No. 4 (December):337-356.

Rotter Locus of Control Scale

Created variables: Rotter Locus of Control Scale
Question Name Title Survey Years
ROTTER_SCORE ROTTER SCALE SCORE 1979, 2014, 2016, 2018

Scoring computations are described below.

The Rotter Locus of Control scale is designed to measure the extent to which individuals believe they have control over their lives through self-motivation or self-determination (internal control) as opposed to the extent that the environment (that is, chance, fate, luck) controls their lives (external control). It was included in the 1979, 2014, 2016 and 2018 (for those not interviewed in 2014 and 2016 respectively) NLSY79 surveys. Table 4 lists the question names and reference numbers in each year.

Table 4: The 1979 NLSY79 Rotter – Locus of Control questions
Item Question Question Name
1 Pair 1, statement A: Degree of control r has over direction of own life ROTTER-1A
2 Pair 1, statement B: Degree of control r has over direction of own life ROTTER-1B
3 Pair 2, statement A: Importance of planning ROTTER-2A
4 Pair 2, statement B: Importance of planning ROTTER-2B
5 Pair 3, statement A: Importance of luck ROTTER-3A
6 Pair 3, statement B: Importance of luck ROTTER-3B
7 Pair 4, statement A: Degree of influence over own life ROTTER-4A
8 Pair 4, statement B: Degree of influence over own life ROTTER-4B

Points for each pair of items are as follows:

Internal control statement:

  • 1 point: Much closer
  • 2 points: Slightly closer

External control statement:

  • 3 points: Much closer
  • 4 points: Slightly closer

Points for each of the 4 pairs were summed to create scale scores. Scores range from 4 to 16 points. If one item is missing, the scale score is coded as missing.

Click below to view programming code.

ROTTER_LINT
ROTTER_1A
ROTTER_1B
ROTTER_2A
ROTTER_2B
ROTTER_3A
ROTTER_3B
ROTTER_4A
ROTTER_4B 
 
/* recode items, compute total score */
data two;
set one;
/* recode two-part Rotter items into a single item */
score1=-4;
if rotter_1a=1 and rotter_1b=1 then score1=1;
else if rotter_1a=1 and rotter_1b=2 then score1=2;
else if rotter_1a=2 and rotter_1b=2 then score1=3;
else if rotter_1a=2 and rotter_1b=1 then score1=4;
else if rotter_1a=-3 or rotter_1b=-3 then score1=-3;
else if rotter_1a=-2 or rotter_1b=-2 then score1=-2;
else if rotter_1a=-1 or rotter_1b=-1 then score1=-1;
score2=-4;
if rotter_2a=1 and rotter_2b=1 then score2=1;
else if rotter_2a=1 and rotter_2b=2 then score2=2;
else if rotter_2a=2 and rotter_2b=2 then score2=3;
else if rotter_2a=2 and rotter_2b=1 then score2=4;
else if rotter_2a=-3 or rotter_2b=-3 then score2=-3;
else if rotter_2a=-2 or rotter_2b=-2 then score2=-2;
else if rotter_2a=-1 or rotter_2b=-1 then score2=-1;
score3=-4;
if rotter_3a=1 and rotter_3b=1 then score3=1;
else if rotter_3a=1 and rotter_3b=2 then score3=2;
else if rotter_3a=2 and rotter_3b=2 then score3=3;
else if rotter_3a=2 and rotter_3b=1 then score3=4;
else if rotter_3a=-3 or rotter_3b=-3 then score3=-3;
else if rotter_3a=-2 or rotter_3b=-2 then score3=-2;
else if rotter_3a=-1 or rotter_3b=-1 then score3=-1;
score4=-4;
if rotter_4a=1 and rotter_4b=1 then score4=4;
else if rotter_4a=1 and rotter_4b=2 then score4=3;
else if rotter_4a=2 and rotter_4b=2 then score4=2;
else if rotter_4a=2 and rotter_4b=1 then score4=1;
else if rotter_4a=-3 or rotter_4b=-3 then score4=-3;
else if rotter_4a=-2 or rotter_4b=-2 then score4=-2;
else if rotter_4a=-1 or rotter_4b=-1 then score4=-1;
array score (*) score1 score2 score3 score4;
vskipnum=0;
ivskipnum=0;
dknum=0;
refnum=0;
validnum=0;
do k=1 to 4;
if score(k)=-4 then vskipnum=vskipnum+1; /*valid-skip*/
else if score(k)=-3 then ivskipnum=ivskipnum+1; /*invalid-skip*/
else if score(k)=-2 then dknum=dknum+1; /*don't know*/
else if score(k)=-1 then refnum=refnum+1; /*refused*/
else if score(k)>=1 then validnum=validnum+1; /*valid answer*/
end;
/* Per Rosella Gardecki, we should no longer code CV missing values as anything but -3 */
/* for the created variable, ROTTER_SCORE */
/* Regardless of the type of missingness, ROTTER_SCORE should be set to -3 */
if vskipnum=4 then rotter_score=-4; /*all 4 pairs are "valid skip"*/
else if ivskipnum=4 then rotter_score=-3; /*all 4 pairs are "invalid skip"*/
else if dknum=4 then rotter_score=-3; /*all 4 pairs are "don't know"*/
else if refnum=4 then rotter_score=-3; /*all 4 pairs are "refused"*/
else if validnum>0 and validnum<4 then rotter_score=-3;/*if number of valid responses < 4 then code it as -3*/
else if validnum=4 then rotter_score=sum(of score1-score4);
else rotter_score=-3;

References

Rotter, Julian B. 1966. “Generalized Expectancies for Internal Versus External Control of Reinforcement.” Psychological Monographs: General and Applied, 80 (1): 1-28.

Satisfaction with Life Scale (SWLS)

Created Variables
Question Name Title Survey Years
H60-DIENER_SWLS_SCORE H60 DIENER SWLS SCORE XRND

Scoring computations are described below.

The Satisfaction with Life Scale (Deiner, Emmons, Larson and Griffin) seeks to measure individual general satisfaction with one's life. It is included in the NLSY79 60+ Health Module which was initiated in the 2018 survey (round 28) and is asked of respondents as they approach or reach the age of 60. Table 5 lists the Satisfaction with Life questions.

Table 5: Satisfaction with Life Scale questions
Item Question Question Name
1 If I could live my life over, I would change almost nothing. H60DIENER~000001
2 So far I have gotten the important things I want in life. H60DIENER~000002
3 I am satisfied with my life. H60DIENER~000003
4 The conditions of my life are excellent. H60DIENER~000004
5 In most ways my life is close to my ideal. H60DIENER~000005

Possible response categories for all items are:

  • 7 points: strongly agree
  • 6 points: agree
  • 5 points: slightly agree
  • 4 points: neither agree nor disagree
  • 3 points: slightly disagree
  • 2 points: disagree
  • 1 point: strongly disagree

Points for each of the 5 items were summed to create the scale scores. Scores can range from 5 to 35 points, with higher scores indicating greater life satisfaction. If one item is missing, the scale score is coded as missing.

Click below to view programming code.

Q11-H60DIENER~000005
Q11-H60DIENER~000004
Q11-H60DIENER~000003
Q11-H60DIENER~000002
Q11-H60DIENER~000001
array swls 'Q11-H60DIENER~000001'n 'Q11-H60DIENER~000002'n 'Q11-H60DIENER~000003'n
'Q11-H60DIENER~000004'n 'Q11-H60DIENER~000005'n;
misscount=0; * initialize count of missing values;
do i=1 to 5;
if swls[i] in (-4,-3,-2,-1) then do;
swls[i]=.; * recode missing items to system missing;
misscount=misscount+1; * count number of missing items;
end;
end;
/* only compute summary scale for those with no missing data on any items */
if misscount=0 then do;
'H60-DIENER_SWLS_SCORE'n=sum('Q11-H60DIENER~000001'n,'Q11-H60DIENER~000002'n,
'Q11-H60DIENER~000003'n, ‘'Q11-H60DIENER~000004'n,'Q11-H60DIENER~000005'n);
end;
else 'H60-DIENER_SWLS_SCORE'n=-3;

References

Diener, E., Emmons, R. A., Larsen, R. J., & Griffin, S. (1985). The Satisfaction with Life Scale. Journal of Personality Assessment, 49, 71-75.

General Anxiety Disorder Scale (GAD-7)

Created variables: GAD-7
Question Name Title Survey Years
H60-GAD-7_SCORE H60 GAD-7 SCORE XRND

Scoring computations are described below.

The General Anxiety Disorder Scale (developed by Spitzer, Kroenke, Williams and Lowe) asks respondents how often they have experienced certain feelings associated with anxiety in the past two weeks. It is included in the NLSY79 60+ Health Module, which was initiated in the 2018 survey (round 28) and is asked of respondents as they approach or reach the age of 60. Table 6 lists the Satisfaction with Life questions.

Table 6: General Anxiety Disorder questions
Item Question Question Name
1 Feeling nervous, anxious or on edge H60GAD-7~000001
2 Not being able to stop or control worrying. H60GAD-7~000002
3 Worrying too much about different things H60GAD-7~000003
4 Trouble relaxing H60GAD-7~000004
5 Being so restless that it is hard to sit still H60GAD-7~000005
6 Becoming easily annoyed or irritable H60GAD-7~000006
7 Feeling afraid as if something awful might happen H60GAD-7~000007

Possible response categories for all items are:

  • 0 points: not at all
  • 1 point: several days
  • 2 points: more than half the days
  • 3 points: nearly every day

Points for each of the 7 items were summed to create the scale scores. Scores can range from 0 to 21 points, with higher scores indicating greater levels of anxiety. If one item is missing, the scale score is coded as missing.

Click below to view programming code.

Q11-H60GAD-7~000001
Q11-H60GAD-7~000002
Q11-H60GAD-7~000003
Q11-H60GAD-7~000004
Q11-H60GAD-7~000005
Q11-H60GAD-7~000006
Q11-H60GAD-7~000007
array gad 'Q11-H60GAD-7~000001'n 'Q11-H60GAD-7~000002'n 'Q11-H60GAD-7~000003'n
'Q11-H60GAD-7~000004'n 'Q11-H60GAD-7~000005'n 'Q11-H60GAD-7~000006'n 'Q11-H60GAD-7~000007'n;
vskipnum=0;
missnum=0;
validnum=0;
do j=1 to 7;
if gad(j)=-4 then vskipnum=vskipnum+1; /*valid skip*/
else if gad(j) in (-3,-2,-1) then missnum=missnum+1;/*invalid-skip*/
else if gad(j) in (0,1,2,3) then validnum=validnum+1;/*valid answer*/
end;
/* calculate sum of 7 items just for those with no missing items */
if validnum=7 then 'H60-GAD-7_SCORE'N=sum('Q11-H60GAD-7~000001'n, 'Q11-H60GAD-7~000002'n,
'Q11-H60GAD-7~000003'n, 'Q11-H60GAD-7~000004'n, 'Q11-H60GAD-7~000005'n,
'Q11-H60GAD-7~000006'n, 'Q11-H60GAD-7~000007'n);
else if missnum ge 1 then 'H60-GAD-7_SCORE'N=-3;
else 'H60-GAD-7_SCORE'N=-3;

References

Spitzer RL, Kroenke K, Williams JBW, Löwe B. A Brief Measure for Assessing Generalized Anxiety Disorder: The GAD-7. Arch Intern Med. 2006;166(10): 1092-1097. doi:10.1001/archinte.166.10.1092.

NLSY79 Appendix 24: Reanalysis of the 1980 AFQT Data from the NLSY79

The NLSY79 and NLSY97 are unique in that virtually all respondents took the Armed Forces Vocational Aptitude Battery (ASVAB), with the results for the NLSY79 being used to norm the test. This appendix discusses the psychometrics of the Armed Forces Qualifying Test (AFQT) administered in 1980, with attention to the implications the analysis has for the efficient administration of those tests.

Download Appendix 24: Reanalysis of the 1980 AFQT Data from the NLSY79 (PDF).

 

NLSY79 Appendix 23: Revised Asset and Debt Variables and Computed TOTAL Net Wealth Variables

The NLSY79 public release data contains a variety of asset and debt data, as well as some computed variables depicting total net family wealth at each survey point. Below are descriptions of revised asset and debt variables for survey years 1985-2000 (found in ASSETS area of interest with question names ending in “_REVISED”) and the constructed Total Net Family Wealth (TNFW_TRUNC) variables.

Revised asset and debt variables

The public release contains a revised set of asset and debt variables for survey years 1985-2000. These revised asset and debt variables were created in 2008 and fixed a number of problems with the NLSY79 data by eliminating some implausible outliers and generating uniform topcodes for all rounds. These variables are then used in the computation of Total Net Family Wealth variables. Two versions of each asset and debt variable appear in the data. Using the market value of residential property owned by the respondent in 1987 as an example, the following variables appear in the data:

  • R23627.00 [Q13-118] MARKET VALUE OF RESIDENTIAL PROPERTY R/SPOUSE OWN (TRUNC)
  • R23627.01 [Q13-118_REVISED] MARKET VALUE OF RESIDENTIAL PROPERTY R/SPOUSE OWN (TRUNC) (REVISED)

In the example, Q13-118 is the original variable which remains in the dataset to allow researchers to reproduce previous results. Q13-118_REVISED, as indicated, is a revised version of Q13-118, which uses a modified topcoding algorithm. This algorithm provides researchers with some additional information with respect to the topcoded range of responses.

Table 1 gives an example using the 1987 property value question of how seven different types of cases were handled by the revision process.

Table 1. Hypothetical examples of how NLSY79 asset/debt data were modified
Case Example data of original 
R Number (R23627.00) & Question Name (Q13-118)
Example data of revised 
R Number (R23627.01) & Question Name (Q13_118-REVISED)
Explanation
#1 $150,001 $276,984 Originally above the topcode and the value is still above the topcode but the topcode is now higher, revealing more information.
#2 $150,001 $151,500 Originally above topcode and now below topcode. Value is no longer topcoded.
#3 -1 -1 Originally “refused”.
#4 -2 -2 Originally “don't know”.
#5 -3 -3 Originally an “invalid skip”.
#6 -4 -4 Originally a valid skip. Since valid skip means does not have the asset the item is changed to zero.
#7 -2 -2 Originally “don't know”.

Not every asset or debt variable has a new revised version. 15 asset/debt categories were created in each year, matching the categories found in the 1990s NLSY79 wealth module. The categories are: Home Value, Mortgage Value, Property Debt Value, Cash Saving, Stocks/Bonds, Trusts, Business Assets, Business Debts, Vehicle Value, Vehicle Debt, Possession Value, Other Debt Value, IRA, 401K, Certificate of Deposit Value. In 2000 and subsequent survey years, some complexities were added to the asset and wealth module as the cohort aged. For these more recent survey rounds, each asset/debt category corresponds to multiple individual asset/debt variables.

For example, in 2004 respondents were asked to report the values of two homes. Their values are combined to form the "home value" category. Similarly, in 2004 the "stocks/bonds" category represents the individually-reported values of government bonds, mutual funds, life insurance surrender values, stocks, corporate bonds, and money owed to the respondent.

Details of the revisions to asset values 1985-2000

The process for creating the revised variables described above can be broken down into the three steps described below.

Step 1 -- Cleaning raw data

The original raw data for many asset/wealth variables contains a number of “out-of-range” codes. Some of these out-of-range codes denoted values that exceeded the maximum value accommodated in the questionnaire and allowed for by the data entry software. These out-of-range codes were originally given the top code value when released to the public. Examination of cases with out-of-range suggests some were mistakes and not actually out of range. This issue arises in the pre-1993 Paper and Pencil interviewing (PAPI) years, but is most prevalent in survey years 1988 and 1989. For the REVISED/Q13-118_REVISED set of variables, these out-of-range codes were assigned an "invalid missing" (-3) code. These cases can be found by identifying values that were top coded in the original version of a variable (Q13-118) but were assigned an “invalid missing” code (-3) in the REVISED version (Q13-118_REVISED).

Step 2 -- Unfolding brackets

Unfolding brackets are a means for respondents to estimate certain asset values of which they were unsure. Respondents who are unable to report a specific value for an asset or liability are asked a series of questions to establish a loose range for a value (see Appendix 20: Round 20 (2002) Early Bird and Income Recall Experiments for further information on the use of unfolding brackets in the NLSY79). A respondent who does not know or refuses to report the value of his certificate of deposit (CD) would first be asked if the CD is worth more than a randomly assigned entry amount ($10,000 for some respondents and $20,000 for others). If the value is not above the entry amount, the respondent is asked if the value of his CD is worth $5,000 or more. If the value is above the entry amount, he is asked if the value would amount to $30,000 or more. These three questions result in four potential reported ranges: 1) below $5,000; 2) between $5,000 and the entry amount; 3) between the entry amount and $30,000; and 4) above $30,000.

Beginning in survey year 2000, as part of an experiment for estimation of values, unfolding brackets were used for four asset/debt categories and the net wealth question. In 2004, unfolding brackets were expanded to all asset/debt categories for which respondents were not sure of a value.

Estimates given for asset values were incorporated into the calculation of TNFW_TRUNC variables by:

  • Using the midpoint of the range for quartiles 1, 2 and 3 and;
  • Using the median of values between the floor and highest value reported for quartile 4.

Step 3 -- Revision of top codes

In the final step, new and consistent top codes were calculated for the wealth data.

The NLSY79 has used three basic types of top coding algorithms for financial data. In the early years of the survey (up to 1988), every response above a specified ceiling value, such as $100,000 for some variables, is recoded to the ceiling value plus one dollar, such as $100,001. Unfortunately this algorithm results in a sharp downward bias in the sample mean because the right tail of the distribution is sharply truncated. From 1989 to 1994, a new algorithm was implemented, replacing all values above the hard ceiling with the average of all outlying values. Beginning in 1996, the hard ceiling value was eliminated and the average of the top 2% of values above the traditional hard ceiling was used as a topcode value.

In addition to the multiple topcoding methods used over time, some researchers commented on the lack of information above a hard ceiling. The data cleaning steps described above also dramatically changed a number of the highest asset values. For these reasons, home and vehicle values were re-topcoded. Homes and vehicles are clearly identifiable objects which pose the possibility of reidentifying respondents. Business-related values over $1,000,000 are also topcoded due to reidentification concerns. Other asset or debt categories are no longer topcoded because it is difficult to use them to identify a particular respondent. If the variable was previously topcoded it was re-topcoded using the top 2% of values as described above.

Computed net wealth variables

The current data release includes an updated set of net wealth variables. Unlike previous version of these items, these updated variables (named “TNFW_TRUNC”) do not incorporate imputations.

Below is a brief history and description of the variables that were used as components, sometimes combined by category, to create the TNFW_TRUNC figures. Information is still available on individual assets and debts for researchers who want to probe a particular aspect of a respondent’s financial life, such as their debts or ownership of vehicles. 

Click below to view programming code.

This part of Appendix 23 includes the programs that created the TNFW_TRUNC (Total Net Family Wealth) Variables for survey years 1985-2020.

1985 to 1987 TNFW_TRUNC variable creation


/*******************************/
/* Adjust for missing codes */
/*******************************/

array setmsngr (n) q13_118_revised q13_119_revised q13_120_revised q13_122_revised q13_131_revised
                  q13_132_revised q13_135_revised q13_136_revised q13_138_revised q13_140_revised;

do n = 1 to 10;
 if (sampweight = .) then setmsngr = -5;
  else if (setmsngr = .) then setmsngr = -4;
end;  

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i)      homec mortc pdebtc cashc bizc bdebtc cdebtc carc posesc odebtc tnfw_trunc; /* 11 */

do i = 1 to 11;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;

/************************/
/* Compute POSES        */
/************************/

if (q13_137 = 1 & q13_138_revised >= 0) then posesc = (posesc + q13_138_revised);
 else if (q13_137 = 1 & q13_138_revised in(-1, -2, -3)) then posesc = -3;

/************************/
/* Compute ODEBT        */
/************************/

if (q13_139 = 1 & q13_140_revised >= 0) then odebtc = (odebtc + q13_140_revised);
 else if (q13_139 = 1 & q13_140_revised in(-1, -2, -3)) then odebtc = -3;

/************************/
/* Compute BIZ          */
/************************/

if (q13_128 = 1 & q13_131_revised >= 0) then bizc = (bizc + q13_131_revised);
 else if (q13_128 = 1 & q13_131_revised in(-1, -2, -3)) then bizc = -3;

/************************/
/* Compute BDEBT        */
/************************/

if (q13_132_revised >= 0) then bdebtc = (bdebtc + q13_132_revised);
 else if (q13_132_revised in(-1, -2, -3)) then bdebtc = -3;

/************************/
/* Compute CASH         */
/************************/

if (q13_121 = 1 & q13_122_revised >= 0) then cashc = (cashc + q13_122_revised);
 else if (q13_121 = 1 & q13_122_revised in(-1, -2, -3)) then cashc = -3;

/************************/
/* Compute HOME         */
/************************/

if (q13_117 = 1 & q13_118_revised >= 0) then homec = (homec + q13_118_revised);
 else if (q13_117 = 1 & q13_118_revised in(-1, -2, -3)) then homec = -3;

/************************/
/* Compute MORT         */
/************************/

if (q13_119_revised >= 0) then mortc = (mortc + q13_119_revised);
 else if (q13_119_revised in(-1, -2, -3)) then mortc = -3;

/************************/
/* Compute PDEBT        */
/************************/

if (q13_120_revised >= 0) then pdebtc = (pdebtc + q13_120_revised);
  else if (q13_120_revised in(-1, -2, -3)) then pdebtc = -3;

/************************/
/* Compute CDEBT        */
/************************/

if (q13_134 = 1 & q13_135_revised >= 0) then cdebtc = (cdebtc + q13_135_revised);
 else if (q13_134 = 1 & q13_135_revised in(-1, -2, -3)) then cdebtc = -3;

/************************/
/* Compute CAR          */
/************************/

if (q13_133 = 1 & q13_136_revised >= 0) then carc = (carc + q13_136_revised);
 else if (q13_133 = 1 & q13_136_revised in(-1, -2, -3)) then carc = -3;

/***********************/
/* Compute TNFW_TRUNC  */
/***********************/
/*********************************************************/
/* TNFW_TRUNC - add components created in above code     */
/*********************************************************/

if (sampweight = 0) then tnfw_trunc = -5;

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/*********************************************/
/* APPLY TOPCODES TO TNFW_TRUNC BY SURVEY YR */
/*********************************************/

if (tnfw_trunc_1985 > 488773) then tnfw_trunc_1985 = 1054132;
if (tnfw_trunc_1986 > 471571) then tnfw_trunc_1986 = 679856;
if (tnfw_trunc_1987 > 488649) then tnfw_trunc_1987 = 1005767;

tnfw_trunc_1985 = round(tnfw_trunc_1985);
tnfw_trunc_1986 = round(tnfw_trunc_1986);
tnfw_trunc_1987 = round(tnfw_trunc_1987);

1988 to 1993 TNFW_TRUNC variable creation


/*******************************/
/* Adjust for missing codes    */
/*******************************/

array setmsngr (n) q13_118_revised q13_119_revised q13_120_revised q13_122_revised q13_125_revised
                   q13_127_revised q13_131_revised q13_132_revised q13_135_revised q13_136_revised 
                   q13_138_revised q13_140_revised;

do n = 1 to 12;
 if (sampweight = .) then setmsngr = -5;
  else if (setmsngr = .) then setmsngr = -4;
end;  


/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i)      homec mortc pdebtc cashc stockc trustc bizc bdebtc cdebtc carc posesc odebtc tnfw_trunc; /* 13 */

do i = 1 to 13;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;

/************************/
/* Compute POSES        */
/************************/

if (q13_137 = 1 & q13_138_revised >= 0) then posesc = (posesc + q13_138_revised);
 else if (q13_137 = 1 & q13_138_revised in(-1, -2, -3)) then posesc = -3;

/************************/
/* Compute ODEBT        */
/************************/

if (q13_139 = 1 & q13_140_revised >= 0) then odebtc = (odebtc + q13_140_revised);
 else if (q13_139 = 1 & q13_140_revised in(-1, -2, -3)) then odebtc = -3;

/************************/
/* Compute STOCK        */
/************************/

if (q13_124 = 1 & q13_125_revised >= 0) then stockc = (stockc + q13_125_revised);
 else if (q13_124 = 1 & q13_125_revised in(-1, -2, -3)) then stockc = -3;

/************************/
/* Compute TRUST        */
/************************/

if (q13_126 = 1 & q13_127_revised >= 0) then trustc = (trustc + q13_127_revised);
 else if (q13_126 = 1 & q13_127_revised in(-1, -2, -3)) then trustc = -3;

/************************/
/* Compute BIZ          */
/************************/

if (q13_128 = 1 & q13_131_revised >= 0) then bizc = (bizc + q13_131_revised);
 else if (q13_128 = 1 & q13_131_revised in(-1, -2, -3)) then bizc = -3;

/************************/
/* Compute BDEBT        */
/************************/

if (q13_132_revised >= 0) then bdebtc = (bdebtc + q13_132_revised);
 else if (q13_132_revised in(-1, -2, -3)) then bdebtc = -3;

/************************/
/* Compute CASH         */
/************************/

if (q13_121 = 1 & q13_122_revised >= 0) then cashc = (cashc + q13_122_revised);
 else if (q13_121 = 1 & q13_122_revised in(-1, -2, -3)) then cashc = -3;

/************************/
/* Compute HOME         */
/************************/

if (q13_117 = 1 & q13_118_revised >= 0) then homec = (homec + q13_118_revised);
 else if (q13_117 = 1 & q13_118_revised in(-1, -2, -3)) then homec = -3;

/************************/
/* Compute MORT         */
/************************/

if (q13_119_revised >= 0) then mortc = (mortc + q13_119_revised);
 else if (q13_119_revised in(-1, -2, -3)) then mortc = -3;

/************************/
/* Compute PDEBT        */
/************************/

if (q13_120_revised >= 0) then pdebtc = (pdebtc + q13_120_revised);
  else if (q13_120_revised in(-1, -2, -3)) then pdebtc = -3;

/************************/
/* Compute CDEBT        */
/************************/

if (q13_134 = 1 & q13_135_revised >= 0) then cdebtc = (cdebtc + q13_135_revised);
 else if (q13_134 = 1 & q13_135_revised in(-1, -2, -3)) then cdebtc = -3;

/************************/
/* Compute CAR          */
/************************/

if (q13_133 = 1 & q13_136_revised >= 0) then carc = (carc + q13_136_revised);
 else if (q13_133 = 1 & q13_136_revised in(-1, -2, -3)) then carc = -3;

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (sampweight = 0) then tnfw_trunc = -5;

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (trustc >= 0) then tnfw_trunc = (tnfw_trunc + trustc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (trustc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/*********************************************/
/* APPLY TOPCODES TO TNFW_TRUNC BY SURVEY YR */
/*********************************************/

if (tnfw_trunc_1988 > 493828) then tnfw_trunc_1988 = 778437;
if (tnfw_trunc_1989 > 496507) then tnfw_trunc_1989 = 1103405;
if (tnfw_trunc_1990 > 499800) then tnfw_trunc_1990 = 1321099;
if (tnfw_trunc_1992 > 495536) then tnfw_trunc_1992 = 1148782;
if (tnfw_trunc_1993 >= 497550) then tnfw_trunc_1993 = 1116977;

tnfw_trunc_1988 = round(tnfw_trunc_1988);
tnfw_trunc_1989 = round(tnfw_trunc_1989);
tnfw_trunc_1990 = round(tnfw_trunc_1990);
tnfw_trunc_1992 = round(tnfw_trunc_1992);
tnfw_trunc_1993 = round(tnfw_trunc_1993);
 

1994 to 1998 TNFW_TRUNC variable creation


/*******************************/
/* Adjust for missing codes    */
/*******************************/

array setmsngr (n) q13_118_revised q13_119_revised q13_120_revised q13_122_revised q13_123a_revised
                   q13_123c_revised q13_123e_revised q13_125_revised
                   q13_127_revised q13_131_revised q13_132_revised q13_135_revised q13_136_revised 
                   q13_138_revised q13_140_revised;

do n = 1 to 15;
 if (sampweight = .) then setmsngr = -5;
  else if (setmsngr = .) then setmsngr = -4;
end;  


/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/


array assetsc (i)      homec mortc pdebtc cashc irac a401kc cdsc stockc trustc bizc bdebtc 
                       cdebtc carc posesc odebtc tnfw_trunc; /* 16 */


do i = 1 to 16;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;


/*************************/
/* Compute POSES         */
/*************************/

if (q13_137 = 1 & q13_138_revised >= 0) then posesc = (posesc + q13_138_revised);
 else if (q13_137 = 1 & q13_138_revised in(-1, -2, -3)) then posesc = -3;
 

/*************************/
/* Compute ODEBT         */
/*************************/

if (q13_139 = 1 & q13_140_revised >= 0) then odebtc = (odebtc + q13_140_revised);
 else if (q13_139 = 1 & q13_140_revised in(-1, -2, -3)) then odebtc = -3;
 

/*************************/
/* Compute STOCK         */
/*************************/

if (q13_124 = 1 & q13_125_revised >= 0) then stockc = (stockc + q13_125_revised);
 else if (q13_124 = 1 & q13_125_revised in(-1, -2, -3)) then stockc = -3;
 

/*************************/
/* Compute TRUST         */
/*************************/

if (q13_126 = 1 & q13_127_revised >= 0) then trustc = (trustc + q13_127_revised);
 else if (q13_126 = 1 & q13_127_revised in(-1, -2, -3)) then trustc = -3;
 

/*************************/
/* Compute BIZ           */
/*************************/

if (q13_128 = 1 & q13_131_revised >= 0) then bizc = (bizc + q13_131_revised);
 else if (q13_128 = 1 & q13_131_revised in(-1, -2, -3)) then bizc = -3;
 

/*************************/
/* Compute BDEBT         */
/*************************/

if (q13_132_revised >= 0) then bdebtc = (bdebtc + q13_132_revised);
 else if (q13_132_revised in(-1, -2, -3)) then bdebtc = -3;
 

/*************************/
/* Compute CASH          */
/*************************/

if (q13_121 = 1 & q13_122_revised >= 0) then cashc = (cashc + q13_122_revised);
 else if (q13_121 = 1 & q13_122_revised in(-1, -2, -3)) then cashc = -3;


/*************************/
/* Compute IRA           */
/*************************/

if (q13_123 = 1 & q13_123a_revised >= 0) then irac = (irac + q13_123a_revised);
 else if (q13_123 = 1 & q13_123a_revised in(-1, -2, -3)) then irac = -3;


/*************************/
/* Compute A401K         */
/*************************/

if (q13_123b = 1 & q13_123c_revised >= 0) then a401kc = (a401kc + q13_123c_revised);
 else if (q13_123b = 1 & q13_123c_revised in(-1, -2, -3)) then a401kc = -3;


/*************************/
/* Compute CDS           */
/*************************/

if (q13_123d = 1 & q13_123e_revised >= 0) then a401kc = (a401kc + q13_123e_revised);
 else if (q13_123d = 1 & q13_123e_revised in(-1, -2, -3)) then a401kc = -3;


/*************************/
/* Compute HOME          */
/*************************/

if (q13_117 = 1 & q13_118_revised >= 0) then homec = (homec + q13_118_revised);
 else if (q13_117 = 1 & q13_118_revised in(-1, -2, -3)) then homec = -3;
 

/*************************/
/* Compute MORT          */
/*************************/

if (q13_119_revised >= 0) then mortc = (mortc + q13_119_revised);
 else if (q13_119_revised in(-1, -2, -3)) then mortc = -3;
 

/*************************/
/* Compute PDEBT         */
/*************************/

if (q13_120_revised >= 0) then pdebtc = (pdebtc + q13_120_revised);
  else if (q13_120_revised in(-1, -2, -3)) then pdebtc = -3;
 

/*************************/
/* Compute CDEBT         */
/*************************/

if (q13_134 = 1 & q13_135_revised >= 0) then cdebtc = (cdebtc + q13_135_revised);
 else if (q13_134 = 1 & q13_135_revised in(-1, -2, -3)) then cdebtc = -3;
 

/*************************/
/* Compute CAR           */
/*************************/

if (q13_133 = 1 & q13_136_revised >= 0) then carc = (carc + q13_136_revised);
 else if (q13_133 = 1 & q13_136_revised in(-1, -2, -3)) then carc = -3;
 

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (sampweight = 0) then tnfw_trunc = -5;

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (irac   >= 0) then tnfw_trunc = (tnfw_trunc + irac  );
if (a401kc >= 0) then tnfw_trunc = (tnfw_trunc + a401kc);
if (cdsc   >= 0) then tnfw_trunc = (tnfw_trunc + cdsc  );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (trustc >= 0) then tnfw_trunc = (tnfw_trunc + trustc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (irac   in(-1, -2, -3)) then tnfw_trunc = -3;
if (a401kc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdsc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (trustc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/*********************************************/
/* APPLY TOPCODES TO TNFW_TRUNC BY SURVEY YR */
/*********************************************/

if (tnfw_trunc_1994 > 500000) then tnfw_trunc_1994 = 1224375;
if (tnfw_trunc_1996 > 548000) then tnfw_trunc_1996 = 1232183;
if (tnfw_trunc_1998 > 640682) then tnfw_trunc_1998 = 1674836;

tnfw_trunc_1994 = round(tnfw_trunc_1994);
tnfw_trunc_1996 = round(tnfw_trunc_1996);
tnfw_trunc_1998 = round(tnfw_trunc_1998);
 

2000 TNFW_TRUNC variable creation


/************************************/
/* Compute dynamic QUARTILE VALUES  */
/************************************/

array quartileqs (i) q13_122_quartile1 q13_122_quartile2 q13_122_quartile3 q13_122_quartile4
q13_123c_quartile1 q13_123c_quartile2 q13_123c_quartile3 q13_123c_quartile4
q13_125_quartile1 q13_125_quartile2 q13_125_quartile3 q13_125_quartile4
q13_136_quartile1 q13_136_quartile2 q13_136_quartile3 q13_136_quartile4;

do i = 1 to 16;
quartileqs = 0;
end;

q13_122_quartile1 = (500/2);
q13_122_quartile2 = (500 + ((1500-500)/2));
q13_122_quartile3 = (1500 + ((3500-1500)/2));
q13_122_quartile4 = 60000;

q13_123c_quartile1 = (1000/2);
q13_123c_quartile2 = (1000 + ((4000-1000)/2));
q13_123c_quartile3 = (4000 + ((10000-4000)/2));
q13_123c_quartile4 = 75000;

q13_125_quartile1 = (1000/2);
q13_125_quartile2 = (1000 + ((4000-1000)/2));
q13_125_quartile3 = (4000 + ((15000-4000)/2));
q13_125_quartile4 = 85000;

q13_136_quartile1 = (1000/2);
q13_136_quartile2 = (1000 + ((5000-1000)/2));
q13_136_quartile3 = (5000 + ((10000-5000)/2));
q13_136_quartile4 = 40000;

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i)   homec mortc pdebtc cashc irac a401kc cdsc stockc trustc trustc bizc 
                    bdebtc cdebtc carc posesc odebtc tnfw_trunc
                    solebiz farm_1_value1 farm_2_value1 business_1_value1 business_2_value1
                    business_3_value1 realestate_1_value1 realestate_2_value1 realestate_3_value1 realestate_4_value1
                    realestate_5_value1 realestate_6_value1
                    farm_1_value farm_2_value business_1_value business_2_value business_3_value realestate_1_value 
                    realestate_2_value realestate_3_value realestate_4_value realestate_5_value realestate_6_value
                    debtbiz farm_1_debt1 farm_2_debt1 business_1_debt1 business_2_debt1 business_3_debt1 
                    farm_1_debt farm_2_debt business_1_debt business_2_debt business_3_debt;


do i = 1 to 51;
if (sampweight = 0) then assetsc = -5;
else if (sampweight > 0) then assetsc = 0;
end;

/***********************/
/* Compute POSES       */
/***********************/

if (q13_137 = 1 & q13_138_revised >= 0) then posesc = (posesc + q13_138_revised);
else if (q13_137 = 1 & q13_138_revised in(-1, -2)) then posesc = -3;

/***********************/
/* Compute ODEBT       */
/***********************/

if (q13_139 = 1 & q13_140_revised >= 0) then odebtc = (odebtc + q13_140_revised);
else if (q13_139 = 1 & q13_140_revised in(-1, -2)) then odebtc = -3;

/***********************/
/* Compute TRUST       */
/***********************/

if (q13_126 = 1 & q13_127_revised >= 0) then trustc = (trustc + q13_127_revised);
else if (q13_126 = 1 & q13_127_revised in(-1, -2)) then trustc = -3;

/***********************/
/* Compute BIZ         */
/***********************/

/*****************************/
/* BIZ Component - solebiz   */
/*****************************/

if (q13_131_revised >= 0) then solebiz = (solebiz + q13_131_revised);
else if (q13_131_revised in(-1, -2)) then solebiz = -3;

/********************************************************************************************************/
/* BIZ Components - farm_#_value, business_#_value, realestate_#_value & percentage ownership           */
/********************************************************************************************************/

if (q13_fjt_11_01_trunc > -4) then farm_1_value1 = q13_fjt_11_01_trunc;
if (q13_fjt_11_02_trunc > -4) then farm_2_value1 = q13_fjt_11_02_trunc;
if (q13_bppjt_11_01_trunc > -4) then business_1_value1 = q13_bppjt_11_01_trunc;
if (q13_bppjt_11_02_trunc > -4) then business_2_value1 = q13_bppjt_11_02_trunc;
if (q13_bppjt_11_03_trunc > -4) then business_3_value1 = q13_bppjt_11_03_trunc;
if (q13_rejt_11_01 > -4) then realestate_1_value1 = q13_rejt_11_01;
if (q13_rejt_11_02 > -4) then realestate_2_value1 = q13_rejt_11_02;
if (q13_rejt_11_03 > -4) then realestate_3_value1 = q13_rejt_11_03;
if (q13_rejt_11_04 > -4) then realestate_4_value1 = q13_rejt_11_04;
if (q13_rejt_11_05 > -4) then realestate_5_value1 = q13_rejt_11_05;
if (q13_rejt_11_06 > -4) then realestate_6_value1 = q13_rejt_11_06;

if (q13_fjt_12b_01 > -4) then farm_1_pcntshare = q13_fjt_12b_01;
if (q13_fjt_12b_02 > -4) then farm_2_pcntshare = q13_fjt_12b_02;
if (q13_bppjt_12b_01 > -4) then business_1_pcntshare = q13_bppjt_12b_01;
if (q13_bppjt_12b_02 > -4) then business_2_pcntshare = q13_bppjt_12b_02;
if (q13_bppjt_12b_03 > -4) then business_3_pcntshare = q13_bppjt_12b_03;
if (q13_rejt_12b_01 > -4) then realestate_1_pcntshare = q13_rejt_12b_01;
if (q13_rejt_12b_02 > -4) then realestate_2_pcntshare = q13_rejt_12b_02;
if (q13_rejt_12b_03 > -4) then realestate_3_pcntshare = q13_rejt_12b_03;
if (q13_rejt_12b_04 > -4) then realestate_4_pcntshare = q13_rejt_12b_04;
if (q13_rejt_12b_05 > -4) then realestate_5_pcntshare = q13_rejt_12b_05;
if (q13_rejt_12b_06 > -4) then realestate_6_pcntshare = q13_rejt_12b_06;

if (farm_1_pcntshare > 0) then farm_1_pcntshare = (farm_1_pcntshare / 100);
if (farm_2_pcntshare > 0) then farm_2_pcntshare = (farm_2_pcntshare / 100);
if (business_1_pcntshare > 0) then business_1_pcntshare = (business_1_pcntshare / 100);
if (business_2_pcntshare > 0) then business_2_pcntshare = (business_2_pcntshare / 100);
if (business_3_pcntshare > 0) then business_3_pcntshare = (business_3_pcntshare / 100);
if (realestate_1_pcntshare > 0) then realestate_1_pcntshare = (realestate_1_pcntshare / 100);
if (realestate_2_pcntshare > 0) then realestate_2_pcntshare = (realestate_2_pcntshare / 100);
if (realestate_3_pcntshare > 0) then realestate_3_pcntshare = (realestate_3_pcntshare / 100);
if (realestate_4_pcntshare > 0) then realestate_4_pcntshare = (realestate_4_pcntshare / 100);
if (realestate_5_pcntshare > 0) then realestate_5_pcntshare = (realestate_5_pcntshare / 100);
if (realestate_6_pcntshare > 0) then realestate_6_pcntshare = (realestate_6_pcntshare / 100);

if (farm_1_value1 >= 0 & farm_1_pcntshare >= 0) then farm_1_value = (farm_1_value1 * farm_1_pcntshare);
if (farm_2_value1 >= 0 & farm_2_pcntshare >= 0) then farm_2_value = (farm_2_value1 * farm_2_pcntshare);
if (business_1_value1 >= 0 & business_1_pcntshare >= 0) then business_1_value = (business_1_value1 * business_1_pcntshare);
if (business_2_value1 >= 0 & business_2_pcntshare >= 0) then business_2_value = (business_2_value1 * business_2_pcntshare);
if (business_3_value1 >= 0 & business_3_pcntshare >= 0) then business_3_value = (business_3_value1 * business_3_pcntshare);
if (realestate_1_value1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_value = (realestate_1_value1 * realestate_1_pcntshare);
if (realestate_2_value1 >= 0 & realestate_2_pcntshare >= 0) then realestate_2_value = (realestate_2_value1 * realestate_2_pcntshare);
if (realestate_3_value1 >= 0 & realestate_3_pcntshare >= 0) then realestate_3_value = (realestate_3_value1 * realestate_3_pcntshare);
if (realestate_4_value1 >= 0 & realestate_4_pcntshare >= 0) then realestate_4_value = (realestate_4_value1 * realestate_4_pcntshare);
if (realestate_5_value1 >= 0 & realestate_5_pcntshare >= 0) then realestate_5_value = (realestate_5_value1 * realestate_5_pcntshare);
if (realestate_6_value1 >= 0 & realestate_6_pcntshare >= 0) then realestate_6_value = (realestate_6_value1 * realestate_6_pcntshare);

/*****************************/
/* Add components BIZ        */
/*****************************/

if (solebiz >= 0) then bizc = (bizc + solebiz); 
if (farm_1_value >= 0) then bizc = (bizc + farm_1_value);
if (farm_2_value >= 0) then bizc = (bizc + farm_2_value);
if (business_1_value >= 0) then bizc = (bizc + business_1_value);
if (business_2_value >= 0) then bizc = (bizc + business_2_value);
if (business_3_value >= 0) then bizc = (bizc + business_3_value);
if (realestate_1_value >= 0) then bizc = (bizc + realestate_1_value);
if (realestate_2_value >= 0) then bizc = (bizc + realestate_2_value);
if (realestate_3_value >= 0) then bizc = (bizc + realestate_3_value);
if (realestate_4_value >= 0) then bizc = (bizc + realestate_4_value);
if (realestate_5_value >= 0) then bizc = (bizc + realestate_5_value);
if (realestate_6_value >= 0) then bizc = (bizc + realestate_6_value);

if (solebiz in(-1, -2)) then bizc = -3;
if (farm_1_value in(-1, -2) | farm_1_pcntshare in(-1, -2)) then bizc = -3;
if (farm_2_value in(-1, -2) | farm_2_pcntshare in(-1, -2)) then bizc = -3;
if (business_1_value in(-1, -2) | business_1_pcntshare in(-1, -2)) then bizc = -3;
if (business_2_value in(-1, -2) | business_2_pcntshare in(-1, -2)) then bizc = -3;
if (business_3_value in(-1, -2) | business_3_pcntshare in(-1, -2)) then bizc = -3;
if (realestate_1_value in(-1, -2) | realestate_1_pcntshare in(-1, -2)) then bizc = -3;
if (realestate_2_value in(-1, -2) | realestate_2_pcntshare in(-1, -2)) then bizc = -3;
if (realestate_3_value in(-1, -2) | realestate_3_pcntshare in(-1, -2)) then bizc = -3;
if (realestate_4_value in(-1, -2) | realestate_4_pcntshare in(-1, -2)) then bizc = -3;
if (realestate_5_value in(-1, -2) | realestate_5_pcntshare in(-1, -2)) then bizc = -3;
if (realestate_6_value in(-1, -2) | realestate_6_pcntshare in(-1, -2)) then bizc = -3;

/****************************/
/* Compute BDEBT            */
/****************************/

/*****************************/
/* BDEBT Component - debtbiz */
/*****************************/

if (q13_132_revised >= 0) then debtbiz = (debtbiz + q13_132_revised);
else if (q13_132_revised in(-1, -2)) then debtbiz = -3;

/*****************************************************************************************/
/* BDEBT Components - farm_#_debt, business_#_debt, realestate_#_debt                    */
/*       (use ownership percentage computed above for bizc)                              */
/*****************************************************************************************/

if (q13_fjt_12_01 > -4) then farm_1_debt1 = q13_fjt_12_01;
if (q13_fjt_12_02 > -4) then farm_2_debt1 = q13_fjt_12_02;
if (q13_bppjt_12_01_trunc > -4) then business_1_debt1 = q13_bppjt_12_01_trunc;
if (q13_bppjt_12_02_trunc > -4) then business_2_debt1 = q13_bppjt_12_02_trunc;
if (q13_bppjt_12_03_trunc > -4) then business_3_debt1 = q13_bppjt_12_03_trunc;

if (farm_1_debt1 >= 0 & farm_1_pcntshare >= 0) then farm_1_debt = (farm_1_debt1 * farm_1_pcntshare);
if (farm_2_debt1 >= 0 & farm_2_pcntshare >= 0) then farm_2_debt = (farm_2_debt1 * farm_2_pcntshare);
if (business_1_debt1 >= 0 & business_1_pcntshare >= 0) then business_1_debt = (business_1_debt1 * business_1_pcntshare);
if (business_2_debt1 >= 0 & business_2_pcntshare >= 0) then business_2_debt = (business_2_debt1 * business_2_pcntshare);
if (business_3_debt1 >= 0 & business_3_pcntshare >= 0) then business_3_debt = (business_3_debt1 * business_3_pcntshare);

/*****************************/
/* Add components BDEBT      */
/*****************************/

if (debtbiz >= 0) then bdebtc = (bdebtc + debtbiz); 
if (farm_1_debt >= 0) then bdebtc = (bdebtc + farm_1_debt);
if (farm_2_debt >= 0) then bdebtc = (bdebtc + farm_2_debt);
if (business_1_debt >= 0) then bdebtc = (bdebtc + business_1_debt);
if (business_2_debt >= 0) then bdebtc = (bdebtc + business_2_debt);
if (business_3_debt >= 0) then bdebtc = (bdebtc + business_3_debt);

if (debtbiz in(-1, -2)) then bdebtc = -3;
if (farm_1_debt in(-1, -2) | farm_1_pcntshare in(-1, -2)) then bdebtc = -3;
if (farm_2_debt in(-1, -2) | farm_2_pcntshare in(-1, -2)) then bdebtc = -3;
if (business_1_debt in(-1, -2) | business_1_pcntshare in(-1, -2)) then bdebtc = -3;
if (business_2_debt in(-1, -2) | business_2_pcntshare in(-1, -2)) then bdebtc = -3;
if (business_3_debt in(-1, -2) | business_3_pcntshare in(-1, -2)) then bdebtc = -3;

/*****************************/
/* Compute CASH              */
/*****************************/

if (q13_121 = 1 & q13_122_revised >= 0) then cashc = (cashc + q13_122_revised);
else if (q13_121 = 1 & q13_122_revised in(-1, -2) & q13_122a < 0 & q13_122b < 0 
& q13_122c < 0) then cashc = -3;
else if (q13_122_revised in(-1, -2) & q13_122b = 0) then cashc = (cashc + q13_122_quartile1);
else if (q13_122_revised in(-1, -2) & q13_122b = 1) then cashc = (cashc + q13_122_quartile2);
else if (q13_122_revised in(-1, -2) & q13_122c = 0) then cashc = (cashc + q13_122_quartile3);
else if (q13_122_revised in(-1, -2) & q13_122c = 1) then cashc = (cashc + 60000);

/*****************************/
/* Compute CDS               */
/*****************************/

if (q13_123d = 1 & q13_123e_revised >= 0) then cdsc = (cdsc + q13_123e_revised);
else if (q13_123d = 1 & q13_123e_revised in(-1, -2)) then cdsc = -3;

/*****************************/
/* Compute STOCK             */
/*****************************/

if (q13_124 = 1 & q13_125_revised >= 0) then stockc = (stockc + q13_125_revised);
 else if (q13_124 = 1 & q13_125_revised in(-1, -2) & q13_125a < 0 & q13_125b < 0 
 & q13_125c < 0) then stockc = -3;
  else if (q13_125_revised in(-1, -2) & q13_125b = 0) then stockc = (stockc + q13_125_quartile1);
   else if (q13_125_revised in(-1, -2) & q13_125b = 1) then stockc = (stockc + q13_125_quartile2);
    else if (q13_125_revised in(-1, -2) & q13_125c = 0) then stockc = (stockc + q13_125_quartile3);
     else if (q13_125_revised in(-1, -2) & q13_125c = 1) then stockc = (stockc + 85000);

/*****************************/
/* Compute HOME              */
/*****************************/

if (q13_117 = 1 & q13_118_revised >= 0) then homec = (homec + q13_118_revised);
else if (q13_117 = 1 & q13_118_revised in(-1, -2)) then homec = -3;

/*****************************/
/* Compute MORT              */
/*****************************/

if (q13_119_revised >= 0) then mortc = (mortc + q13_119_revised);
else if (q13_119_revised in(-1, -2)) then mortc = -3;

/*****************************/
/* Compute PDEBT             */
/*****************************/

if (q13_120_revised >= 0) then pdebtc = (pdebtc + q13_120_revised);
else if (q13_120_revised in(-1, -2)) then pdebtc = -3;

/*****************************/
/* Compute IRA               */
/*****************************/

if (q13_123 = 1 & q13_123a_revised >= 0) then irac = (irac + q13_123a_revised);
else if (q13_123 = 1 & q13_123a_revised in(-1, -2)) then irac = -3;

/*****************************/
/* Compute A401K             */
/*****************************/

if (q13_123b = 1 & q13_123c_revised >= 0) then a401kc = (a401kc + q13_123c_revised);
else if (q13_123b = 1 & q13_123c_revised in(-1, -2) & q13_123c_1 < 0 & q13_123c_2 < 0 
& q13_123c_3 < 0) then a401kc = -3;
else if (q13_123c_revised in(-1, -2) & q13_123c_2 = 0) then a401kc = (a401kc + q13_123c_quartile1); 
else if (q13_123c_revised in(-1, -2) & q13_123c_2 = 1) then a401kc = (a401kc + q13_123c_quartile2);
else if (q13_123c_revised in(-1, -2) & q13_123c_3 = 0) then a401kc = (a401kc + q13_123c_quartile3);
else if (q13_123c_revised in(-1, -2) & q13_123c_3 = 1) then a401kc = (a401kc + 75000);

/*****************************/
/* Compute CDEBT             */
/*****************************/

if (q13_134 = 1 & q13_135_revised >= 0) then cdebtc = (cdebtc + q13_135_revised);
else if (q13_134 = 1 & q13_135_revised in(-1, -2)) then cdebtc = -3;


/*****************************/
/* Compute CAR               */
/*****************************/

if (q13_133 = 1 & q13_136_revised >= 0) then carc = (carc + q13_136_revised);
else if (q13_133 = 1 & q13_136_revised in(-1, -2) & q13_136a < 0 & q13_136b < 0 & q13_136c < 0) then carc = -3;
else if (q13_136_revised in(-1, -2) & q13_136b = 0) then carc = (carc + q13_136_quartile1);
else if (q13_136_revised in(-1, -2) & q13_136b = 1) then carc = (carc + q13_136_quartile2);
else if (q13_136_revised in(-1, -2) & q13_136c = 0) then carc = (carc + q13_136_quartile3);
else if (q13_136_revised in(-1, -2) & q13_136c = 1) then carc = (carc + 40000);

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (irac   >= 0) then tnfw_trunc = (tnfw_trunc + irac  );
if (a401kc >= 0) then tnfw_trunc = (tnfw_trunc + a401kc);
if (cdsc   >= 0) then tnfw_trunc = (tnfw_trunc + cdsc  );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (trustc >= 0) then tnfw_trunc = (tnfw_trunc + trustc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (irac   in(-1, -2, -3)) then tnfw_trunc = -3;
if (a401kc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdsc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (trustc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/****************************************/
/* APPLY TOPCODE TO TNFW_TRUNC FOR 2000 */
/****************************************/

if (tnfw_trunc_2000 > 928938) then tnfw_trunc_2000 = 2056326;

tnfw_trunc_2000 = round(tnfw_trunc_2000);
 

2004 TNFW_TRUNC variable creation


/***************************************************/
/* Compute dollar amt for dollars & cents vars     */
/***************************************************/

nfa_7d_truncc = nfa_7d_trunc;
if (nfa_7d_trunc > 0) then nfa_7d_truncc = (nfa_7d_trunc/100);

debt_1ac = debt_1a_trunc;
if (debt_1a_trunc > 0) then debt_1ac = (debt_1a_trunc/100);

debt_2ac = debt_2a_trunc;
if (debt_2a_trunc > 0) then debt_2ac = (debt_2a_trunc/100);

debt_2dc = debt_2d_trunc;
if (debt_2d_trunc > 0) then debt_2dc = (debt_2d_trunc/100);

debt_3ac = debt_3a_trunc;
if (debt_3a_trunc > 0) then debt_3ac = (debt_3a_trunc/100);

debt_4ac = debt_4a_trunc;
if (debt_4a_trunc > 0) then debt_4ac = (debt_4a_trunc/100);

/***************************************************/
/* Compute dynamic QUARTILE VALUES for estimates   */
/***************************************************/

array quartileqs (i) quartile1 quartile2 quartile3 quartile4;

do i = 1 to 4;
 quartileqs = 0;
end;

if (symbol_entry_othhh = 10000) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((10000-5000)/2));
  quartile3 = (10000 + ((30000-10000)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;
else if (symbol_entry_othhh = 20000) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((20000-5000)/2));
  quartile3 = (20000 + ((30000-20000)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i)      homec mortc pdebtc cashc irac a401kc cdsc stockc trustc bizc
                       bdebtc cdebtc carc posesc odebtc tnfw_trunc
                       collections items ccdebt studentloan childstudentloan owebusiness otherdebt
                       solebiz farm_1_value1 farm_2_value1 business_1_value1 business_2_value1
                       business_3_value1 realestate_1_value1 realestate_2_value1 realestate_3_value1 realestate_4_value1
                       farm_1_value farm_2_value business_1_value business_2_value business_3_value realestate_1_value
                       realestate_2_value realestate_3_value realestate_4_value
                       debtbiz farm_1_debt1 farm_2_debt1 business_1_debt1 business_2_debt1 business_3_debt1
                       farm_1_debt farm_2_debt business_1_debt business_2_debt business_3_debt
                       govbonds mutual lifeinsure shares corpbond moneyowedtor
                       home1 secondhome mort1 secondmort pdebt1 secondpdebt
                       ira1 ira2 ira3 ira4 ira5 ira6 ira7 r_401k sp_401k
                       amtowe_assetpoorcars1 amtowe_assetpoorcars2 amtowe_assetpoorcars3
                       amountowe_vehicles1 amountowe_vehicles2 amountowe_vehicles3 amountowe_vehicles4
                       amountowe_vehicles5 amountowe_vehicles6 amtowe_othervehicles
                       mktval_assetpoorcars1 mktval_assetpoorcars2 mktval_assetpoorcars3
                       marketvalue_vehicles1 marketvalue_vehicles2 marketvalue_vehicles3 marketvalue_vehicles4
                       marketvalue_vehicles5 marketvalue_vehicles6 marketvalue_vehicles7 marketvalue_vehicles8
                       marketvalue_vehicles7 marketvalue_vehicles8 marketvalue_vehicles9 marketvalue_vehicles10
                       marketvalue_vehicles11 marketvalue_vehicles12
                       marketvalue_vehicles13 marketvalue_vehicles14 marketvalue_vehicles15 mktval_othervehicles;

do i = 1 to 105;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;

/****************************/
/* Compute POSES            */
/****************************/
/********************************************/
/* POSES Component - collections            */
/********************************************/

if (nfa_6a = 1 & nfa_6e_trunc >= 0) then collections = (collections + nfa_6e_trunc);
 else if (nfa_6a = 1 & nfa_6e_ref_1 = 1 & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0
 & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = -1;
  else if (nfa_6a = 1 & nfa_6e_trunc in(-1, -2) & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0
  & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = nfa_6e_trunc;
    else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 = nfa_6e_sr000001) then
    collections = (collections + nfa_6e_sr000001);
     else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 > nfa_6e_sr000001) then
     collections = (collections + (((nfa_6e_sr000002 - nfa_6e_sr000001)/2) + nfa_6e_sr000001));
      else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 < nfa_6e_sr000001) then
      collections = (collections + (((nfa_6e_sr000001 - nfa_6e_sr000002)/2) + nfa_6e_sr000002));
       else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 0) then collections = (collections + quartile1);
        else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 1) then collections = (collections + quartile2);
         else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 0) then collections = (collections + quartile3);
          else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 1) then collections = (collections + 55000);
           else if (nfa_6e_uab_a in(-1, -2) | nfa_6e_uab_b in(-1, -2) | nfa_6e_uab_c in(-1, -2)) then collections = -3;

/********************************************/
/* POSES Component - items                  */
/********************************************/

if (nfa_7 = 1 & nfa_7d_truncc >= 0) then items = (items + nfa_7d_truncc);
 else if (nfa_7 = 1 & nfa_7d_ref_1 = 1 & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = -1;
  else if (nfa_7 = 1 & nfa_7d_truncc in(-1, -2) & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = nfa_7d_truncc;
   else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 0) then items = (items + quartile1);
    else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 1) then items = (items + quartile2);
     else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 0) then items = (items + quartile3);
      else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 1) then items = (items + 60000);
       else if (nfa_7d_uab_a in(-1, -2) | nfa_7d_uab_b in(-1, -2) | nfa_7d_uab_c in(-1, -2)) then items = -3;

/*******************************/
/* Add components POSES        */
/*******************************/

if (collections >= 0) then posesc = (posesc + collections);
if (items >= 0) then posesc = (posesc + items);
if (collections in(-1, -2, -3)) then posesc = -3;
else if (items in(-1, -2, -3)) then posesc = -3;

/****************************/
/* Compute ODEBT            */
/****************************/

/********************************************/
/* ODEBT Component - ccdebt                 */
/********************************************/

if (debt_1 = 1 & debt_1ac >= 0) then ccdebt = (ccdebt + debt_1ac);
 else if (debt_1 = 1 & debt_1a_ref_1 = 1 & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0
 & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = -1;
  else if (debt_1 = 1 & debt_1ac in(-1, -2) & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0
  & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = debt_1ac;
    else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 = debt_1a_sr000001) then
    ccdebt = (ccdebt + debt_1a_sr000001);
     else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 > debt_1a_sr000001) then
     ccdebt = (ccdebt + (((debt_1a_sr000002 - debt_1a_sr000001)/2) + debt_1a_sr000001));
      else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 < debt_1a_sr000001) then
      ccdebt = (ccdebt + (((debt_1a_sr000001 - debt_1a_sr000002)/2) + debt_1a_sr000002));
       else if (debt_1ac in(-1, -2, -4) & debt_1a_uab_b = 0) then ccdebt = (ccdebt + quartile1);
        else if (debt_1ac in(-1, -2, -4) & debt_1a_uab_b = 1) then ccdebt = (ccdebt + quartile2);
         else if (debt_1ac in(-1, -2, -4) & debt_1a_uab_c = 0) then ccdebt = (ccdebt + quartile3);
          else if (debt_1ac in(-1, -2, -4) & debt_1a_uab_c = 1) then ccdebt = (ccdebt + 47500);
           else if (debt_1a_uab_a in(-1, -2) | debt_1a_uab_b in(-1, -2) | debt_1a_uab_c in(-1, -2)) then ccdebt = -3;

/********************************************/
/* ODEBT Component - studentloan            */
/********************************************/

if (debt_2 = 1 & debt_2ac >= 0) then studentloan = (studentloan + debt_2ac);
 else if (debt_2 = 1 & debt_2a_ref_1 = 1 & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 & debt_2a_uab_c < 0) then studentloan = -1;
  else if (debt_2 = 1 & debt_2ac in(-1, -2) & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 & debt_2a_uab_c < 0) then studentloan = debt_2ac;
   else if (debt_2ac in(-1, -2, -4) & debt_2a_uab_b = 0) then studentloan = (studentloan + quartile1);
    else if (debt_2ac in(-1, -2, -4) & debt_2a_uab_b = 1) then studentloan = (studentloan + quartile2);
     else if (debt_2ac in(-1, -2, -4) & debt_2a_uab_c = 0) then studentloan = (studentloan + quartile3);
      else if (debt_2ac in(-1, -2, -4) & debt_2a_uab_c = 1) then studentloan = (studentloan + 50000);
       else if (debt_2a_uab_a in(-1, -2) | debt_2a_uab_b in(-1, -2) | debt_2a_uab_c in(-1, -2)) then studentloan = -3;

/********************************************/
/* ODEBT Component - childstudentloan       */
/********************************************/

if (debt_2c = 1 & debt_2dc >= 0) then childstudentloan = (childstudentloan + debt_2dc);
 else if (debt_2c = 1 & debt_2d_ref_1 = 1 & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 & debt_2d_uab_c < 0) then childstudentloan = -1;
  else if (debt_2c = 1 & debt_2dc in(-1, -2) & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 & debt_2d_uab_c < 0) then childstudentloan = debt_2dc;
   else if (debt_2dc in(-1, -2, -4) & debt_2d_uab_b = 0) then childstudentloan = (childstudentloan + quartile1);
    else if (debt_2dc in(-1, -2, -4) & debt_2d_uab_b = 1) then childstudentloan = (childstudentloan + quartile2);
     else if (debt_2dc in(-1, -2, -4) & debt_2d_uab_c = 0) then childstudentloan = (childstudentloan + quartile3);
      else if (debt_2dc in(-1, -2, -4) & debt_2d_uab_c = 1) then childstudentloan = (childstudentloan + 39000);
       else if (debt_2d_uab_a in(-1, -2) | debt_2d_uab_b in(-1, -2) | debt_2d_uab_c in(-1, -2)) then childstudentloan = -3;

/********************************************/
/* ODEBT Component - owebusiness            */
/********************************************/

if (debt_3 = 1 & debt_3ac >= 0) then owebusiness = (owebusiness + debt_3ac);
 else if (debt_3 = 1 & debt_3a_ref_1 = 1 & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 & debt_3a_uab_c < 0) then owebusiness = -1;
  else if (debt_3 = 1 & debt_3ac in(-1, -2) & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 & debt_3a_uab_c < 0) then owebusiness = debt_3ac;
   else if (debt_3ac in(-1, -2, -4) & debt_3a_uab_b = 0) then owebusiness = (owebusiness + quartile1);
    else if (debt_3ac in(-1, -2, -4) & debt_3a_uab_b = 1) then owebusiness = (owebusiness + quartile2);
     else if (debt_3ac in(-1, -2, -4) & debt_3a_uab_c = 0) then owebusiness = (owebusiness + quartile3);
      else if (debt_3ac in(-1, -2, -4) & debt_3a_uab_c = 1) then owebusiness = (owebusiness + 56000);
       else if (debt_3a_uab_a in(-1, -2) | debt_3a_uab_b in(-1, -2) | debt_3a_uab_c in(-1, -2)) then owebusiness = -3;

/********************************************/
/* ODEBT Component - otherdebt              */
/********************************************/

if (debt_4 = 1 & debt_4ac >= 0) then otherdebt = (otherdebt + debt_4ac);
 else if (debt_4 = 1 & debt_4a_ref_1 = 1 & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 & debt_4a_uab_c < 0) then otherdebt = -1;
  else if (debt_4 = 1 & debt_4ac in(-1, -2) & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 & debt_4a_uab_c < 0) then otherdebt = debt_4ac;
   else if (debt_4ac in(-1, -2, -4) & debt_4a_uab_b = 0) then otherdebt = (otherdebt + quartile1);
    else if (debt_4ac in(-1, -2, -4) & debt_4a_uab_b = 1) then otherdebt = (otherdebt + quartile2);
     else if (debt_4ac in(-1, -2, -4) & debt_4a_uab_c = 0) then otherdebt = (otherdebt + quartile3);
      else if (debt_4ac in(-1, -2, -4) & debt_4a_uab_c = 1) then otherdebt = (otherdebt + 58500);
       else if (debt_4a_uab_a in(-1, -2) | debt_4a_uab_b in(-1, -2) | debt_4a_uab_c in(-1, -2)) then otherdebt = -3;

/*******************************/
/* Add components ODEBT        */
/*******************************/

if (ccdebt >= 0) then odebtc = (odebtc + ccdebt);
if (studentloan >= 0) then odebtc = (odebtc + studentloan);
if (childstudentloan >= 0) then odebtc = (odebtc + childstudentloan);
if (owebusiness >= 0) then odebtc = (odebtc + owebusiness);
if (otherdebt >= 0) then odebtc = (odebtc + otherdebt);
if (ccdebt in(-1, -2, -3)) then odebtc = -3;
else if (studentloan in(-1, -2, -3)) then odebtc = -3;
else if (childstudentloan in(-1, -2, -3)) then odebtc = -3;
else if (owebusiness in(-1, -2, -3)) then odebtc = -3;
else if (otherdebt in(-1, -2, -3)) then odebtc = -3;

/****************************/
/* Compute BIZ              */
/****************************/

/********************************************/
/* BIZ Component - solebiz                  */
/********************************************/

if (q13_131_trunc >= 0) then solebiz = (solebiz + q13_131_trunc);
 else if (q13_131_trunc = 1 & q13_131_ref_1 = 1 & q13_131_sr000001 < 0 & q13_131_sr000002 < 0
 & q13_131_uab_a < 0 & q13_131_uab_b < 0 & q13_131_uab_c < 0) then solebiz = -1;
  else if (q13_131_trunc in(-1, -2) & q13_131_sr000001 < 0 & q13_131_sr000002 < 0
  & q13_131_uab_a < 0 & q13_131_uab_b < 0 & q13_131_uab_c < 0) then solebiz = q13_131_trunc;
   else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 = q13_131_sr000001) then
   solebiz = (solebiz + q13_131_sr000001);
    else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 > q13_131_sr000001) then
    solebiz = (solebiz + (((q13_131_sr000002 - q13_131_sr000001)/2) + q13_131_sr000001));
     else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 < q13_131_sr000001) then
     solebiz = (solebiz + (((q13_131_sr000001 - q13_131_sr000002)/2) + q13_131_sr000002));
      else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_b = 0) then solebiz = (solebiz + quartile1);
       else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_b = 1) then solebiz = (solebiz + quartile2);
        else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 0) then solebiz = (solebiz + quartile3);
         else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 1) then solebiz = (solebiz + 202500);
          else if (q13_131_uab_a in(-1, -2) | q13_131_uab_b in(-1, -2) | q13_131_uab_c in(-1, -2)) then solebiz = -3;

/********************************************************************************************************/
/* BIZ Components - farm_#_value, business_#_value, realestate_#_value & percentage ownership           */
/********************************************************************************************************/

if (q13_fjt_11_01 > -4) then farm_1_value1 = q13_fjt_11_01;
if (q13_fjt_11_trunc_02 > -4) then farm_2_value1 = q13_fjt_11_trunc_02;
if (q13_bppjt_11_trunc_01 > -4) then business_1_value1 = q13_bppjt_11_trunc_01;
if (q13_bppjt_11_trunc_02 > -4) then business_2_value1 = q13_bppjt_11_trunc_02;
if (q13_bppjt_11_03 > -4) then business_3_value1 = q13_bppjt_11_03;
if (q13_rejt_11_trunc_01 > -4) then realestate_1_value1 = q13_rejt_11_trunc_01;
if (q13_rejt_11_02 > -4) then realestate_2_value1 = q13_rejt_11_02;
if (q13_rejt_11_03 > -4) then realestate_3_value1 = q13_rejt_11_03;
if (q13_rejt_11_04 > -4) then realestate_4_value1 = q13_rejt_11_04;

if (q13_fjt_12b_01 > -4) then farm_1_pcntshare = q13_fjt_12b_01;
if (q13_fjt_12b_02 > -4) then farm_2_pcntshare = q13_fjt_12b_02;
if (q13_bppjt_12b_01 > -4) then business_1_pcntshare = q13_bppjt_12b_01;
if (q13_bppjt_12b_02 > -4) then business_2_pcntshare = q13_bppjt_12b_02;
if (q13_bppjt_12b_03 > -4) then business_3_pcntshare = q13_bppjt_12b_03;
if (q13_rejt_12b_01 > -4) then realestate_1_pcntshare = q13_rejt_12b_01;
if (q13_rejt_12b_02 > -4) then realestate_2_pcntshare = q13_rejt_12b_02;
if (q13_rejt_12b_03 > -4) then realestate_3_pcntshare = q13_rejt_12b_03;
if (q13_rejt_12b_04 > -4) then realestate_4_pcntshare = q13_rejt_12b_04;

if (farm_1_pcntshare > 0) then farm_1_pcntshare = (farm_1_pcntshare / 100);
if (farm_2_pcntshare > 0) then farm_2_pcntshare = (farm_2_pcntshare / 100);
if (business_1_pcntshare > 0) then business_1_pcntshare = (business_1_pcntshare / 100);
if (business_2_pcntshare > 0) then business_2_pcntshare = (business_2_pcntshare / 100);
if (business_3_pcntshare > 0) then business_3_pcntshare = (business_3_pcntshare / 100);
if (realestate_1_pcntshare > 0) then realestate_1_pcntshare = (realestate_1_pcntshare / 100);
if (realestate_2_pcntshare > 0) then realestate_2_pcntshare = (realestate_2_pcntshare / 100);
if (realestate_3_pcntshare > 0) then realestate_3_pcntshare = (realestate_3_pcntshare / 100);
if (realestate_4_pcntshare > 0) then realestate_4_pcntshare = (realestate_4_pcntshare / 100);

if (farm_1_value1 >= 0 & farm_1_pcntshare >= 0) then farm_1_value = (farm_1_value1 * farm_1_pcntshare);
if (farm_2_value1 >= 0 & farm_2_pcntshare >= 0) then farm_2_value = (farm_2_value1 * farm_2_pcntshare);
if (business_1_value1 >= 0 & business_1_pcntshare >= 0) then business_1_value = (business_1_value1 * business_1_pcntshare);
if (business_2_value1 >= 0 & business_2_pcntshare >= 0) then business_2_value = (business_2_value1 * business_2_pcntshare);
if (business_3_value1 >= 0 & business_3_pcntshare >= 0) then business_3_value = (business_3_value1 * business_3_pcntshare);
if (realestate_1_value1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_value = (realestate_1_value1 * realestate_1_pcntshare);
if (realestate_2_value1 >= 0 & realestate_2_pcntshare >= 0) then realestate_2_value = (realestate_2_value1 * realestate_2_pcntshare);
if (realestate_3_value1 >= 0 & realestate_3_pcntshare >= 0) then realestate_3_value = (realestate_3_value1 * realestate_3_pcntshare);
if (realestate_4_value1 >= 0 & realestate_4_pcntshare >= 0) then realestate_4_value = (realestate_4_value1 * realestate_4_pcntshare);

/*******************************/
/* Add components BIZ          */
/*******************************/

if (solebiz >= 0) then bizc = (bizc + solebiz);
if (farm_1_value >= 0) then bizc = (bizc + farm_1_value);
if (farm_2_value >= 0) then bizc = (bizc + farm_2_value);
if (business_1_value >= 0) then bizc = (bizc + business_1_value);
if (business_2_value >= 0) then bizc = (bizc + business_2_value);
if (business_3_value >= 0) then bizc = (bizc + business_3_value);
if (realestate_1_value >= 0) then bizc = (bizc + realestate_1_value);
if (realestate_2_value >= 0) then bizc = (bizc + realestate_2_value);
if (realestate_3_value >= 0) then bizc = (bizc + realestate_3_value);
if (realestate_4_value >= 0) then bizc = (bizc + realestate_4_value);

if (solebiz in(-1, -2, -3)) then bizc = -3;
if (farm_1_value in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_2_value in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_1_value in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_2_value in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_3_value in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_1_value in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_2_value in(-1, -2, -3) | realestate_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_3_value in(-1, -2, -3) | realestate_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_4_value in(-1, -2, -3) | realestate_4_pcntshare in(-1, -2, -3)) then bizc = -3;

/****************************/
/* Compute BDEBT            */
/****************************/

/********************************************/
/* BDEBT Component - debtbiz                */
/********************************************/

if (q13_132_trunc >= 0) then debtbiz = (debtbiz + q13_132_trunc);
 else if (q13_132_trunc = 1 & q13_132_ref_1 = 1 & q13_132_sr000001 < 0 & q13_132_sr000002 < 0
 & q13_132_uab_a < 0 & q13_132_uab_b < 0) then debtbiz = -1;
  else if (q13_132_trunc in(-1, -2) & q13_132_sr000001 < 0 & q13_132_sr000002 < 0
  & q13_132_uab_a < 0 & q13_132_uab_b < 0) then debtbiz = q13_132_trunc;
   else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 = q13_132_sr000001) then
   debtbiz = (debtbiz + q13_132_sr000001);
    else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 > q13_132_sr000001) then
    debtbiz = (debtbiz + (((q13_132_sr000002 - q13_132_sr000001)/2) + q13_132_sr000001));
     else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 < q13_132_sr000001) then
     debtbiz = (debtbiz + (((q13_132_sr000001 - q13_132_sr000002)/2) + q13_132_sr000002));
      else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_b = 0) then debtbiz = (debtbiz + quartile1);
       else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_b = 1) then debtbiz = (debtbiz + quartile2);
        else if (q13_132_uab_a in(-1, -2) | q13_132_uab_b in(-1, -2)) then debtbiz = -3;

/********************************************************************************************************/
/* BDEBT Components - farm_#_debt, business_#_debt, realestate_#_debt                                   */
/*       (use ownership percentage computed above for bizc)                                             */
/********************************************************************************************************/

if (q13_fjt_12_01 > -4) then farm_1_debt1 = q13_fjt_12_01;
if (q13_fjt_12_02 > -4) then farm_2_debt1 = q13_fjt_12_02;
if (q13_bppjt_12_trunc_01 > -4) then business_1_debt1 = q13_bppjt_12_trunc_01;
if (q13_bppjt_12_trunc_02 > -4) then business_2_debt1 = q13_bppjt_12_trunc_02;
if (q13_bppjt_12_03 > -4) then business_3_debt1 = q13_bppjt_12_03;

if (farm_1_debt1 >= 0 & farm_1_pcntshare >= 0) then farm_1_debt = (farm_1_debt1 * farm_1_pcntshare);
if (farm_2_debt1 >= 0 & farm_2_pcntshare >= 0) then farm_2_debt = (farm_2_debt1 * farm_2_pcntshare);
if (business_1_debt1 >= 0 & business_1_pcntshare >= 0) then business_1_debt = (business_1_debt1 * business_1_pcntshare);
if (business_2_debt1 >= 0 & business_2_pcntshare >= 0) then business_2_debt = (business_2_debt1 * business_2_pcntshare);
if (business_3_debt1 >= 0 & business_3_pcntshare >= 0) then business_3_debt = (business_3_debt1 * business_3_pcntshare);

/*******************************/
/* Add components BDEBT        */
/*******************************/

if (debtbiz >= 0) then bdebtc = (bdebtc + debtbiz);
if (farm_1_debt >= 0) then bdebtc = (bdebtc + farm_1_debt);
if (farm_2_debt >= 0) then bdebtc = (bdebtc + farm_2_debt);
if (business_1_debt >= 0) then bdebtc = (bdebtc + business_1_debt);
if (business_2_debt >= 0) then bdebtc = (bdebtc + business_2_debt);
if (business_3_debt >= 0) then bdebtc = (bdebtc + business_3_debt);

if (debtbiz in(-1, -2, -3)) then bdebtc = -3;
if (farm_1_debt in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_2_debt in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_1_debt in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_2_debt in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_3_debt in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bdebtc = -3;

/****************************/
/* Compute CASH             */
/****************************/

/********************************************/
/* CASH Component - cash                    */
/********************************************/

if (fa_1 = 1 & fa_1a_trunc >= 0) then cashc = (cashc + fa_1a_trunc);
 else if (fa_1 = 1 & fa_1_ref_1 = 1 & fa_1a_sr000001_tc < 0 & fa_1a_sr000002_tc < 0
 & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = -1;
  else if (fa_1 = 1 & fa_1a_trunc in(-1, -2) & fa_1a_sr000001_tc < 0 & fa_1a_sr000002_tc < 0
  & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = fa_1a_trunc;
   else if (fa_1a_sr000001_tc >= 0 & fa_1a_sr000002_tc >= 0 & fa_1a_sr000002_tc = fa_1a_sr000001_tc) then
   cashc = (cashc + fa_1a_sr000001_tc);
    else if (fa_1a_sr000001_tc >= 0 & fa_1a_sr000002_tc >= 0 & fa_1a_sr000002_tc > fa_1a_sr000001_tc) then
    cashc = (cashc + (((fa_1a_sr000002_tc - fa_1a_sr000001_tc)/2) + fa_1a_sr000001_tc));
     else if (fa_1a_sr000001_tc >= 0 & fa_1a_sr000002_tc >= 0 & fa_1a_sr000002_tc < fa_1a_sr000001_tc) then
     cashc = (cashc + (((fa_1a_sr000001_tc - fa_1a_sr000002_tc)/2) + fa_1a_sr000002_tc));
      else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 0) then cashc = (cashc + quartile1);
       else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 1) then cashc = (cashc + quartile2);
        else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 0) then cashc = (cashc + quartile3);
         else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 1) then cashc = (cashc + 65000);
          else if (fa_1a_uab_a in(-1, -2) | fa_1a_uab_b in(-1, -2) | fa_1a_uab_c in(-1, -2)) then cashc = -3;

/*****************************/
/* Set CASHC -3 missing      */
/*****************************/

if (cashc in(-1, -2, -3)) then cashc = -3;

/****************************/
/* Compute CDS              */
/****************************/

/********************************************/
/* CDS Component - cds                      */
/********************************************/

if (fa_2 = 1 & fa_2a_trunc >= 0) then cdsc = (cdsc + fa_2a_trunc);
 else if (fa_2 = 1 & fa_2_ref_1 = 1 & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0
 & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = -1;
  else if (fa_2 = 1 & fa_2a_trunc in(-1, -2) & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0
  & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = fa_2a_trunc;
   else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 = fa_2a_sr000001) then
   cdsc = (cdsc + fa_2a_sr000001);
    else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 > fa_2a_sr000001) then
    cdsc = (cdsc + (((fa_2a_sr000002 - fa_2a_sr000001)/2) + fa_2a_sr000001));
     else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 < fa_2a_sr000001) then
     cdsc = (cdsc + (((fa_2a_sr000001 - fa_2a_sr000002)/2) + fa_2a_sr000002));
      else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 0) then cdsc = (cdsc + quartile1);
       else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 1) then cdsc = (cdsc + quartile2);
        else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 0) then cdsc = (cdsc + quartile3);
         else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 1) then cdsc = (cdsc + 60000);
          else if (fa_2a_uab_a in(-1, -2) | fa_2a_uab_b in(-1, -2) | fa_2a_uab_c in(-1, -2)) then cdsc = -3;

/*****************************/
/* Set CDSC -3 missing       */
/*****************************/

if (cdsc in(-1, -2, -3)) then cdsc = -3;


/****************************/
/* Compute STOCK            */
/****************************/

/********************************************/
/* STOCK Component - govbonds               */
/********************************************/

if (fa_3 = 1 & fa_3a_trunc >= 0) then govbonds = (govbonds + fa_3a_trunc);
 else if (fa_3 = 1 & fa_3_ref_1 = 1 & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0
 & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = -1;
  else if (fa_3 = 1 & fa_3a_trunc in(-1, -2) & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0
  & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = fa_3a_trunc;
   else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 = fa_3a_sr000001) then
   govbonds = (govbonds + fa_3a_sr000001);
    else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 > fa_3a_sr000001) then
    govbonds = (govbonds + (((fa_3a_sr000002 - fa_3a_sr000001)/2) + fa_3a_sr000001));
     else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 < fa_3a_sr000001) then
     govbonds = (govbonds + (((fa_3a_sr000001 - fa_3a_sr000002)/2) + fa_3a_sr000002));
      else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_b = 0) then govbonds = (govbonds + quartile1);
       else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_b = 1) then govbonds = (govbonds + quartile2);
        else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_c = 0) then govbonds = (govbonds + quartile3);
         else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_c = 1) then govbonds = (govbonds + 57500);
          else if (fa_3a_uab_a in(-1, -2) | fa_3a_uab_b in(-1, -2) | fa_3a_uab_c in(-1, -2)) then govbonds = -3;

/********************************************/
/* STOCK Component - mutual                 */
/********************************************/

if (fa_4 = 1 & fa_4a_trunc >= 0) then mutual = (mutual + fa_4a_trunc);
 else if (fa_4 = 1 & fa_4_ref_1 = 1 & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0
 & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = -1;
  else if (fa_4 = 1 & fa_4a_trunc in(-1, -2) & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0
  & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = fa_4a_trunc;
   else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 = fa_4a_sr000001) then
   mutual = (mutual + fa_4a_sr000001);
    else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 > fa_4a_sr000001) then
    mutual = (mutual + (((fa_4a_sr000002 - fa_4a_sr000001)/2) + fa_4a_sr000001));
     else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 < fa_4a_sr000001) then
     mutual = (mutual + (((fa_4a_sr000001 - fa_4a_sr000002)/2) + fa_4a_sr000002));
      else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 0) then mutual = (mutual + quartile1);
       else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 1) then mutual = (mutual + quartile2);
        else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 0) then mutual = (mutual + quartile3);
         else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 1) then mutual = (mutual + 70000);
          else if (fa_4a_uab_a in(-1, -2) | fa_4a_uab_b in(-1, -2) | fa_4a_uab_c in(-1, -2)) then mutual = -3;

/********************************************/
/* STOCK Component - lifeinsure             */
/********************************************/

if (fa_5 = 1 & fa_5a_trunc >= 0) then lifeinsure = (lifeinsure + fa_5a_trunc);
 else if (fa_5 = 1 & fa_5_ref_1 = 1 & fa_5a_sr000001 < 0 & fa_5a_sr000002 < 0
 & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = -1;
  else if (fa_5 = 1 & fa_5a_trunc in(-1, -2) & fa_5a_sr000001 < 0 & fa_5a_sr000002 < 0
  & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = fa_5a_trunc;
   else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 = fa_5a_sr000001) then
   lifeinsure = (lifeinsure + fa_5a_sr000001);
    else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 > fa_5a_sr000001) then
    lifeinsure = (lifeinsure + (((fa_5a_sr000002 - fa_5a_sr000001)/2) + fa_5a_sr000001));
     else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 < fa_5a_sr000001) then
     lifeinsure = (lifeinsure + (((fa_5a_sr000001 - fa_5a_sr000002)/2) + fa_5a_sr000002));
      else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 0) then lifeinsure = (lifeinsure + quartile1);
       else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 1) then lifeinsure = (lifeinsure + quartile2);
        else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 0) then lifeinsure = (lifeinsure + quartile3);
         else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 1) then lifeinsure = (lifeinsure + 100000);
          else if (fa_5a_uab_a in(-1, -2) | fa_5a_uab_b in(-1, -2) | fa_5a_uab_c in(-1, -2)) then lifeinsure = -3;

/********************************************/
/* STOCK Component - shares                 */
/********************************************/

if (fa_9 = 1 & fa_9a_trunc >= 0) then shares = (shares + fa_9a_trunc);
 else if (fa_9 = 1 & fa_9_ref_1 = 1 & fa_9a_sr000001 < 0 & fa_9a_sr000002 < 0
 & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = -1;
  else if (fa_9 = 1 & fa_9a_trunc in(-1, -2) & fa_9a_sr000001 < 0 & fa_9a_sr000002 < 0
  & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = fa_9a_trunc;
   else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 = fa_9a_sr000001) then
   shares = (shares + fa_9a_sr000001);
    else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 > fa_9a_sr000001) then
    shares = (shares + (((fa_9a_sr000002 - fa_9a_sr000001)/2) + fa_9a_sr000001));
     else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 < fa_9a_sr000001) then
     shares = (shares + (((fa_9a_sr000001 - fa_9a_sr000002)/2) + fa_9a_sr000002));
      else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 0) then shares = (shares + quartile1);
       else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 1) then shares = (shares + quartile2);
        else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 0) then shares = (shares + quartile3);
         else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 1) then shares = (shares + 100000);
          else if (fa_9a_uab_a in(-1, -2) | fa_9a_uab_b in(-1, -2) | fa_9a_uab_c in(-1, -2)) then shares = -3;

/********************************************/
/* STOCK Component - corpbond               */
/********************************************/

if (fa_10 = 1 & fa_10a_trunc >= 0) then corpbond = (corpbond + fa_10a_trunc);
 else if (fa_10 = 1 & fa_10_ref_1 = 1 & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0
 & fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = -1;
  else if (fa_10 = 1 & fa_10a_trunc in(-1, -2) & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0
  & fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = fa_10a_trunc;
   else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 = fa_10a_sr000001) then
   corpbond = (corpbond + fa_10a_sr000001);
    else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 > fa_10a_sr000001) then
    corpbond = (corpbond + (((fa_10a_sr000002 - fa_10a_sr000001)/2) + fa_10a_sr000001));
     else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 < fa_10a_sr000001) then
     corpbond = (corpbond + (((fa_10a_sr000001 - fa_10a_sr000002)/2) + fa_10a_sr000002));
      else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 0) then corpbond = (corpbond + quartile1);
       else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 1) then corpbond = (corpbond + quartile2);
        else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 0) then corpbond = (corpbond + quartile3);
         else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 1) then corpbond = (corpbond + 100000);
          else if (fa_10a_uab_a in(-1, -2) | fa_10a_uab_b in(-1, -2) | fa_10a_uab_c in(-1, -2)) then corpbond = -3;

/********************************************/
/* STOCK Component - moneyowedtor           */
/********************************************/

if (fa_11 = 1 & fa_11a_trunc >= 0) then moneyowedtor = (moneyowedtor + fa_11a_trunc);
 else if (fa_11 = 1 & fa_11_ref_1 = 1 & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0
 & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = -1;
  else if (fa_11 = 1 & fa_11a_trunc in(-1, -2) & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0
  & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = fa_11a_trunc;
   else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 = fa_11a_sr000001) then
   moneyowedtor = (moneyowedtor + fa_11a_sr000001);
    else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 > fa_11a_sr000001) then
    moneyowedtor = (moneyowedtor + (((fa_11a_sr000002 - fa_11a_sr000001)/2) + fa_11a_sr000001));
     else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 < fa_11a_sr000001) then
     moneyowedtor = (moneyowedtor + (((fa_11a_sr000001 - fa_11a_sr000002)/2) + fa_11a_sr000002));
      else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_b = 0) then moneyowedtor = (moneyowedtor + quartile1);
       else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_b = 1) then moneyowedtor = (moneyowedtor + quartile2);
        else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_c = 0) then moneyowedtor = (moneyowedtor + quartile3);
         else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_c = 1) then moneyowedtor = (moneyowedtor + 60000);
          else if (fa_11a_uab_a in(-1, -2) | fa_11a_uab_b in(-1, -2) | fa_11a_uab_c in(-1, -2)) then moneyowedtor = -3;

/*******************************/
/* Add components STOCK        */
/*******************************/

if (govbonds >= 0) then stockc = (stockc + govbonds);
if (mutual >= 0) then stockc = (stockc + mutual);
if (lifeinsure >= 0) then stockc = (stockc + lifeinsure);
if (shares >= 0) then stockc = (stockc + shares);
if (corpbond >= 0) then stockc = (stockc + corpbond);
if (moneyowedtor >= 0) then stockc = (stockc + moneyowedtor);
if (govbonds in(-1, -2, -3)) then stockc = -3;
else if (mutual in(-1, -2, -3)) then stockc = -3;
else if (lifeinsure in(-1, -2, -3)) then stockc = -3;
else if (shares in(-1, -2, -3)) then stockc = -3;
else if (corpbond in(-1, -2, -3)) then stockc = -3;
else if (moneyowedtor in(-1, -2, -3)) then stockc = -3;

/****************************/
/* Compute HOME             */
/****************************/

/********************************************/
/* HOME Component - home1                   */
/********************************************/

if (nfa_1 = 1 & nfa_1a_trunc >= 0) then home1 = (home1 + nfa_1a_trunc);
 else if (nfa_1 = 1 & nfa_1_ref_1 = 1 & nfa_1a_sr000001 < 0 & nfa_1a_sr000002 < 0
 & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = -1;
  else if (nfa_1 = 1 & nfa_1a_trunc in(-1, -2) & nfa_1a_sr000001 < 0 & nfa_1a_sr000002 < 0
  & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = nfa_1a_trunc;
   else if (nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 = nfa_1a_sr000001) then
   home1 = (home1 + nfa_1a_sr000001);
    else if (nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 > nfa_1a_sr000001) then
    home1 = (home1 + (((nfa_1a_sr000002 - nfa_1a_sr000001)/2) + nfa_1a_sr000001));
     else if (nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 < nfa_1a_sr000001) then
     home1 = (home1 + (((nfa_1a_sr000001 - nfa_1a_sr000002)/2) + nfa_1a_sr000002));
      else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 0) then home1 = (home1 + quartile1);
       else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 1) then home1 = (home1 + quartile2);
        else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 0) then home1 = (home1 + quartile3);
         else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 1) then home1 = (home1 + 165000);
          else if (nfa_1a_uab_a in(-1, -2) | nfa_1a_uab_b in(-1, -2) | nfa_1a_uab_c in(-1, -2)) then home1 = -3;

/********************************************/
/* HOME Component - secondhome              */
/********************************************/

if (nfa_2 = 1 & nfa_2a_trunc >= 0) then secondhome = (secondhome + nfa_2a_trunc);
 else if (nfa_2 = 1 & nfa_2_ref_1 = 1 & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0
 & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = -1;
  else if (nfa_2 = 1 & nfa_2a_trunc in(-1, -2) & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0
  & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = nfa_2a_trunc;
   else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 = nfa_2a_sr000001) then
   secondhome = (secondhome + nfa_2a_sr000001);
    else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 > nfa_2a_sr000001) then
    secondhome = (secondhome + (((nfa_2a_sr000002 - nfa_2a_sr000001)/2) + nfa_2a_sr000001));
     else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 < nfa_2a_sr000001) then
     secondhome = (secondhome + (((nfa_2a_sr000001 - nfa_2a_sr000002)/2) + nfa_2a_sr000002));
      else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 0) then secondhome = (secondhome + quartile1);
       else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 1) then secondhome = (secondhome + quartile2);
        else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 0) then secondhome = (secondhome + quartile3);
         else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 1) then secondhome = (secondhome + 150000);
          else if (nfa_2a_uab_a in(-1, -2) | nfa_2a_uab_b in(-1, -2) | nfa_2a_uab_c in(-1, -2)) then secondhome = -3;

/*******************************/
/* Add components HOME         */
/*******************************/

if (home1 >= 0) then homec = (homec + home1);
if (secondhome >= 0) then homec = (homec + secondhome);
if (home1 in(-1, -2, -3)) then homec = -3;
else if (secondhome in(-1, -2, -3)) then homec = -3;

/****************************/
/* Compute MORT             */
/****************************/

/********************************************/
/* MORT Component - mort1                   */
/********************************************/

if (nfa_1b_trunc >= 0) then mort1 = (mort1 + nfa_1b_trunc);
 else if (nfa_1b_ref_1 = 1 & nfa_1b_sr000001_trunc < 0 & nfa_1b_sr000002_trunc < 0
 & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = -1;
  else if (nfa_1b_trunc in(-1, -2) & nfa_1b_sr000001_trunc < 0 & nfa_1b_sr000002_trunc < 0
  & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = nfa_1b_trunc;
   else if (nfa_1b_sr000001_trunc >= 0 & nfa_1b_sr000002_trunc >= 0 & nfa_1b_sr000002_trunc = nfa_1b_sr000001_trunc) then
   mort1 = (mort1 + nfa_1b_sr000001_trunc);
    else if (nfa_1b_sr000001_trunc >= 0 & nfa_1b_sr000002_trunc >= 0 & nfa_1b_sr000002_trunc > nfa_1b_sr000001_trunc) then
    mort1 = (mort1 + (((nfa_1b_sr000002_trunc - nfa_1b_sr000001_trunc)/2) + nfa_1b_sr000001_trunc));
     else if (nfa_1b_sr000001_trunc >= 0 & nfa_1b_sr000002_trunc >= 0 & nfa_1b_sr000002_trunc < nfa_1b_sr000001_trunc) then
     mort1 = (mort1 + (((nfa_1b_sr000001_trunc - nfa_1b_sr000002_trunc)/2) + nfa_1b_sr000002_trunc));
      else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 0) then mort1 = (mort1 + quartile1);
       else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 1) then mort1 = (mort1 + quartile2);
        else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 0) then mort1 = (mort1 + quartile3);
         else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 1) then mort1 = (mort1 + 100000);
          else if (nfa_1b_uab_a in(-1, -2) | nfa_1b_uab_b in(-1, -2) | nfa_1b_uab_c in(-1, -2)) then mort1 = -3;

/********************************************/
/* MORT Component - secondmort              */
/********************************************/

if (nfa_2b_trunc >= 0) then secondmort = (secondmort + nfa_2b_trunc);
 else if (nfa_2b_ref_1 = 1 & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0
 & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = -1;
  else if (nfa_2b_trunc in(-1, -2) & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0
  & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = nfa_2b_trunc;
   else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 = nfa_2b_sr000001) then
   secondmort = (secondmort + nfa_2b_sr000001);
    else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 > nfa_2b_sr000001) then
    secondmort = (secondmort + (((nfa_2b_sr000002 - nfa_2b_sr000001)/2) + nfa_2b_sr000001));
     else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 < nfa_2b_sr000001) then
     secondmort = (secondmort + (((nfa_2b_sr000001 - nfa_2b_sr000002)/2) + nfa_2b_sr000002));
      else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 0) then secondmort = (secondmort + quartile1);
       else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 1) then secondmort = (secondmort + quartile2);
        else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 0) then secondmort = (secondmort + quartile3);
         else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 1) then secondmort = (secondmort + 100000);
          else if (nfa_2b_uab_a in(-1, -2) | nfa_2b_uab_b in(-1, -2) | nfa_2b_uab_c in(-1, -2)) then secondmort = -3;

/*******************************/
/* Add components MORT         */
/*******************************/

if (mort1 >= 0) then mortc = (mortc + mort1);
if (secondmort >= 0) then mortc = (mortc + secondmort);
if (mort1 in(-1, -2, -3)) then mortc = -3;
else if (secondmort in(-1, -2, -3)) then mortc = -3;

/****************************/
/* Compute PDEBT            */
/****************************/

/********************************************/
/* PDEBT Component - pdebt1                 */
/********************************************/

if (nfa_1c_trunc >= 0) then pdebt1 = (pdebt1 + nfa_1c_trunc);
 else if (nfa_1c_ref_1 = 1 & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0
 & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = -1;
  else if (nfa_1c_trunc in(-1, -2) & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0
  & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = nfa_1c_trunc;
   else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 = nfa_1c_sr000001) then
   pdebt1 = (pdebt1 + nfa_1c_sr000001);
    else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 > nfa_1c_sr000001) then
    pdebt1 = (pdebt1 + (((nfa_1c_sr000002 - nfa_1c_sr000001)/2) + nfa_1c_sr000001));
     else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 < nfa_1c_sr000001) then
     pdebt1 = (pdebt1 + (((nfa_1c_sr000001 - nfa_1c_sr000002)/2) + nfa_1c_sr000002));
      else if (nfa_1c_trunc in(-1, -2, -4) & nfa_1c_uab_b = 0) then pdebt1 = (pdebt1 + quartile1);
       else if (nfa_1c_trunc in(-1, -2, -4) & nfa_1c_uab_b = 1) then pdebt1 = (pdebt1 + quartile2);
        else if (nfa_1c_trunc in(-1, -2, -4) & nfa_1c_uab_c = 0) then pdebt1 = (pdebt1 + quartile3);
         else if (nfa_1c_trunc in(-1, -2, -4) & nfa_1c_uab_c = 1) then pdebt1 = (pdebt1 + 55000);
          else if (nfa_1c_uab_a in(-1, -2) | nfa_1c_uab_b in(-1, -2) | nfa_1c_uab_c in(-1, -2)) then pdebt1 = -3;

/********************************************/
/* PDEBT Component - secondpdebt            */
/********************************************/

if (nfa_2c >= 0) then secondpdebt = (secondpdebt + nfa_2c);
 else if (nfa_2c_ref_1 = 1 & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0
 & nfa_2c_uab_a < 0 & nfa_2c_uab_b < 0) then secondpdebt = -1;
  else if (nfa_2c in(-1, -2) & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0
  & nfa_2c_uab_a < 0 & nfa_2c_uab_b < 0) then secondpdebt = nfa_2c;
   else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 = nfa_2c_sr000001) then
   secondpdebt = (secondpdebt + nfa_2c_sr000001);
    else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 > nfa_2c_sr000001) then
    secondpdebt = (secondpdebt + (((nfa_2c_sr000002 - nfa_2c_sr000001)/2) + nfa_2c_sr000001));
     else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 < nfa_2c_sr000001) then
     secondpdebt = (secondpdebt + (((nfa_2c_sr000001 - nfa_2c_sr000002)/2) + nfa_2c_sr000002));
      else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_b = 0) then secondpdebt = (secondpdebt + quartile1);
       else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_b = 1) then secondpdebt = (secondpdebt + quartile2);
        else if (nfa_2c_uab_a in(-1, -2) | nfa_2c_uab_b in(-1, -2)) then secondpdebt = -3;

/*******************************/
/* Add components PDEBT        */
/*******************************/

if (pdebt1 >= 0) then pdebtc = (pdebtc + pdebt1);
if (secondpdebt >= 0) then pdebtc = (pdebtc + secondpdebt);
if (pdebt1 in(-1, -2, -3)) then pdebtc = -3;
else if (secondpdebt in(-1, -2, -3)) then pdebtc = -3;

/****************************/
/* Compute IRA              */
/****************************/

/********************************************/
/* IRA Component - ira1                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_01 >= 0) then ira1 = (ira1 + fa_8d_trunc_01);
 else if (fa_8 = 1 & fa_8d_trunc_01 in(-1, -2) & fa_8d_sr000001_01 < 0 & fa_8d_sr000002_01 < 0
 & fa_8d_uab_a_01 < 0 & fa_8d_uab_c_01 < 0) then ira1 = fa_8d_trunc_01;
  else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 = fa_8d_sr000001_01) then
  ira1 = (ira1 + fa_8d_sr000001_01);
   else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 > fa_8d_sr000001_01) then
   ira1 = (ira1 + (((fa_8d_sr000002_01 - fa_8d_sr000001_01)/2) + fa_8d_sr000001_01));
    else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 < fa_8d_sr000001_01) then
    ira1 = (ira1 + (((fa_8d_sr000001_01 - fa_8d_sr000002_01)/2) + fa_8d_sr000002_01));
     else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 0) then ira1 = (ira1 + quartile3);
      else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 1) then ira1 = (ira1 + 77000);
       else if (fa_8d_uab_a_01 in(-1, -2) | fa_8d_uab_c_01 in(-1, -2)) then ira1 = -3;

/********************************************/
/* IRA Component - ira2                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_02 >= 0) then ira2 = (ira2 + fa_8d_trunc_02);
 else if (fa_8 = 1 & fa_8d_trunc_02 in(-1, -2) & fa_8d_sr000001_02 < 0 & fa_8d_sr000002_02 < 0
 & fa_8d_uab_a_02 < 0 & fa_8d_uab_b_02 < 0 & fa_8d_uab_c_02 < 0) then ira2 = fa_8d_trunc_02;
  else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 = fa_8d_sr000001_02) then
  ira2 = (ira2 + fa_8d_sr000001_02);
   else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 > fa_8d_sr000001_02) then
   ira2 = (ira2 + (((fa_8d_sr000002_02 - fa_8d_sr000001_02)/2) + fa_8d_sr000001_02));
    else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 < fa_8d_sr000001_02) then
    ira2 = (ira2 + (((fa_8d_sr000001_02 - fa_8d_sr000002_02)/2) + fa_8d_sr000002_02));
     else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 0) then ira2 = (ira2 + quartile1);
      else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 1) then ira2 = (ira2 + quartile2);
       else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 0) then ira2 = (ira2 + quartile3);
        else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 1) then ira2 = (ira2 + 50000);
         else if (fa_8d_uab_a_02 in(-1, -2) | fa_8d_uab_b_02 in(-1, -2) | fa_8d_uab_c_02 in(-1, -2)) then ira2 = -3;

/********************************************/
/* IRA Component - ira3                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_03 >= 0) then ira3 = (ira3 + fa_8d_trunc_03);
  else if (fa_8 = 1 & fa_8d_trunc_03 in(-1, -2) & fa_8d_sr000001_03 < 0 & fa_8d_sr000002_03 < 0
  & fa_8d_uab_a_03 < 0 & fa_8d_uab_b_03 < 0 ) then ira3 = fa_8d_trunc_03;
   else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 = fa_8d_sr000001_03) then
   ira3 = (ira3 + fa_8d_sr000001_03);
    else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 > fa_8d_sr000001_03) then
    ira3 = (ira3 + (((fa_8d_sr000002_03 - fa_8d_sr000001_03)/2) + fa_8d_sr000001_03));
     else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 < fa_8d_sr000001_03) then
     ira3 = (ira3 + (((fa_8d_sr000001_03 - fa_8d_sr000002_03)/2) + fa_8d_sr000002_03));
      else if (fa_8d_trunc_03 in(-1, -2, -4) & fa_8d_uab_b_03 = 0) then ira3 = (ira3 + quartile1);
       else if (fa_8d_trunc_03 in(-1, -2, -4) & fa_8d_uab_b_03 = 1) then ira3 = (ira3 + quartile2);
        else if (fa_8d_uab_a_03 in(-1, -2) | fa_8d_uab_b_03 in(-1, -2)) then ira3 = -3;

/********************************************/
/* IRA Component - ira4                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_04 >= 0) then ira4 = (ira4 + fa_8d_trunc_04);
  else if (fa_8 = 1 & fa_8d_trunc_04 in(-1, -2) & fa_8d_sr000001_04 < 0 & fa_8d_sr000002_04 < 0
  & fa_8d_uab_a_04 < 0 & fa_8d_uab_b_04 < 0 & fa_8d_uab_c_04 < 0) then ira4 = fa_8d_trunc_04;
   else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 = fa_8d_sr000001_04) then
   ira4 = (ira4 + fa_8d_sr000001_04);
    else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 > fa_8d_sr000001_04) then
    ira4 = (ira4 + (((fa_8d_sr000002_04 - fa_8d_sr000001_04)/2) + fa_8d_sr000001_04));
     else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 < fa_8d_sr000001_04) then
     ira4 = (ira4 + (((fa_8d_sr000001_04 - fa_8d_sr000002_04)/2) + fa_8d_sr000002_04));
      else if (fa_8d_trunc_04 in(-1, -2, -4) & fa_8d_uab_b_04 = 0) then ira4 = (ira4 + quartile1);
       else if (fa_8d_trunc_04 in(-1, -2, -4) & fa_8d_uab_b_04 = 1) then ira4 = (ira4 + quartile2);
        else if (fa_8d_trunc_04 in(-1, -2, -4) & fa_8d_uab_c_04 = 0) then ira4 = (ira4 + quartile3);
         else if (fa_8d_trunc_04 in(-1, -2, -4) & fa_8d_uab_c_04 = 1) then ira4 = (ira4 + 42500);
          else if (fa_8d_uab_a_04 in(-1, -2) | fa_8d_uab_b_04 in(-1, -2) | fa_8d_uab_c_04 in(-1, -2)) then ira4 = -3;

/********************************************/
/* IRA Component - ira5                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_05 >= 0) then ira5 = (ira5 + fa_8d_trunc_05);
  else if (fa_8 = 1 & fa_8d_trunc_05 in(-1, -2) & fa_8d_sr000001_05 < 0 & fa_8d_sr000002_05 < 0
  & fa_8d_uab_a_05 < 0 & fa_8d_uab_b_05 < 0 & fa_8d_uab_c_05 < 0) then ira5 = fa_8d_trunc_05;
   else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 = fa_8d_sr000001_05) then
   ira5 = (ira5 + fa_8d_sr000001_05);
    else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 > fa_8d_sr000001_05) then
    ira5 = (ira5 + (((fa_8d_sr000002_05 - fa_8d_sr000001_05)/2) + fa_8d_sr000001_05));
     else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 < fa_8d_sr000001_05) then
     ira5 = (ira5 + (((fa_8d_sr000001_05 - fa_8d_sr000002_05)/2) + fa_8d_sr000002_05));
      else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_b_05 = 0) then ira5 = (ira5 + quartile1);
       else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_b_05 = 1) then ira5 = (ira5 + quartile2);
        else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 0) then ira5 = (ira5 + quartile3);
         else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 1) then ira5 = (ira5 + 52000);
          else if (fa_8d_uab_a_05 in(-1, -2) | fa_8d_uab_b_05 in(-1, -2) | fa_8d_uab_c_05 in(-1, -2)) then ira5 = -3;

/********************************************/
/* IRA Component - ira6                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_06 >= 0) then ira6 = (ira6 + fa_8d_trunc_06);
  else if (fa_8 = 1 & fa_8d_trunc_06 in(-1, -2) & fa_8d_sr000001_06 < 0 & fa_8d_sr000002_06 < 0
  & fa_8d_uab_a_06 < 0 & fa_8d_uab_b_06 < 0) then ira6 = fa_8d_trunc_06;
   else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 = fa_8d_sr000001_06) then
   ira6 = (ira6 + fa_8d_sr000001_06);
    else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 > fa_8d_sr000001_06) then
    ira6 = (ira6 + (((fa_8d_sr000002_06 - fa_8d_sr000001_06)/2) + fa_8d_sr000001_06));
     else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 < fa_8d_sr000001_06) then
     ira6 = (ira6 + (((fa_8d_sr000001_06 - fa_8d_sr000002_06)/2) + fa_8d_sr000002_06));
      else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 0) then ira6 = (ira6 + quartile1);
       else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 1) then ira6 = (ira6 + quartile2);
        else if (fa_8d_uab_a_06 in(-1, -2) | fa_8d_uab_b_06 in(-1, -2)) then ira6 = -3;

/********************************************/
/* IRA Component - ira7                     */
/********************************************/

if (fa_8 = 1 & fa_8d_trunc_07 >= 0) then ira7 = (ira7 + fa_8d_trunc_07);
  else if (fa_8 = 1 & fa_8d_trunc_07 in(-1, -2) & fa_8d_sr000001_07 < 0 & fa_8d_sr000002_07 < 0
  & fa_8d_uab_a_07 < 0 & fa_8d_uab_c_07 < 0) then ira7 = fa_8d_trunc_07;
   else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 = fa_8d_sr000001_07) then
   ira7 = (ira7 + fa_8d_sr000001_07);
    else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 > fa_8d_sr000001_07) then
    ira7 = (ira7 + (((fa_8d_sr000002_07 - fa_8d_sr000001_07)/2) + fa_8d_sr000001_07));
     else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 < fa_8d_sr000001_07) then
     ira7 = (ira7 + (((fa_8d_sr000001_07 - fa_8d_sr000002_07)/2) + fa_8d_sr000002_07));
      else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 0) then ira7 = (ira7 + quartile3);
       else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 1) then ira7 = (ira7 + 80000);
        else if (fa_8d_uab_a_07 in(-1, -2) | fa_8d_uab_c_07 in(-1, -2)) then ira7 = -3;

/*******************************/
/* Add components IRA          */
/*******************************/

if (ira1 >= 0) then irac = (irac + ira1);
if (ira2 >= 0) then irac = (irac + ira2);
if (ira3 >= 0) then irac = (irac + ira3);
if (ira4 >= 0) then irac = (irac + ira4);
if (ira5 >= 0) then irac = (irac + ira5);
if (ira6 >= 0) then irac = (irac + ira6);
if (ira7 >= 0) then irac = (irac + ira7);
if (ira1 in(-1, -2, -3)) then irac = -3;
else if (ira2 in(-1, -2, -3)) then irac = -3;
else if (ira3 in(-1, -2, -3)) then irac = -3;
else if (ira4 in(-1, -2, -3)) then irac = -3;
else if (ira5 in(-1, -2, -3)) then irac = -3;
else if (ira6 in(-1, -2, -3)) then irac = -3;
else if (ira7 in(-1, -2, -3)) then irac = -3;

/****************************/
/* Compute A401K            */
/****************************/

/********************************************/
/* A401K component - r_401k            */
/********************************************/

if (fa_6b = 1 & fa_6e_trunc >= 0) then r_401k = (r_401k + fa_6e_trunc);
 else if (fa_6b = 1 & fa_6e_ref_1 = 1 & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0
 & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = -1;
  else if (fa_6b = 1 & fa_6e_trunc in(-1, -2) & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0
  & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = fa_6e_trunc;
   else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 = fa_6e_sr000001) then
    r_401k = (r_401k + fa_6e_sr000001);
     else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 > fa_6e_sr000001) then
     r_401k = (r_401k + (((fa_6e_sr000002 - fa_6e_sr000001)/2) + fa_6e_sr000001));
      else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 < fa_6e_sr000001) then
      r_401k = (r_401k + (((fa_6e_sr000001 - fa_6e_sr000002)/2) + fa_6e_sr000002));
       else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 0) then r_401k = (r_401k + quartile1);
        else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 1) then r_401k = (r_401k + quartile2);
         else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 0) then r_401k = (r_401k + quartile3);
          else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 1) then r_401k = (r_401k + 70000);
           else if (fa_6e_uab_a in(-1, -2) | fa_6e_uab_b in(-1, -2) | fa_6e_uab_c in(-1, -2)) then r_401k = -3;

/********************************************/
/* A401K component - sp_401k           */
/********************************************/

if (fa_7 = 1 & fa_7c_trunc >= 0) then sp_401k = (sp_401k + fa_7c_trunc);
 else if (fa_7 = 1 & fa_7c_ref_1 = 1 & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0
 & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = -1;
  else if (fa_7 = 1 & fa_7c_trunc in(-1, -2) & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0
  & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = fa_7c_trunc;
   else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 = fa_7c_sr000001) then
   sp_401k = (sp_401k + fa_7c_sr000001);
    else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 > fa_7c_sr000001) then
    sp_401k = (sp_401k + (((fa_7c_sr000002 - fa_7c_sr000001)/2) + fa_7c_sr000001));
     else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 < fa_7c_sr000001) then
     sp_401k = (sp_401k + (((fa_7c_sr000001 - fa_7c_sr000002)/2) + fa_7c_sr000002));
      else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 0) then sp_401k = (sp_401k + quartile1);
       else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 1) then sp_401k = (sp_401k + quartile2);
        else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 0) then sp_401k = (sp_401k + quartile3);
         else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 1) then sp_401k = (sp_401k + 75000);
          else if (fa_7c_uab_a in(-1, -2) | fa_7c_uab_b in(-1, -2) | fa_7c_uab_c in(-1, -2)) then sp_401k = -3;

/*******************************/
/* Add components A401K        */
/*******************************/

if (r_401k >= 0) then a401kc = (a401kc + r_401k);
if (sp_401k >= 0) then a401kc = (a401kc + sp_401k);
if (r_401k in(-1, -2, -3)) then a401kc = -3;
else if (sp_401k in(-1, -2, -3)) then a401kc = -3;

/****************************/
/* Compute CDEBT            */
/****************************/

/**************************************************/
/* CDEBT Component - amtowe_assetpoorcars1        */
/**************************************************/

if (sc_12b_01 >= 0) then amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_01);
 else if (sc_12b_01 = 1 & sc_12b_ref_1a_01 = 1 & sc_12b_sr000001_01 < 0 & sc_12b_sr000002_01 < 0
 & sc_12b_uab_a_01 < 0) then amtowe_assetpoorcars1 = -1;
 else if (sc_12b_01 in(-1, -2) & sc_12b_sr000001_01 < 0 & sc_12b_sr000002_01 < 0
 & sc_12b_uab_a_01 < 0) then amtowe_assetpoorcars1 = sc_12b_01;
  else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 = sc_12b_sr000001_01) then
  amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_sr000001_01);
   else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 > sc_12b_sr000001_01) then
   amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000002_01 - sc_12b_sr000001_01)/2) + sc_12b_sr000001_01));
    else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 < sc_12b_sr000001_01) then
    amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000001_01 - sc_12b_sr000002_01)/2) + sc_12b_sr000002_01));
     else if (sc_12b_uab_a_01 in(-1, -2)) then amtowe_assetpoorcars1 = -3;

/**************************************************/
/* CDEBT Component - amtowe_assetpoorcars2        */
/**************************************************/

if (sc_12b_02 >= 0) then amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + sc_12b_02);
 else if (sc_12b_02 = 1 & sc_12b_ref_1a_02 = 1) then amtowe_assetpoorcars2 = -1;
  else if (sc_12b_02 in(-1, -2)) then amtowe_assetpoorcars2 = sc_12b_02;

/**************************************************/
/* CDEBT Component - amtowe_assetpoorcars3        */
/**************************************************/

if (sc_12b_03 >= 0) then amtowe_assetpoorcars3 = (amtowe_assetpoorcars3 + sc_12b_03);
 else if (sc_12b_03 = 1 & sc_12b_ref_1a_03 = 1) then amtowe_assetpoorcars3 = -1;
 else if (sc_12b_03 in(-1, -2)) then amtowe_assetpoorcars3 = sc_12b_03;

/**************************************************/
/* CDEBT Component - amountowe_vehicles1          */
/**************************************************/

if (nfa_4f_trunc_01 >= 0) then amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_trunc_01);
 else if (nfa_4f_trunc_01 in(-1, -2) & nfa_4f_sr000001_01 < 0 & nfa_4f_sr000002_01 < 0
 & nfa_4f_uab_a_01 < 0 & nfa_4f_uab_b_01 < 0 & nfa_4f_uab_c_01 < 0) then amountowe_vehicles1 = nfa_4f_trunc_01;
   else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 >= 0 & nfa_4f_sr000002_01 = nfa_4f_sr000001_01) then
   amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_sr000001_01);
    else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 >= 0 & nfa_4f_sr000002_01 > nfa_4f_sr000001_01) then
    amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000002_01 - nfa_4f_sr000001_01)/2) + nfa_4f_sr000001_01));
     else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 >= 0 & nfa_4f_sr000002_01 < nfa_4f_sr000001_01) then
     amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000001_01 - nfa_4f_sr000002_01)/2) + nfa_4f_sr000002_01));
      else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile1);
       else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile2);
        else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile3);
         else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + 36000);
          else if (nfa_4f_uab_a_01 in(-1, -2) | nfa_4f_uab_b_01 in(-1, -2) | nfa_4f_uab_c_01 in(-1, -2)) then amtowe_vehicles1 = -3;

/**************************************************/
/* CDEBT Component - amountowe_vehicles2          */
/**************************************************/

if (nfa_4f_trunc_02 >= 0) then amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_trunc_02);
 else if (nfa_4f_trunc_02 in(-1, -2) & nfa_4f_sr000001_02 < 0 & nfa_4f_sr000002_02 < 0
 & nfa_4f_uab_a_02 < 0 & nfa_4f_uab_b_02 < 0 & nfa_4f_uab_c_02 < 0) then amountowe_vehicles2 = nfa_4f_trunc_02;
   else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 >= 0 & nfa_4f_sr000002_02 = nfa_4f_sr000001_02) then
   amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_sr000001_02);
    else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 >= 0 & nfa_4f_sr000002_02 > nfa_4f_sr000001_02) then
    amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000002_02 - nfa_4f_sr000001_02)/2) + nfa_4f_sr000001_02));
     else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 >= 0 & nfa_4f_sr000002_02 < nfa_4f_sr000001_02) then
     amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000001_02 - nfa_4f_sr000002_02)/2) + nfa_4f_sr000002_02));
      else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile1);
       else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile2);
        else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile3);
         else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + 35000);
          else if (nfa_4f_uab_a_02 in(-1, -2) | nfa_4f_uab_b_02 in(-1, -2) | nfa_4f_uab_c_02 in(-1, -2)) then amtowe_vehicles2 = -3;

/**************************************************/
/* CDEBT Component - amountowe_vehicles3          */
/**************************************************/

if (nfa_4f_trunc_03 >= 0) then amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_trunc_03);
 else if (nfa_4f_trunc_03 in(-1, -2) & nfa_4f_sr000001_03 < 0 & nfa_4f_sr000002_03 < 0
 & nfa_4f_uab_a_03 < 0 & nfa_4f_uab_b_03 < 0 & nfa_4f_uab_c_03 < 0) then amountowe_vehicles3 = nfa_4f_trunc_03;
   else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 >= 0 & nfa_4f_sr000002_03 = nfa_4f_sr000001_03) then
   amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_sr000001_03);
    else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 >= 0 & nfa_4f_sr000002_03 > nfa_4f_sr000001_03) then
    amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000002_03 - nfa_4f_sr000001_03)/2) + nfa_4f_sr000001_03));
     else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 >= 0 & nfa_4f_sr000002_03 < nfa_4f_sr000001_03) then
     amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000001_03 - nfa_4f_sr000002_03)/2) + nfa_4f_sr000002_03));
      else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_b_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile1);
       else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_b_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile2);
        else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile3);
         else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + 40000);
          else if (nfa_4f_uab_a_03 in(-1, -2) | nfa_4f_uab_b_03 in(-1, -2) | nfa_4f_uab_c_03 in(-1, -2)) then amtowe_vehicles3 = -3;

/**************************************************/
/* CDEBT Component - amountowe_vehicles4          */
/**************************************************/

if (nfa_4f_trunc_04 >= 0) then amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_trunc_04);
 else if (nfa_4f_trunc_04 in(-1, -2) & nfa_4f_sr000001_04 < 0 & nfa_4f_sr000002_04 < 0
 & nfa_4f_uab_a_04 < 0) then amountowe_vehicles4 = nfa_4f_trunc_04;
  else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 >= 0 & nfa_4f_sr000002_04 = nfa_4f_sr000001_04) then
  amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_sr000001_04);
   else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 >= 0 & nfa_4f_sr000002_04 > nfa_4f_sr000001_04) then
   amountowe_vehicles4 = (amountowe_vehicles4 + (((nfa_4f_sr000002_04 - nfa_4f_sr000001_04)/2) + nfa_4f_sr000001_04));
    else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 >= 0 & nfa_4f_sr000002_04 < nfa_4f_sr000001_04) then
    amountowe_vehicles4 = (amountowe_vehicles4 + (((nfa_4f_sr000001_04 - nfa_4f_sr000002_04)/2) + nfa_4f_sr000002_04));
     else if (nfa_4f_uab_a_04 in(-1, -2)) then amtowe_vehicles4 = -3;

/**************************************************/
/* CDEBT Component - amountowe_vehicles5          */
/**************************************************/

if (nfa_4f_05 >= 0) then amountowe_vehicles5 = (amountowe_vehicles5 + nfa_4f_05);
 else if (nfa_4f_05 in(-1, -2) & nfa_4f_uab_a_05 < 0) then amountowe_vehicles5 = nfa_4f_05;
  else if (nfa_4f_uab_a_05 in(-1, -2)) then amtowe_vehicles5 = -3;

/**************************************************/
/* CDEBT Component - amountowe_vehicles6          */
/**************************************************/

if (nfa_4f_trunc_06 >= 0) then amountowe_vehicles6 = (amountowe_vehicles6 + nfa_4f_trunc_06);
 else if (nfa_4f_trunc_06 in(-1, -2)) then amountowe_vehicles6 = nfa_4f_trunc_06;

/**************************************************/
/* CDEBT Component - amtowe_othervehicles         */
/**************************************************/

if (nfa_5 = 1 & nfa_5b_trunc >= 0) then amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_trunc);
 else if (nfa_5 = 1 & nfa_5b_trunc in(-1, -2) & nfa_5b_sr000001 < 0 & nfa_5b_sr000002 < 0
 & nfa_5b_uab_a < 0 & nfa_5b_uab_b < 0 & nfa_5b_uab_c < 0) then amtowe_othervehicles = nfa_5b_trunc;
  else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 = nfa_5b_sr000001) then
  amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_sr000001);
   else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 > nfa_5b_sr000001) then
   amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000002 - nfa_5b_sr000001)/2) + nfa_5b_sr000001));
    else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 < nfa_5b_sr000001) then
    amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000001 - nfa_5b_sr000002)/2) + nfa_5b_sr000002));
     else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_b = 0) then amtowe_othervehicles = (amtowe_othervehicles + quartile1);
      else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_b = 1) then amtowe_othervehicles = (amtowe_othervehicles + quartile2);
       else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 0) then amtowe_othervehicles = (amtowe_othervehicles + quartile3);
        else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 1) then amtowe_othervehicles = (amtowe_othervehicles + 65000);
         else if (nfa_5b_uab_a in(-1, -2) | nfa_5b_uab_b in(-1, -2) | nfa_5b_uab_c in(-1, -2)) then amtowe_othervehicles = -3;

/*******************************/
/* Add components CDEBT        */
/*******************************/

if (amtowe_assetpoorcars1 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars1);
if (amtowe_assetpoorcars2 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars2);
if (amtowe_assetpoorcars3 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars3);
if (amountowe_vehicles1 >= 0) then cdebtc = (cdebtc + amountowe_vehicles1);
if (amountowe_vehicles2 >= 0) then cdebtc = (cdebtc + amountowe_vehicles2);
if (amountowe_vehicles3 >= 0) then cdebtc = (cdebtc + amountowe_vehicles3);
if (amountowe_vehicles4 >= 0) then cdebtc = (cdebtc + amountowe_vehicles4);
if (amountowe_vehicles5 >= 0) then cdebtc = (cdebtc + amountowe_vehicles5);
if (amountowe_vehicles6 >= 0) then cdebtc = (cdebtc + amountowe_vehicles6);
if (amtowe_othervehicles >= 0) then cdebtc = (cdebtc + amtowe_othervehicles);

if (amtowe_assetpoorcars1 in(-1, -2, -3)) then cdebtc = -3;
else if (amtowe_assetpoorcars2 in(-1, -2, -3)) then cdebtc = -3;
else if (amtowe_assetpoorcars3 in(-1, -2, -3)) then cdebtc = -3;
else if (amountowe_vehicles1 in(-1, -2, -3)) then cdebtc = -3;
else if (amountowe_vehicles2 in(-1, -2, -3)) then cdebtc = -3;
else if (amountowe_vehicles3 in(-1, -2, -3)) then cdebtc = -3;
else if (amountowe_vehicles4 in(-1, -2, -3)) then cdebtc = -3;
else if (amountowe_vehicles5 in(-1, -2, -3)) then cdebtc = -3;
else if (amountowe_vehicles6 in(-1, -2, -3)) then cdebtc = -3;
else if (amtowe_othervehicles in(-1, -2, -3)) then cdebtc = -3;

/****************************/
/* Compute CAR              */
/****************************/
/**************************************************/
/* CAR Component - mktval_assetpoorcars1          */
/**************************************************/

if (sc_12a_01 >= 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_01);
 else if (sc_12a_ref_1a_01 = 1 & sc_12a_sr000001_01 < 0 & sc_12a_sr000002_01 < 0
 & sc_12a_uab_a_01 < 0 & sc_12a_uab_b_01 < 0) then mktval_assetpoorcars1 = -1;
  else if (sc_12a_01 in(-1, -2) & sc_12a_sr000001_01 < 0 & sc_12a_sr000002_01 < 0
  & sc_12a_uab_a_01 < 0 & sc_12a_uab_b_01 < 0) then mktval_assetpoorcars1 = sc_12a_01;
    else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 = sc_12a_sr000001_01) then
    mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_sr000001_01);
     else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 > sc_12a_sr000001_01) then
     mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000002_01 - sc_12a_sr000001_01)/2) + sc_12a_sr000001_01));
      else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 < sc_12a_sr000001_01) then
      mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000001_01 - sc_12a_sr000002_01)/2) + sc_12a_sr000001_02));
       else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile1);
        else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 1) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile2);
         else if (sc_12a_uab_a_01 in(-1, -2) | sc_12a_uab_b_01 in(-1, -2)) then mktval_assetpoorcars1 = -3;

/**************************************************/
/* CAR Component - mktval_assetpoorcars2          */
/**************************************************/

if (sc_12a_02 >= 0) then mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_02);
 else if (sc_12a_02 = 1 & sc_12a_ref_1a_02 = 1 & sc_12a_sr000001_02 < 0 & sc_12a_sr000002_02 < 0
 & sc_12a_uab_a_02 < 0) then mktval_assetpoorcars2 = -1;
 else if (sc_12a_02 in(-1, -2) & sc_12a_sr000001_02 < 0 & sc_12a_sr000002_02 < 0
 & sc_12a_uab_a_02 < 0) then mktval_assetpoorcars2 = sc_12a_02;
   else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 = sc_12a_sr000001_02) then
   mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_sr000001_02);
    else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 > sc_12a_sr000001_02) then
    mktval_assetpoorcars2 = (mktval_assetpoorcars2 + (((sc_12a_sr000002_02 - sc_12a_sr000001_02)/2) + sc_12a_sr000001_02));
     else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 < sc_12a_sr000001_02) then
     mktval_assetpoorcars2 = (mktval_assetpoorcars2 + (((sc_12a_sr000001_02 - sc_12a_sr000002_02)/2) + sc_12a_sr000002_02));
      else if (sc_12a_uab_a_02 in(-1, -2)) then mktval_assetpoorcars2 = -3;

/**************************************************/
/* CAR Component - mktval_assetpoorcars3          */
/**************************************************/

if (sc_12a_03 >= 0) then mktval_assetpoorcars3 = (mktval_assetpoorcars3 + sc_12a_03);
 else if (sc_12a_03 = 1 & sc_12a_ref_1a_03 = 1) then mktval_assetpoorcars3 = -1;
  else if (sc_12a_03 in(-1, -2)) then mktval_assetpoorcars3 = sc_12a_03;

/**************************************************/
/* CAR Component - marketvalue_vehicles1          */
/**************************************************/

if (nfa_4c_trunc_01 >= 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_trunc_01);
 else if (nfa_4c_trunc_01 in(-1, -2) & nfa_4c_sr000001_01 < 0 & nfa_4c_sr000002_01 < 0
 & nfa_4c_uab_a_01 < 0 & nfa_4c_uab_b_01 < 0 & nfa_4c_uab_c_01 < 0) then marketvalue_vehicles1 = nfa_4c_trunc_01;
   else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 >= 0 & nfa_4c_sr000002_01 = nfa_4c_sr000001_01) then
   marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_sr000001_01);
    else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 >= 0 & nfa_4c_sr000002_01 > nfa_4c_sr000001_01) then
    marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000002_01 - nfa_4c_sr000001_01)/2) + nfa_4c_sr000001_01));
     else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 >= 0 & nfa_4c_sr000002_01 < nfa_4c_sr000001_01) then
     marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000001_01 - nfa_4c_sr000002_01)/2) + nfa_4c_sr000002_01));
      else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile1);
       else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile2);
        else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile3);
         else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + 40000);
          else if (nfa_4c_uab_a_01 in(-1, -2) | nfa_4c_uab_b_01 in(-1, -2) | nfa_4c_uab_c_01 in(-1, -2)) then marketvalue_vehicles1 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles2          */
/**************************************************/

if (nfa_4c_trunc_02 >= 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_trunc_02);
 else if (nfa_4c_trunc_02 in(-1, -2) & nfa_4c_sr000001_02 < 0 & nfa_4c_sr000002_02 < 0
 & nfa_4c_uab_a_02 < 0 & nfa_4c_uab_b_02 < 0 & nfa_4c_uab_c_02 < 0) then marketvalue_vehicles2 = nfa_4c_trunc_02;
   else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 >= 0 & nfa_4c_sr000002_02 = nfa_4c_sr000001_02) then
   marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_sr000001_02);
    else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 >= 0 & nfa_4c_sr000002_02 > nfa_4c_sr000001_02) then
    marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000002_02 - nfa_4c_sr000001_02)/2) + nfa_4c_sr000001_02));
     else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 >= 0 & nfa_4c_sr000002_02 < nfa_4c_sr000001_02) then
     marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000001_02 - nfa_4c_sr000002_02)/2) + nfa_4c_sr000002_02));
      else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile1);
       else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile2);
        else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile3);
         else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + 36000);
          else if (nfa_4c_uab_a_02 in(-1, -2) | nfa_4c_uab_b_02 in(-1, -2) | nfa_4c_uab_c_02 in(-1, -2)) then marketvalue_vehicles2 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles3          */
/**************************************************/

if (nfa_4c_trunc_03 >= 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_trunc_03);
 else if (nfa_4c_trunc_03 in(-1, -2) & nfa_4c_sr000001_03 < 0 & nfa_4c_sr000002_03 < 0
 & nfa_4c_uab_a_03 < 0 & nfa_4c_uab_b_03 < 0 & nfa_4c_uab_c_03 < 0) then marketvalue_vehicles3 = nfa_4c_trunc_03;
   else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 >= 0 & nfa_4c_sr000002_03 = nfa_4c_sr000001_03) then
   marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_sr000001_03);
    else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 >= 0 & nfa_4c_sr000002_03 > nfa_4c_sr000001_03) then
    marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000002_03 - nfa_4c_sr000001_03)/2) + nfa_4c_sr000001_03));
     else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 >= 0 & nfa_4c_sr000002_03 < nfa_4c_sr000001_03) then
     marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000001_03 - nfa_4c_sr000002_03)/2) + nfa_4c_sr000002_03));
      else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile1);
       else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile2);
        else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile3);
         else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + 40000);
          else if (nfa_4c_uab_a_03 in(-1, -2) | nfa_4c_uab_b_03 in(-1, -2) | nfa_4c_uab_c_03 in(-1, -2)) then marketvalue_vehicles3 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles4          */
/**************************************************/

if (nfa_4c_trunc_04 >= 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_trunc_04);
 else if (nfa_4c_trunc_04 in(-1, -2) & nfa_4c_sr000001_04 < 0 & nfa_4c_sr000002_04 < 0
 & nfa_4c_uab_a_04 < 0 & nfa_4c_uab_b_04 < 0) then marketvalue_vehicles4 = nfa_4c_trunc_04;
   else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 >= 0 & nfa_4c_sr000002_04 = nfa_4c_sr000001_04) then
   marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_sr000001_04);
    else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 >= 0 & nfa_4c_sr000002_04 > nfa_4c_sr000001_04) then
    marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000002_04 - nfa_4c_sr000001_04)/2) + nfa_4c_sr000001_04));
     else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 >= 0 & nfa_4c_sr000002_04 < nfa_4c_sr000001_04) then
     marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000001_04 - nfa_4c_sr000002_04)/2) + nfa_4c_sr000002_04));
      else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_b_04 = 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile1);
       else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_b_04 = 1) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile2);
        else if (nfa_4c_uab_a_04 in(-1, -2) | nfa_4c_uab_b_04 in(-1, -2)) then marketvalue_vehicles4 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles5          */
/**************************************************/

if (nfa_4c_trunc_05 >= 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_trunc_05);
 else if (nfa_4c_trunc_05 in(-1, -2) & nfa_4c_sr000001_05 < 0 & nfa_4c_sr000002_05 < 0
 & nfa_4c_uab_a_05 < 0 & nfa_4c_uab_b_05 < 0) then marketvalue_vehicles5 = nfa_4c_trunc_05;
   else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 >= 0 & nfa_4c_sr000002_05 = nfa_4c_sr000001_05) then
   marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_sr000001_05);
    else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 >= 0 & nfa_4c_sr000002_05 > nfa_4c_sr000001_05) then
    marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000002_05 - nfa_4c_sr000001_05)/2) + nfa_4c_sr000001_05));
     else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 >= 0 & nfa_4c_sr000002_05 < nfa_4c_sr000001_05) then
     marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000001_05 - nfa_4c_sr000002_05)/2) + nfa_4c_sr000002_05));
      else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_b_05 = 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile1);
       else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_b_05 = 1) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile2);
        else if (nfa_4c_uab_a_05 in(-1, -2) | nfa_4c_uab_b_05 in(-1, -2)) then marketvalue_vehicles5 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles6          */
/**************************************************/

if (nfa_4c_06 >= 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_06);
 else if (nfa_4c_06 in(-1, -2) & nfa_4c_sr000001_06 < 0 & nfa_4c_sr000002_06 < 0
 & nfa_4c_uab_a_06 < 0 & nfa_4c_uab_b_06 < 0) then marketvalue_vehicles6 = nfa_4c_06;
  else if (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 >= 0 & nfa_4c_sr000002_06 = nfa_4c_sr000001_06) then
  marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_sr000001_06);
   else if (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 >= 0 & nfa_4c_sr000002_06 > nfa_4c_sr000001_06) then
   marketvalue_vehicles6 = (marketvalue_vehicles6 + (((nfa_4c_sr000002_06 - nfa_4c_sr000001_06)/2) + nfa_4c_sr000001_06));
    else if (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 >= 0 & nfa_4c_sr000002_06 < nfa_4c_sr000001_06) then
    marketvalue_vehicles6 = (marketvalue_vehicles6 + (((nfa_4c_sr000001_06 - nfa_4c_sr000002_06)/2) + nfa_4c_sr000002_06));
     else if (nfa_4c_06 in(-1, -2, -4) & nfa_4c_uab_b_06 = 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + quartile1);
      else if (nfa_4c_06 in(-1, -2, -4) & nfa_4c_uab_b_06 = 1) then marketvalue_vehicles6 = (marketvalue_vehicles6 + quartile2);
       else if (nfa_4c_uab_a_06 in(-1, -2) | nfa_4c_uab_b_06 in(-1, -2)) then marketvalue_vehicles6 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles7          */
/**************************************************/

if (nfa_4c_07 >= 0) then marketvalue_vehicles7 = (marketvalue_vehicles7 + nfa_4c_07);
 else if (nfa_4c_07 in(-1, -2) & nfa_4c_sr000001_07 < 0 & nfa_4c_sr000002_07 < 0
 & nfa_4c_uab_a_07 < 0 & nfa_4c_uab_b_07 < 0) then marketvalue_vehicles7 = nfa_4c_07;
  else if (nfa_4c_sr000001_07 >= 0 & nfa_4c_sr000002_07 >= 0 & nfa_4c_sr000002_07 = nfa_4c_sr000001_07) then
  marketvalue_vehicles7 = (marketvalue_vehicles7 + nfa_4c_sr000001_07);
   else if (nfa_4c_sr000001_07 >= 0 & nfa_4c_sr000002_07 >= 0 & nfa_4c_sr000002_07 > nfa_4c_sr000001_07) then
   marketvalue_vehicles7 = (marketvalue_vehicles7 + (((nfa_4c_sr000002_07 - nfa_4c_sr000001_07)/2) + nfa_4c_sr000001_07));
    else if (nfa_4c_sr000001_07 >= 0 & nfa_4c_sr000002_07 >= 0 & nfa_4c_sr000002_07 < nfa_4c_sr000001_07) then
    marketvalue_vehicles7 = (marketvalue_vehicles7 + (((nfa_4c_sr000001_07 - nfa_4c_sr000002_07)/2) + nfa_4c_sr000002_07));
     else if (nfa_4c_07 in(-1, -2, -4) & nfa_4c_uab_b_07 = 0) then marketvalue_vehicles7 = (marketvalue_vehicles7 + quartile1);
      else if (nfa_4c_07 in(-1, -2, -4) & nfa_4c_uab_b_07 = 1) then marketvalue_vehicles7 = (marketvalue_vehicles7 + quartile2);
       else if (nfa_4c_uab_a_07 in(-1, -2) | nfa_4c_uab_b_07 in(-1, -2)) then marketvalue_vehicles7 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles8          */
/**************************************************/

if (nfa_4c_08 >= 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + nfa_4c_08);
 else if (nfa_4c_08 in(-1, -2) & nfa_4c_sr000001_08 < 0 & nfa_4c_sr000002_08 < 0
 & nfa_4c_uab_a_08 < 0 & nfa_4c_uab_b_08 < 0) then marketvalue_vehicles8 = nfa_4c_08;
  else if (nfa_4c_sr000001_08 >= 0 & nfa_4c_sr000002_08 >= 0 & nfa_4c_sr000002_08 = nfa_4c_sr000001_08) then
  marketvalue_vehicles8 = (marketvalue_vehicles8 + nfa_4c_sr000001_08);
   else if (nfa_4c_sr000001_08 >= 0 & nfa_4c_sr000002_08 >= 0 & nfa_4c_sr000002_08 > nfa_4c_sr000001_08) then
   marketvalue_vehicles8 = (marketvalue_vehicles8 + (((nfa_4c_sr000002_08 - nfa_4c_sr000001_08)/2) + nfa_4c_sr000001_08));
    else if (nfa_4c_sr000001_08 >= 0 & nfa_4c_sr000002_08 >= 0 & nfa_4c_sr000002_08 < nfa_4c_sr000001_08) then
    marketvalue_vehicles8 = (marketvalue_vehicles8 + (((nfa_4c_sr000001_08 - nfa_4c_sr000002_08)/2) + nfa_4c_sr000002_08));
     else if (nfa_4c_08 in(-1, -2, -4) & nfa_4c_uab_b_08 = 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + quartile1);
      else if (nfa_4c_08 in(-1, -2, -4) & nfa_4c_uab_b_08 = 1) then marketvalue_vehicles8 = (marketvalue_vehicles8 + quartile2);
         else if (nfa_4c_uab_a_08 in(-1, -2) | nfa_4c_uab_b_08 in(-1, -2)) then marketvalue_vehicles8 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles9          */
/**************************************************/

if (nfa_4c_09 >= 0) then marketvalue_vehicles9 = (marketvalue_vehicles9 + nfa_4c_09);
 else if (nfa_4c_09 in(-1, -2) & nfa_4c_sr000001_09 < 0 & nfa_4c_sr000002_09 < 0
 & nfa_4c_uab_a_09 < 0 & nfa_4c_uab_b_09 < 0) then marketvalue_vehicles9 = nfa_4c_09;
   else if (nfa_4c_sr000001_09 >= 0 & nfa_4c_sr000002_09 >= 0 & nfa_4c_sr000002_09 = nfa_4c_sr000001_09) then
   marketvalue_vehicles9 = (marketvalue_vehicles9 + nfa_4c_sr000001_09);
    else if (nfa_4c_sr000001_09 >= 0 & nfa_4c_sr000002_09 >= 0 & nfa_4c_sr000002_09 > nfa_4c_sr000001_09) then
    marketvalue_vehicles9 = (marketvalue_vehicles9 + (((nfa_4c_sr000002_09 - nfa_4c_sr000001_09)/2) + nfa_4c_sr000001_09));
     else if (nfa_4c_sr000001_09 >= 0 & nfa_4c_sr000002_09 >= 0 & nfa_4c_sr000002_09 < nfa_4c_sr000001_09) then
     marketvalue_vehicles9 = (marketvalue_vehicles9 + (((nfa_4c_sr000001_09 - nfa_4c_sr000002_09)/2) + nfa_4c_sr000002_09));
      else if (nfa_4c_09 in(-1, -2, -4) & nfa_4c_uab_b_09 = 0) then marketvalue_vehicles9 = (marketvalue_vehicles9 + quartile1);
       else if (nfa_4c_09 in(-1, -2, -4) & nfa_4c_uab_b_09 = 1) then marketvalue_vehicles9 = (marketvalue_vehicles9 + quartile2);
          else if (nfa_4c_uab_a_09 in(-1, -2) | nfa_4c_uab_b_09 in(-1, -2)) then marketvalue_vehicles9 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles10         */
/**************************************************/

if (nfa_4c_10 >= 0) then marketvalue_vehicles10 = (marketvalue_vehicles10 + nfa_4c_10);
 else if (nfa_4c_10 in(-1, -2) & nfa_4c_sr000001_10 < 0 & nfa_4c_sr000002_10 < 0
 & nfa_4c_uab_a_10 < 0 & nfa_4c_uab_b_10 < 0) then marketvalue_vehicles10 = nfa_4c_10;
   else if (nfa_4c_sr000001_10 >= 0 & nfa_4c_sr000002_10 >= 0 & nfa_4c_sr000002_10 = nfa_4c_sr000001_10) then
   marketvalue_vehicles10 = (marketvalue_vehicles10 + nfa_4c_sr000001_10);
    else if (nfa_4c_sr000001_10 >= 0 & nfa_4c_sr000002_10 >= 0 & nfa_4c_sr000002_10 > nfa_4c_sr000001_10) then
    marketvalue_vehicles10 = (marketvalue_vehicles10 + (((nfa_4c_sr000002_10 - nfa_4c_sr000001_10)/2) + nfa_4c_sr000001_10));
     else if (nfa_4c_sr000001_10 >= 0 & nfa_4c_sr000002_10 >= 0 & nfa_4c_sr000002_10 < nfa_4c_sr000001_10) then
     marketvalue_vehicles10 = (marketvalue_vehicles10 + (((nfa_4c_sr000001_10 - nfa_4c_sr000002_10)/2) + nfa_4c_sr000002_10));
      else if (nfa_4c_10 in(-1, -2, -4) & nfa_4c_uab_b_10 = 0) then marketvalue_vehicles10 = (marketvalue_vehicles10 + quartile1);
       else if (nfa_4c_10 in(-1, -2, -4) & nfa_4c_uab_b_10 = 1) then marketvalue_vehicles10 = (marketvalue_vehicles10 + quartile2);
        else if (nfa_4c_uab_a_10 in(-1, -2) | nfa_4c_uab_b_10 in(-1, -2)) then marketvalue_vehicles10 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles11         */
/**************************************************/

if (nfa_4c_11 >= 0) then marketvalue_vehicles11 = (marketvalue_vehicles11 + nfa_4c_11);
 else if (nfa_4c_11 in(-1, -2) & nfa_4c_uab_a_11 < 0) then marketvalue_vehicles11 = nfa_4c_11;
  else if (nfa_4c_uab_a_11 in(-1, -2)) then marketvalue_vehicles11 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles12         */
/**************************************************/

if (nfa_4c_12 >= 0) then marketvalue_vehicles12 = (marketvalue_vehicles12 + nfa_4c_12);
 else if (nfa_4c_12 in(-1, -2) & nfa_4c_uab_a_12 < 0) then marketvalue_vehicles12 = nfa_4c_12;
  else if (nfa_4c_uab_a_12 in(-1, -2)) then marketvalue_vehicles12 = -3;

/**************************************************/
/* CAR Component - marketvalue_vehicles13         */
/**************************************************/

if (nfa_4c_13 >= 0) then marketvalue_vehicles13 = (marketvalue_vehicles13 + nfa_4c_13);
 else if (nfa_4c_13 in(-1, -2)) then marketvalue_vehicles13 = nfa_4c_13;

/**************************************************/
/* CAR Component - marketvalue_vehicles14         */
/**************************************************/

if (nfa_4c_14 >= 0) then marketvalue_vehicles14 = (marketvalue_vehicles14 + nfa_4c_14);
 else if (nfa_4c_14 in(-1, -2)) then marketvalue_vehicles14 = nfa_4c_14;

/**************************************************/
/* CAR Component - marketvalue_vehicles15         */
/**************************************************/

if (nfa_4c_15 >= 0) then marketvalue_vehicles15 = (marketvalue_vehicles15 + nfa_4c_15);
 else if (nfa_4c_15 in(-1, -2)) then marketvalue_vehicles15 = nfa_4c_15;

/**************************************************/
/* CAR Component - mktval_othervehicles           */
/**************************************************/

if (nfa_5 = 1 & nfa_5c_trunc >= 0) then mktval_othervehicles = (mktval_othervehicles + nfa_5c_trunc);
 else if (nfa_5 = 1 & nfa_5c_ref_1 = 1 & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
 & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = -1;
  else if (nfa_5 = 1 & nfa_5c_trunc in(-1, -2) & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
  & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = nfa_5c_trunc;
    else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 = nfa_5c_sr000001) then
    mktval_othervehicles = (mktval_othervehicles + nfa_5c_sr000001);
     else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 > nfa_5c_sr000001) then
     mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000002 - nfa_5c_sr000001)/2) + nfa_5c_sr000001));
      else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 < nfa_5c_sr000001) then
      mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000001 - nfa_5c_sr000002)/2) + nfa_5c_sr000002));
       else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 0) then mktval_othervehicles = (mktval_othervehicles+ quartile1);
        else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 1) then mktval_othervehicles = (mktval_othervehicles + quartile2);
         else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 0) then mktval_othervehicles = (mktval_othervehicles + quartile3);
          else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 1) then mktval_othervehicles = (mktval_othervehicles + 50000);
           else if (nfa_5c_uab_a in(-1, -2) | nfa_5c_uab_b in(-1, -2) | nfa_5c_uab_c in(-1, -2)) then mktval_othervehicles = -3;

/*******************************/
/* Add components CAR          */
/*******************************/

if (mktval_assetpoorcars1 >= 0) then carc = (carc + mktval_assetpoorcars1);
if (mktval_assetpoorcars2 >= 0) then carc = (carc + mktval_assetpoorcars2);
if (mktval_assetpoorcars3 >= 0) then carc = (carc + mktval_assetpoorcars3);
if (marketvalue_vehicles1 >= 0) then carc = (carc + marketvalue_vehicles1);
if (marketvalue_vehicles2 >= 0) then carc = (carc + marketvalue_vehicles2);
if (marketvalue_vehicles3 >= 0) then carc = (carc + marketvalue_vehicles3);
if (marketvalue_vehicles4 >= 0) then carc = (carc + marketvalue_vehicles4);
if (marketvalue_vehicles5 >= 0) then carc = (carc + marketvalue_vehicles5);
if (marketvalue_vehicles6 >= 0) then carc = (carc + marketvalue_vehicles6);
if (marketvalue_vehicles7 >= 0) then carc = (carc + marketvalue_vehicles7);
if (marketvalue_vehicles8 >= 0) then carc = (carc + marketvalue_vehicles8);
if (marketvalue_vehicles9 >= 0) then carc = (carc + marketvalue_vehicles9);
if (marketvalue_vehicles10 >= 0) then carc = (carc + marketvalue_vehicles10);
if (marketvalue_vehicles11 >= 0) then carc = (carc + marketvalue_vehicles11);
if (marketvalue_vehicles12 >= 0) then carc = (carc + marketvalue_vehicles12);
if (marketvalue_vehicles13 >= 0) then carc = (carc + marketvalue_vehicles13);
if (marketvalue_vehicles14 >= 0) then carc = (carc + marketvalue_vehicles14);
if (marketvalue_vehicles15 >= 0) then carc = (carc + marketvalue_vehicles15);
if (mktval_othervehicles >= 0) then carc = (carc + mktval_othervehicles);

if (mktval_assetpoorcars1 in(-1, -2, -3)) then carc = -3;
else if (mktval_assetpoorcars2 in(-1, -2, -3)) then carc = -3;
else if (mktval_assetpoorcars3 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles1 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles2 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles3 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles4 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles5 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles6 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles7 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles8 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles9 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles10 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles11 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles12 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles13 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles14 in(-1, -2, -3)) then carc = -3;
else if (marketvalue_vehicles15 in(-1, -2, -3)) then carc = -3;
else if (mktval_othervehicles in(-1, -2, -3)) then carc = -3;

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (irac   >= 0) then tnfw_trunc = (tnfw_trunc + irac  );
if (a401kc >= 0) then tnfw_trunc = (tnfw_trunc + a401kc);
if (cdsc   >= 0) then tnfw_trunc = (tnfw_trunc + cdsc  );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (irac   in(-1, -2, -3)) then tnfw_trunc = -3;
if (a401kc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdsc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/***************************************************************/
/* TNFW_TRUNC - adjust for partially missing range estimates   */
/***************************************************************/

array ranges1 (n) nfa_1a_sr000001 nfa_1b_sr000001
                  nfa_1c_sr000001 nfa_2a_sr000001
                  nfa_2b_sr000001 nfa_2c_sr000001
                  fa_1a_sr000001
                  fa_8d_sr000001_01 fa_8d_sr000001_02 fa_8d_sr000001_03 fa_8d_sr000001_04
                  fa_8d_sr000001_05 fa_8d_sr000001_06 fa_8d_sr000001_07
                  fa_6e_sr000001 fa_7c_sr000001
                  fa_2a_sr000001
                  fa_3a_sr000001 fa_4a_sr000001 fa_5a_sr000001 fa_9a_sr000001 fa_10a_sr000001
                  fa_11a_sr000001
                  q13_131_sr000001 q13_132_sr000001
                  sc_12b_sr000001_01 nfa_4f_sr000001_01 nfa_4f_sr000001_02 nfa_4f_sr000001_03
                  nfa_4f_sr000001_04
                  sc_12a_sr000001_01 sc_12a_sr000001_02 nfa_4c_sr000001_01 nfa_4c_sr000001_02
                  nfa_4c_sr000001_03 nfa_4c_sr000001_04 nfa_4c_sr000001_05 nfa_4c_sr000001_06
                  nfa_4c_sr000001_07 nfa_4c_sr000001_08 nfa_4c_sr000001_09 nfa_4c_sr000001_10
                  nfa_5c_sr000001
                  nfa_6e_sr000001;

array ranges2 (n) nfa_1a_sr000002 nfa_1b_sr000002 nfa_1c_sr000002 nfa_2a_sr000002 nfa_2b_sr000002
                  nfa_2c_sr000002
                  fa_1a_sr000002
                  fa_8d_sr000002_01 fa_8d_sr000002_02 fa_8d_sr000002_03 fa_8d_sr000002_04 fa_8d_sr000002_05
                  fa_8d_sr000002_06 fa_8d_sr000002_07
                  fa_6e_sr000002 fa_7c_sr000002
                  fa_2a_sr000002
                  fa_3a_sr000002 fa_4a_sr000002 fa_5a_sr000002 fa_9a_sr000002 fa_10a_sr000002
                  fa_11a_sr000002
                  q13_131_sr000002 q13_132_sr000002
                  sc_12b_sr000002_01 nfa_4f_sr000002_01 nfa_4f_sr000002_02 nfa_4f_sr000002_03
                  nfa_4f_sr000002_04
                  sc_12a_sr000002_01 sc_12a_sr000002_02 nfa_4c_sr000002_01 nfa_4c_sr000002_02
                  nfa_4c_sr000002_03 nfa_4c_sr000002_04 nfa_4c_sr000002_05 nfa_4c_sr000002_06
                  nfa_4c_sr000002_07 nfa_4c_sr000002_08 nfa_4c_sr000002_09 nfa_4c_sr000002_10
                  nfa_5c_sr000002
                  nfa_6e_sr000002;

do n = 1 to 44;
if (tnfw_trunc ~= -3 & ((ranges1 >= 0 & ranges2 in(-1, -2)) | (ranges1 in(-1, -2) & ranges2 >= 0)))
  then tnfw_trunc = -3;
end;

/***************************************/
/* APPLY TOPCODE TO TNFW_TRUNC FOR 2004*/
/***************************************/

if (tnfw_trunc_2004 > 1485000) then tnfw_trunc_2004 = 2671980;

tnfw_trunc_2004 = round(tnfw_trunc_2004);

 

2008 TNFW_TRUNC variable creation


/***************************************************/
/* Compute dollar amt for dollars & cents vars     */
/***************************************************/

nfa_7d_truncc = nfa_7d_trunc;
if (nfa_7d_trunc > 0) then nfa_7d_truncc = (nfa_7d_trunc/100);

/***************************************************/
/* Compute dynamic QUARTILE VALUES for estimates   */
/***************************************************/

array quartileqs (i) quartile1 quartile2 quartile3 quartile4;

do i = 1 to 4;
 quartileqs = 0;
end;

if (symbol_entry_othhh = 7200) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((7200-5000)/2));
  quartile3 = (7200 + ((30000-7200)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;
else if (symbol_entry_othhh = 13000) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((13000-5000)/2));
  quartile3 = (13000 + ((30000-13000)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i) homec mortc pdebtc cashc irac a401kc cdsc stockc trustc bizc bdebtc cdebtc carc posesc odebtc tnfw_trunc
                       collections items ccdebt studentloan childstudentloan owebusiness otherdebt
                       solebiz farm_1_value1 farm_2_value1 farm_3_value1 farm_4_value1 
                       business_1_value1 business_2_value1 business_3_value1 realestate_1_value1 
                       realestate_2_value1 realestate_3_value1 realestate_4_value1 realestate_5_value1
                       realestate_6_value1
                       farm_1_value farm_2_value farm_3_value farm_4_value business_1_value business_2_value
                       business_3_value realestate_1_value realestate_2_value realestate_3_value realestate_4_value
                       realestate_5_value realestate_6_value
                       debtbiz farm_1_debt1 farm_2_debt1 farm_3_debt1 farm_4_debt1 business_1_debt1 business_2_debt1
                       business_3_debt1 realestate_1_debt1 
                       farm_1_debt farm_2_debt farm_3_debt farm_4_debt business_1_debt business_2_debt
                       business_3_debt realestate_1_debt
                       govbonds mutual lifeinsure shares corpbond moneyowedtor
                       home1 secondhome mort1 secondmort pdebt1 secondpdebt
                       ira1 ira2 ira3 ira4 ira5 ira6 ira7 r_401k sp_401k
                       amtowe_assetpoorcars1 amtowe_assetpoorcars2 amtowe_assetpoorcars3 amtowe_assetpoorcars4
                       amtowe_assetpoorcars5
                       amountowe_vehicles1 amountowe_vehicles2 amountowe_vehicles3 amountowe_vehicles4
                       amountowe_vehicles5 amountowe_vehicles6 amountowe_vehicles7 amtowe_othervehicles
                       mktval_assetpoorcars1 mktval_assetpoorcars2 mktval_assetpoorcars3 mktval_assetpoorcars4
                       mktval_assetpoorcars5
                       marketvalue_vehicles1 marketvalue_vehicles2 marketvalue_vehicles3 marketvalue_vehicles4
                       marketvalue_vehicles5 marketvalue_vehicles6 marketvalue_vehicles7 marketvalue_vehicles8
                       marketvalue_vehicles7 marketvalue_vehicles8 marketvalue_vehicles9 marketvalue_vehicles10 
                       marketvalue_vehicles11 marketvalue_vehicles12 
                       marketvalue_vehicles13 marketvalue_vehicles14 marketvalue_vehicles15 marketvalue_vehicles16 
                       marketvalue_vehicles17 mktval_othervehicles;

do i = 1 to 126;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;

/**********************/
/* Compute POSES      */
/**********************/
/******************************************/
/* POSES Component - collections          */
/******************************************/

if (nfa_6a = 1 & nfa_6e_trunc >= 0) then collections = (collections + nfa_6e_trunc);
 else if (nfa_6a = 1 & nfa_6e_ref_1 = 1 & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0 
 & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = -1;
  else if (nfa_6a = 1 & nfa_6e_trunc in(-1, -2) & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0 
  & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = nfa_6e_trunc;
    else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 = nfa_6e_sr000001) then 
    collections = (collections + nfa_6e_sr000001);
     else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 > nfa_6e_sr000001) then 
     collections = (collections + (((nfa_6e_sr000002 - nfa_6e_sr000001)/2) + nfa_6e_sr000001));
      else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 < nfa_6e_sr000001) then 
      collections = (collections + (((nfa_6e_sr000001 - nfa_6e_sr000002)/2) + nfa_6e_sr000002));
       else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 0) then collections = (collections + quartile1);
        else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 1) then collections = (collections + quartile2);
         else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 0) then collections = (collections + quartile3);
          else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 1) then collections = (collections + 72500);
           else if (nfa_6e_uab_a in(-1, -2) | nfa_6e_uab_b in(-1, -2) | nfa_6e_uab_c in(-1, -2)) then collections = -3;
 
/******************************************/
/* POSES Component - items                */
/******************************************/

if (nfa_7 = 1 & nfa_7d_truncc >= 0) then items = (items + nfa_7d_truncc);
 else if (nfa_7 = 1 & nfa_7d_ref_1 = 1 & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 
 & nfa_7d_uab_c < 0) then items = -1;
  else if (nfa_7 = 1 & nfa_7d_truncc in(-1, -2) & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 
  & nfa_7d_uab_c < 0) then items = nfa_7d_truncc;
   else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 0) then items = (items + quartile1);
    else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 1) then items = (items + quartile2);
     else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 0) then items = (items + quartile3);
      else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 1) then items = (items + 50000);
       else if (nfa_7d_uab_a in(-1, -2) | nfa_7d_uab_b in(-1, -2) | nfa_7d_uab_c in(-1, -2)) then items = -3;

/*******************************/
/* Add components POSES        */
/*******************************/

if (collections >= 0) then posesc = (posesc + collections); 
if (items >= 0) then posesc = (posesc + items);
if (collections in(-1, -2, -3)) then posesc = -3;
else if (items in(-1, -2, -3)) then posesc = -3;

/****************************/
/* Compute ODEBT            */
/****************************/

/******************************************/
/* ODEBT Component - ccdebt               */
/******************************************/

if (debt_1 = 1 & debt_1a >= 0) then ccdebt = (ccdebt + debt_1a);
 else if (debt_1 = 1 & debt_1a_ref_1 = 1 & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0 
 & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = -1;
  else if (debt_1 = 1 & debt_1a in(-1, -2) & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0 
  & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = debt_1a;
    else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 = debt_1a_sr000001) then 
    ccdebt = (ccdebt + debt_1a_sr000001);
     else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 > debt_1a_sr000001) then 
     ccdebt = (ccdebt + (((debt_1a_sr000002 - debt_1a_sr000001)/2) + debt_1a_sr000001));
      else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 < debt_1a_sr000001) then 
      ccdebt = (ccdebt + (((debt_1a_sr000001 - debt_1a_sr000002)/2) + debt_1a_sr000002));
       else if (debt_1a in(-1, -2, -4) & debt_1a_uab_b = 0) then ccdebt = (ccdebt + quartile1);
        else if (debt_1a in(-1, -2, -4) & debt_1a_uab_b = 1) then ccdebt = (ccdebt + quartile2);
         else if (debt_1a in(-1, -2, -4) & debt_1a_uab_c = 0) then ccdebt = (ccdebt + quartile3);
          else if (debt_1a in(-1, -2, -4) & debt_1a_uab_c = 1) then ccdebt = (ccdebt + 45000);
           else if (debt_1a_uab_a in(-1, -2) | debt_1a_uab_b in(-1, -2) | debt_1a_uab_c in(-1, -2)) then ccdebt = -3;

/******************************************/
/* ODEBT Component - studentloan          */
/******************************************/

if (debt_2 = 1 & debt_2a >= 0) then studentloan = (studentloan + debt_2a);
 else if (debt_2 = 1 & debt_2a_ref_1 = 1 & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 
 & debt_2a_uab_c < 0) then studentloan = -1;
  else if (debt_2 = 1 & debt_2a in(-1, -2) & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 
  & debt_2a_uab_c < 0) then studentloan = debt_2a;
   else if (debt_2a in(-1, -2, -4) & debt_2a_uab_b = 0) then studentloan = (studentloan + quartile1);
    else if (debt_2a in(-1, -2, -4) & debt_2a_uab_b = 1) then studentloan = (studentloan + quartile2);
     else if (debt_2a in(-1, -2, -4) & debt_2a_uab_c = 0) then studentloan = (studentloan + quartile3);
      else if (debt_2a in(-1, -2, -4) & debt_2a_uab_c = 1) then studentloan = (studentloan + 50000);
       else if (debt_2a_uab_a in(-1, -2) | debt_2a_uab_b in(-1, -2) | debt_2a_uab_c in(-1, -2)) then studentloan = -3;

/******************************************/
/* ODEBT Component - childstudentloan     */
/******************************************/

if (debt_2c = 1 & debt_2d >= 0) then childstudentloan = (childstudentloan + debt_2d);
 else if (debt_2c = 1 & debt_2d_ref_1 = 1 & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 
 & debt_2d_uab_c < 0) then childstudentloan = -1;
  else if (debt_2c = 1 & debt_2d in(-1, -2) & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 
  & debt_2d_uab_c < 0) then childstudentloan = debt_2d;
   else if (debt_2d in(-1, -2, -4) & debt_2d_uab_b = 0) then childstudentloan = (childstudentloan + quartile1);
    else if (debt_2d in(-1, -2, -4) & debt_2d_uab_b = 1) then childstudentloan = (childstudentloan + quartile2);
     else if (debt_2d in(-1, -2, -4) & debt_2d_uab_c = 0) then childstudentloan = (childstudentloan + quartile3);
      else if (debt_2d in(-1, -2, -4) & debt_2d_uab_c = 1) then childstudentloan = (childstudentloan + 40000);
       else if (debt_2d_uab_a in(-1, -2) | debt_2d_uab_b in(-1, -2) | debt_2d_uab_c in(-1, -2)) then childstudentloan = -3;

/******************************************/
/* ODEBT Component - owebusiness          */
/******************************************/

if (debt_3 = 1 & debt_3a_trunc >= 0) then owebusiness = (owebusiness + debt_3a_trunc);
 else if (debt_3 = 1 & debt_3a_ref_1 = 1 & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 
 & debt_3a_uab_c < 0) then owebusiness = -1;
  else if (debt_3 = 1 & debt_3a_trunc in(-1, -2) & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 
  & debt_3a_uab_c < 0) then owebusiness = debt_3a_trunc;
   else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 0) then owebusiness = (owebusiness + quartile1);
    else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 1) then owebusiness = (owebusiness + quartile2);
     else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 0) then owebusiness = (owebusiness + quartile3);
      else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 1) then owebusiness = (owebusiness + 72500);
       else if (debt_3a_uab_a in(-1, -2) | debt_3a_uab_b in(-1, -2) | debt_3a_uab_c in(-1, -2)) then owebusiness = -3;

/******************************************/
/* ODEBT Component - otherdebt            */
/******************************************/

if (debt_4 = 1 & debt_4a_trunc >= 0) then otherdebt = (otherdebt + debt_4a_trunc);
 else if (debt_4 = 1 & debt_4a_ref_1 = 1 & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 
 & debt_4a_uab_c < 0) then otherdebt = -1;
  else if (debt_4 = 1 & debt_4a_trunc in(-1, -2) & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 
  & debt_4a_uab_c < 0) then otherdebt = debt_4a_trunc;
   else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 0) then otherdebt = (otherdebt + quartile1);
    else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 1) then otherdebt = (otherdebt + quartile2);
     else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_c = 0) then otherdebt = (otherdebt + quartile3);
      else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_c = 1) then otherdebt = (otherdebt + 70000);
       else if (debt_4a_uab_a in(-1, -2) | debt_4a_uab_b in(-1, -2) | debt_4a_uab_c in(-1, -2)) then otherdebt = -3;

/*******************************/
/* Add components ODEBT        */
/*******************************/

if (ccdebt >= 0) then odebtc = (odebtc + ccdebt); 
if (studentloan >= 0) then odebtc = (odebtc + studentloan);
if (childstudentloan >= 0) then odebtc = (odebtc + childstudentloan);
if (owebusiness >= 0) then odebtc = (odebtc + owebusiness);
if (otherdebt >= 0) then odebtc = (odebtc + otherdebt);
if (ccdebt in(-1, -2, -3)) then odebtc = -3;
else if (studentloan in(-1, -2, -3)) then odebtc = -3;
else if (childstudentloan in(-1, -2, -3)) then odebtc = -3;
else if (owebusiness in(-1, -2, -3)) then odebtc = -3;
else if (otherdebt in(-1, -2, -3)) then odebtc = -3;

/****************************/
/* Compute BIZ              */
/****************************/

/******************************************/
/* BIZ Component - solebiz                */
/******************************************/

if (q13_131_trunc >= 0) then solebiz = (solebiz + q13_131_trunc);
 else if (q13_131_trunc = 1 & q13_131_ref_1 = 1 & q13_131_sr000001 < 0 & q13_131_sr000002 < 0 
 & q13_131_uab_a < 0 & q13_131_uab_b < 0 & q13_131_uab_c < 0) then solebiz = -1;
  else if (q13_131_trunc in(-1, -2) & q13_131_sr000001 < 0 & q13_131_sr000002 < 0 
  & q13_131_uab_a < 0 & q13_131_uab_b < 0 & q13_131_uab_c < 0) then solebiz = q13_131_trunc;
    else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 = q13_131_sr000001) then 
    solebiz = (solebiz + q13_131_sr000001);
     else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 > q13_131_sr000001) then 
     solebiz = (solebiz + (((q13_131_sr000002 - q13_131_sr000001)/2) + q13_131_sr000001));
      else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 < q13_131_sr000001) then 
      solebiz = (solebiz + (((q13_131_sr000001 - q13_131_sr000002)/2) + q13_131_sr000002));
       else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_b = 0) then solebiz = (solebiz + quartile1);
        else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_b = 1) then solebiz = (solebiz + quartile2);
         else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 0) then solebiz = (solebiz + quartile3);
          else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 1) then solebiz = (solebiz + 250000);
           else if (q13_131_uab_a in(-1, -2) | q13_131_uab_b in(-1, -2) | q13_131_uab_c in(-1, -2)) then solebiz = -3;

/********************************************************************************************************/
/* BIZ Components - farm_#_value, business_#_value, realestate_#_value & percentage ownership           */
/********************************************************************************************************/

if (q13_fjt_11_trunc_01 > -4) then farm_1_value1 = q13_fjt_11_trunc_01;
if (q13_fjt_11_trunc_02 > -4) then farm_2_value1 = q13_fjt_11_trunc_02;
if (q13_fjt_11_trunc_03 > -4) then farm_3_value1 = q13_fjt_11_trunc_03;
if (q13_fjt_11_trunc_04 > -4) then farm_4_value1 = q13_fjt_11_trunc_04;
if (q13_bppjt_11_trunc_01 > -4) then business_1_value1 = q13_bppjt_11_trunc_01;
if (q13_bppjt_11_trunc_02 > -4) then business_2_value1 = q13_bppjt_11_trunc_02;
if (q13_bppjt_11_trunc_03 > -4) then business_3_value1 = q13_bppjt_11_trunc_03;
if (q13_rejt_11_trunc_01 > -4) then realestate_1_value1 = q13_rejt_11_trunc_01;
if (q13_rejt_11_trunc_02 > -4) then realestate_2_value1 = q13_rejt_11_trunc_02;
if (q13_rejt_11_trunc_03 > -4) then realestate_3_value1 = q13_rejt_11_trunc_03;
if (q13_rejt_11_trunc_04 > -4) then realestate_4_value1 = q13_rejt_11_trunc_04;
if (q13_rejt_11_trunc_05 > -4) then realestate_5_value1 = q13_rejt_11_trunc_05;
if (q13_rejt_11_trunc_06 > -4) then realestate_6_value1 = q13_rejt_11_trunc_06;

if (q13_fjt_12b_01 > -4) then farm_1_pcntshare = q13_fjt_12b_01;
if (q13_fjt_12b_02 > -4) then farm_2_pcntshare = q13_fjt_12b_02;
if (q13_fjt_12b_03 > -4) then farm_3_pcntshare = q13_fjt_12b_03;
if (q13_fjt_12b_04 > -4) then farm_4_pcntshare = q13_fjt_12b_04;
if (q13_bppjt_12b_01 > -4) then business_1_pcntshare = q13_bppjt_12b_01;
if (q13_bppjt_12b_02 > -4) then business_2_pcntshare = q13_bppjt_12b_02;
if (q13_bppjt_12b_03 > -4) then business_3_pcntshare = q13_bppjt_12b_03;
if (q13_rejt_12b_01 > -4) then realestate_1_pcntshare = q13_rejt_12b_01;
if (q13_rejt_12b_02 > -4) then realestate_2_pcntshare = q13_rejt_12b_02;
if (q13_rejt_12b_03 > -4) then realestate_3_pcntshare = q13_rejt_12b_03;
if (q13_rejt_12b_04 > -4) then realestate_4_pcntshare = q13_rejt_12b_04;
if (q13_rejt_12b_05 > -4) then realestate_5_pcntshare = q13_rejt_12b_05;
if (q13_rejt_12b_06 > -4) then realestate_6_pcntshare = q13_rejt_12b_06;

if (farm_1_pcntshare > 0) then farm_1_pcntshare = (farm_1_pcntshare / 100);
if (farm_2_pcntshare > 0) then farm_2_pcntshare = (farm_2_pcntshare / 100);
if (farm_3_pcntshare > 0) then farm_3_pcntshare = (farm_3_pcntshare / 100);
if (farm_4_pcntshare > 0) then farm_4_pcntshare = (farm_4_pcntshare / 100);
if (business_1_pcntshare > 0) then business_1_pcntshare = (business_1_pcntshare / 100);
if (business_2_pcntshare > 0) then business_2_pcntshare = (business_2_pcntshare / 100);
if (business_3_pcntshare > 0) then business_3_pcntshare = (business_3_pcntshare / 100);
if (realestate_1_pcntshare > 0) then realestate_1_pcntshare = (realestate_1_pcntshare / 100);
if (realestate_2_pcntshare > 0) then realestate_2_pcntshare = (realestate_2_pcntshare / 100);
if (realestate_3_pcntshare > 0) then realestate_3_pcntshare = (realestate_3_pcntshare / 100);
if (realestate_4_pcntshare > 0) then realestate_4_pcntshare = (realestate_4_pcntshare / 100);
if (realestate_5_pcntshare > 0) then realestate_5_pcntshare = (realestate_5_pcntshare / 100);
if (realestate_6_pcntshare > 0) then realestate_6_pcntshare = (realestate_6_pcntshare / 100);

if (farm_1_value1 >= 0 & farm_1_pcntshare >= 0) then farm_1_value = (farm_1_value1 * farm_1_pcntshare);
if (farm_2_value1 >= 0 & farm_2_pcntshare >= 0) then farm_2_value = (farm_2_value1 * farm_2_pcntshare);
if (farm_3_value1 >= 0 & farm_3_pcntshare >= 0) then farm_3_value = (farm_3_value1 * farm_3_pcntshare);
if (farm_4_value1 >= 0 & farm_4_pcntshare >= 0) then farm_4_value = (farm_4_value1 * farm_4_pcntshare);
if (business_1_value1 >= 0 & business_1_pcntshare >= 0) then business_1_value = (business_1_value1 * business_1_pcntshare);
if (business_2_value1 >= 0 & business_2_pcntshare >= 0) then business_2_value = (business_2_value1 * business_2_pcntshare);
if (business_3_value1 >= 0 & business_3_pcntshare >= 0) then business_3_value = (business_3_value1 * business_3_pcntshare);
if (realestate_1_value1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_value = (realestate_1_value1 * realestate_1_pcntshare);
if (realestate_2_value1 >= 0 & realestate_2_pcntshare >= 0) then realestate_2_value = (realestate_2_value1 * realestate_2_pcntshare);
if (realestate_3_value1 >= 0 & realestate_3_pcntshare >= 0) then realestate_3_value = (realestate_3_value1 * realestate_3_pcntshare);
if (realestate_4_value1 >= 0 & realestate_4_pcntshare >= 0) then realestate_4_value = (realestate_4_value1 * realestate_4_pcntshare);
if (realestate_5_value1 >= 0 & realestate_5_pcntshare >= 0) then realestate_5_value = (realestate_5_value1 * realestate_5_pcntshare);
if (realestate_6_value1 >= 0 & realestate_6_pcntshare >= 0) then realestate_6_value = (realestate_6_value1 * realestate_6_pcntshare);


/*******************************/
/* Add components BIZ          */
/*******************************/

if (solebiz >= 0) then bizc = (bizc + solebiz); 
if (farm_1_value >= 0) then bizc = (bizc + farm_1_value);
if (farm_2_value >= 0) then bizc = (bizc + farm_2_value);
if (farm_3_value >= 0) then bizc = (bizc + farm_3_value);
if (farm_4_value >= 0) then bizc = (bizc + farm_4_value);
if (business_1_value >= 0) then bizc = (bizc + business_1_value);
if (business_2_value >= 0) then bizc = (bizc + business_2_value);
if (business_3_value >= 0) then bizc = (bizc + business_3_value);
if (realestate_1_value >= 0) then bizc = (bizc + realestate_1_value);
if (realestate_2_value >= 0) then bizc = (bizc + realestate_2_value);
if (realestate_3_value >= 0) then bizc = (bizc + realestate_3_value);
if (realestate_4_value >= 0) then bizc = (bizc + realestate_4_value);
if (realestate_5_value >= 0) then bizc = (bizc + realestate_5_value);
if (realestate_6_value >= 0) then bizc = (bizc + realestate_6_value);

if (solebiz in(-1, -2, -3)) then bizc = -3;
if (farm_1_value in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_2_value in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_3_value in(-1, -2, -3) | farm_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_4_value in(-1, -2, -3) | farm_4_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_1_value in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_2_value in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_3_value in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_1_value in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_2_value in(-1, -2, -3) | realestate_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_3_value in(-1, -2, -3) | realestate_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_4_value in(-1, -2, -3) | realestate_4_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_5_value in(-1, -2, -3) | realestate_5_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_6_value in(-1, -2, -3) | realestate_6_pcntshare in(-1, -2, -3)) then bizc = -3;

/****************************/
/* Compute BDEBT            */
/****************************/

/******************************************/
/* BDEBT Component - debtbiz              */
/******************************************/

if (q13_132_trunc >= 0) then debtbiz = (debtbiz + q13_132_trunc);
 else if (q13_132_trunc = 1 & q13_132_ref_1 = 1 & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
 & q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = -1;
  else if (q13_132_trunc in(-1, -2) & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
  & q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = q13_132_trunc;
    else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 = q13_132_sr000001) then 
    debtbiz = (debtbiz + q13_132_sr000001);
     else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 > q13_132_sr000001) then 
     debtbiz = (debtbiz + (((q13_132_sr000002 - q13_132_sr000001)/2) + q13_132_sr000001));
      else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 < q13_132_sr000001) then 
      debtbiz = (debtbiz + (((q13_132_sr000001 - q13_132_sr000002)/2) + q13_132_sr000002));
         else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 0) then debtbiz = (debtbiz + quartile3);
          else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 1) then debtbiz = (debtbiz + 200000);
           else if (q13_132_uab_a in(-1, -2) | q13_132_uab_c in(-1, -2)) then debtbiz = -3;

/***************************************************************************/
/* BDEBT Components - farm_#_debt, business_#_debt, realestate_#_debt      */
/*       (use ownership percentage computed above for bizc)                */
/***************************************************************************/

if (q13_fjt_12_01 > -4) then farm_1_debt1 = q13_fjt_12_01;
if (q13_fjt_12_02 > -4) then farm_2_debt1 = q13_fjt_12_02;
if (q13_fjt_12_03 > -4) then farm_3_debt1 = q13_fjt_12_03;
if (q13_fjt_12_04 > -4) then farm_4_debt1 = q13_fjt_12_04;
if (q13_bppjt_12_trunc_01 > -4) then business_1_debt1 = q13_bppjt_12_trunc_01;
if (q13_bppjt_12_02 > -4) then business_2_debt1 = q13_bppjt_12_02;
if (q13_bppjt_12_03 > -4) then business_3_debt1 = q13_bppjt_12_03;
if (q13_rejt_12_trunc > -4) then realestate_1_debt1 = q13_rejt_12_trunc;

if (farm_1_debt1 >= 0 & farm_1_pcntshare >= 0) then farm_1_debt = (farm_1_debt1 * farm_1_pcntshare);
if (farm_2_debt1 >= 0 & farm_2_pcntshare >= 0) then farm_2_debt = (farm_2_debt1 * farm_2_pcntshare);
if (farm_3_debt1 >= 0 & farm_3_pcntshare >= 0) then farm_3_debt = (farm_3_debt1 * farm_3_pcntshare);
if (farm_4_debt1 >= 0 & farm_4_pcntshare >= 0) then farm_4_debt = (farm_4_debt1 * farm_4_pcntshare);
if (business_1_debt1 >= 0 & business_1_pcntshare >= 0) then business_1_debt = (business_1_debt1 * business_1_pcntshare);
if (business_2_debt1 >= 0 & business_2_pcntshare >= 0) then business_2_debt = (business_2_debt1 * business_2_pcntshare);
if (business_3_debt1 >= 0 & business_3_pcntshare >= 0) then business_3_debt = (business_3_debt1 * business_3_pcntshare);
if (realestate_1_debt1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_debt = (realestate_1_debt1 * realestate_1_pcntshare);

/*******************************/
/* Add components BDEBT        */
/*******************************/

if (debtbiz >= 0) then bdebtc = (bdebtc + debtbiz); 
if (farm_1_debt >= 0) then bdebtc = (bdebtc + farm_1_debt);
if (farm_2_debt >= 0) then bdebtc = (bdebtc + farm_2_debt);
if (farm_3_debt >= 0) then bdebtc = (bdebtc + farm_3_debt);
if (farm_4_debt >= 0) then bdebtc = (bdebtc + farm_4_debt);
if (business_1_debt >= 0) then bdebtc = (bdebtc + business_1_debt);
if (business_2_debt >= 0) then bdebtc = (bdebtc + business_2_debt);
if (business_3_debt >= 0) then bdebtc = (bdebtc + business_3_debt);
if (realestate_1_debt >= 0) then bdebtc = (bdebtc + realestate_1_debt);

if (debtbiz in(-1, -2, -3)) then bdebtc = -3; 
if (farm_1_debt in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_2_debt in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_3_debt in(-1, -2, -3) | farm_3_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_4_debt in(-1, -2, -3) | farm_4_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_1_debt in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_2_debt in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_3_debt in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (realestate_1_debt in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;

/****************************/
/* Compute CASH             */
/****************************/

/******************************************/
/* CASH Component - cash                  */
/******************************************/

if (fa_1 = 1 & fa_1a_trunc >= 0) then cashc = (cashc + fa_1a_trunc);
 else if (fa_1 = 1 & fa_1_ref_1 = 1 & fa_1a_sr000001_trunc < 0 & fa_1a_sr000002_trunc < 0 
 & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = -1;
  else if (fa_1 = 1 & fa_1a_trunc in(-1, -2) & fa_1a_sr000001_trunc < 0 & fa_1a_sr000002_trunc < 0 
  & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = fa_1a_trunc;
    else if (fa_1a_sr000001_trunc >= 0 & fa_1a_sr000002_trunc >= 0 & fa_1a_sr000002_trunc = fa_1a_sr000001_trunc) then 
    cashc = (cashc + fa_1a_sr000001_trunc);
     else if (fa_1a_sr000001_trunc >= 0 & fa_1a_sr000002_trunc >= 0 & fa_1a_sr000002_trunc > fa_1a_sr000001_trunc) then 
     cashc = (cashc + (((fa_1a_sr000002_trunc - fa_1a_sr000001_trunc)/2) + fa_1a_sr000001_trunc));
      else if (fa_1a_sr000001_trunc >= 0 & fa_1a_sr000002_trunc >= 0 & fa_1a_sr000002_trunc < fa_1a_sr000001_trunc) then 
      cashc = (cashc + (((fa_1a_sr000001_trunc - fa_1a_sr000002_trunc)/2) + fa_1a_sr000002_trunc));
       else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 0) then cashc = (cashc + quartile1);
        else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 1) then cashc = (cashc + quartile2);
         else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 0) then cashc = (cashc + quartile3);
          else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 1) then cashc = (cashc + 70000);
           else if (fa_1a_uab_a in(-1, -2) | fa_1a_uab_b in(-1, -2) | fa_1a_uab_c in(-1, -2)) then cashc = -3;

/*************************************************************/
/* No need to add components for CASHC - set -3 missing      */
/*************************************************************/

if (cashc in(-1, -2, -3)) then cashc = -3;

/****************************/
/* Compute CDS              */
/****************************/

/******************************************/
/* CDS Component - cds                    */
/******************************************/

if (fa_2 = 1 & fa_2a_trunc >= 0) then cdsc = (cdsc + fa_2a_trunc);
 else if (fa_2 = 1 & fa_2_ref_1 = 1 & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0 
 & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = -1;
  else if (fa_2 = 1 & fa_2a_trunc in(-1, -2) & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0 
  & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = fa_2a_trunc;
    else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 = fa_2a_sr000001) then 
    cdsc = (cdsc + fa_2a_sr000001);
     else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 > fa_2a_sr000001) then 
     cdsc = (cdsc + (((fa_2a_sr000002 - fa_2a_sr000001)/2) + fa_2a_sr000001));
      else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 < fa_2a_sr000001) then 
      cdsc = (cdsc + (((fa_2a_sr000001 - fa_2a_sr000002)/2) + fa_2a_sr000002));
       else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 0) then cdsc = (cdsc + quartile1);
        else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 1) then cdsc = (cdsc + quartile2);
         else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 0) then cdsc = (cdsc + quartile3);
          else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 1) then cdsc = (cdsc + 60000);
           else if (fa_2a_uab_a in(-1, -2) | fa_2a_uab_b in(-1, -2) | fa_2a_uab_c in(-1, -2)) then cdsc = -3;
 
/*************************************************************/
/* No need to add components for CDSC - set -3 missing       */
/*************************************************************/

if (cdsc in(-1, -2, -3)) then cdsc = -3;

/****************************/
/* Compute STOCK            */
/****************************/

/******************************************/
/* STOCK Component - govbonds             */
/******************************************/

if (fa_3 = 1 & fa_3a >= 0) then govbonds = (govbonds + fa_3a);
 else if (fa_3 = 1 & fa_3_ref_1 = 1 & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
 & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = -1;
  else if (fa_3 = 1 & fa_3a in(-1, -2) & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
  & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = fa_3a;
    else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 = fa_3a_sr000001) then 
    govbonds = (govbonds + fa_3a_sr000001);
     else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 > fa_3a_sr000001) then 
     govbonds = (govbonds + (((fa_3a_sr000002 - fa_3a_sr000001)/2) + fa_3a_sr000001));
      else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 < fa_3a_sr000001) then 
      govbonds = (govbonds + (((fa_3a_sr000001 - fa_3a_sr000002)/2) + fa_3a_sr000002));
       else if (fa_3a in(-1, -2, -4) & fa_3a_uab_b = 0) then govbonds = (govbonds + quartile1);
        else if (fa_3a in(-1, -2, -4) & fa_3a_uab_b = 1) then govbonds = (govbonds + quartile2);
         else if (fa_3a in(-1, -2, -4) & fa_3a_uab_c = 0) then govbonds = (govbonds + quartile3);
          else if (fa_3a in(-1, -2, -4) & fa_3a_uab_c = 1) then govbonds = (govbonds + 45000);
           else if (fa_3a_uab_a in(-1, -2) | fa_3a_uab_b in(-1, -2) | fa_3a_uab_c in(-1, -2)) then govbonds = -3;

/******************************************/
/* STOCK Component - mutual               */
/******************************************/

if (fa_4 = 1 & fa_4a_trunc >= 0) then mutual = (mutual + fa_4a_trunc);
 else if (fa_4 = 1 & fa_4_ref_1 = 1 & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
 & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = -1;
  else if (fa_4 = 1 & fa_4a_trunc in(-1, -2) & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
  & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = fa_4a_trunc;
    else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 = fa_4a_sr000001) then 
    mutual = (mutual + fa_4a_sr000001);
     else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 > fa_4a_sr000001) then 
     mutual = (mutual + (((fa_4a_sr000002 - fa_4a_sr000001)/2) + fa_4a_sr000001));
      else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 < fa_4a_sr000001) then 
      mutual = (mutual + (((fa_4a_sr000001 - fa_4a_sr000002)/2) + fa_4a_sr000002));
       else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 0) then mutual = (mutual + quartile1);
        else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 1) then mutual = (mutual + quartile2);
         else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 0) then mutual = (mutual + quartile3);
          else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 1) then mutual = (mutual + 100000);
           else if (fa_4a_uab_a in(-1, -2) | fa_4a_uab_b in(-1, -2) | fa_4a_uab_c in(-1, -2)) then mutual = -3;
 
/******************************************/
/* STOCK Component - lifeinsure           */
/******************************************/

if (fa_5 = 1 & fa_5a_trunc >= 0) then lifeinsure = (lifeinsure + fa_5a_trunc);
 else if (fa_5 = 1 & fa_5_ref_1 = 1 & fa_5a_sr000001 < 0 & fa_5a_sr000002 < 0 
 & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = -1;
  else if (fa_5 = 1 & fa_5a_trunc in(-1, -2) & fa_5a_sr000001 < 0 & fa_5a_sr000002 < 0 
  & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = fa_5a_trunc;
    else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 = fa_5a_sr000001) then 
    lifeinsure = (lifeinsure + fa_5a_sr000001);
     else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 > fa_5a_sr000001) then 
     lifeinsure = (lifeinsure + (((fa_5a_sr000002 - fa_5a_sr000001)/2) + fa_5a_sr000001));
      else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 < fa_5a_sr000001) then 
      lifeinsure = (lifeinsure + (((fa_5a_sr000001 - fa_5a_sr000002)/2) + fa_5a_sr000002));
       else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 0) then lifeinsure = (lifeinsure + quartile1);
        else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 1) then lifeinsure = (lifeinsure + quartile2);
         else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 0) then lifeinsure = (lifeinsure + quartile3);
          else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 1) then lifeinsure = (lifeinsure + 100000);
           else if (fa_5a_uab_a in(-1, -2) | fa_5a_uab_b in(-1, -2) | fa_5a_uab_c in(-1, -2)) then lifeinsure = -3;
  
/******************************************/
/* STOCK Component - shares               */
/******************************************/

if (fa_9 = 1 & fa_9a_trunc >= 0) then shares = (shares + fa_9a_trunc);
 else if (fa_9 = 1 & fa_9_ref_1 = 1 & fa_9a_sr000001 < 0 & fa_9a_sr000002_trunc < 0 
 & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = -1;
  else if (fa_9 = 1 & fa_9a_trunc in(-1, -2) & fa_9a_sr000001 < 0 & fa_9a_sr000002_trunc < 0 
  & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = fa_9a_trunc;
    else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002_trunc >= 0 & fa_9a_sr000002_trunc = fa_9a_sr000001) then 
    shares = (shares + fa_9a_sr000001);
     else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002_trunc >= 0 & fa_9a_sr000002_trunc > fa_9a_sr000001) then 
     shares = (shares + (((fa_9a_sr000002_trunc - fa_9a_sr000001)/2) + fa_9a_sr000001));
      else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002_trunc >= 0 & fa_9a_sr000002_trunc < fa_9a_sr000001) then 
      shares = (shares + (((fa_9a_sr000001 - fa_9a_sr000002_trunc)/2) + fa_9a_sr000002_trunc));
       else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 0) then shares = (shares + quartile1);
        else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 1) then shares = (shares + quartile2);
         else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 0) then shares = (shares + quartile3);
          else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 1) then shares = (shares + 100000);
           else if (fa_9a_uab_a in(-1, -2) | fa_9a_uab_b in(-1, -2) | fa_9a_uab_c in(-1, -2)) then shares = -3;
 
/******************************************/
/* STOCK Component - corpbond             */
/******************************************/

if (fa_10 = 1 & fa_10a_trunc >= 0) then corpbond = (corpbond + fa_10a_trunc);
 else if (fa_10 = 1 & fa_10_ref_1 = 1 & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0 
 & fa_10a_uab_a < 0 & fa_10a_uab_c < 0) then corpbond = -1;
  else if (fa_10 = 1 & fa_10a_trunc in(-1, -2) & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0 
  & fa_10a_uab_a < 0 & fa_10a_uab_c < 0) then corpbond = fa_10a_trunc;
    else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 = fa_10a_sr000001) then 
    corpbond = (corpbond + fa_10a_sr000001);
     else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 > fa_10a_sr000001) then 
     corpbond = (corpbond + (((fa_10a_sr000002 - fa_10a_sr000001)/2) + fa_10a_sr000001));
      else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 < fa_10a_sr000001) then 
      corpbond = (corpbond + (((fa_10a_sr000001 - fa_10a_sr000002)/2) + fa_10a_sr000002));
       else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 0) then corpbond = (corpbond + quartile3);
        else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 1) then corpbond = (corpbond + 190000);
         else if (fa_10a_uab_a in(-1, -2) /* | fa_10a_uab_b in(-1, -2) */ | fa_10a_uab_c in(-1, -2)) then corpbond = -3;

/******************************************/
/* STOCK Component - moneyowedtor         */
/******************************************/

if (fa_11 = 1 & fa_11a_trunc >= 0) then moneyowedtor = (moneyowedtor + fa_11a_trunc);
 else if (fa_11 = 1 & fa_11_ref_1 = 1 & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0 
 & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = -1;
  else if (fa_11 = 1 & fa_11a_trunc in(-1, -2) & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0 
  & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = fa_11a_trunc;
    else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 = fa_11a_sr000001) then 
    moneyowedtor = (moneyowedtor + fa_11a_sr000001);
     else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 > fa_11a_sr000001) then 
     moneyowedtor = (moneyowedtor + (((fa_11a_sr000002 - fa_11a_sr000001)/2) + fa_11a_sr000001));
      else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 < fa_11a_sr000001) then 
      moneyowedtor = (moneyowedtor + (((fa_11a_sr000001 - fa_11a_sr000002)/2) + fa_11a_sr000002));
       else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_b = 0) then moneyowedtor = (moneyowedtor + quartile1);
        else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_b = 1) then moneyowedtor = (moneyowedtor + quartile2);
         else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_c = 0) then moneyowedtor = (moneyowedtor + quartile3);
          else if (fa_11a_trunc in(-1, -2, -4) & fa_11a_uab_c = 1) then moneyowedtor = (moneyowedtor + 90000);
           else if (fa_11a_uab_a in(-1, -2) | fa_11a_uab_b in(-1, -2) | fa_11a_uab_c in(-1, -2)) then moneyowedtor = -3;
 
/*******************************/
/* Add components STOCK        */
/*******************************/

if (govbonds >= 0) then stockc = (stockc + govbonds); 
if (mutual >= 0) then stockc = (stockc + mutual);
if (lifeinsure >= 0) then stockc = (stockc + lifeinsure);
if (shares >= 0) then stockc = (stockc + shares);
if (corpbond >= 0) then stockc = (stockc + corpbond);
if (moneyowedtor >= 0) then stockc = (stockc + moneyowedtor);
if (govbonds in(-1, -2, -3)) then stockc = -3;
else if (mutual in(-1, -2, -3)) then stockc = -3;
else if (lifeinsure in(-1, -2, -3)) then stockc = -3;
else if (shares in(-1, -2, -3)) then stockc = -3;
else if (corpbond in(-1, -2, -3)) then stockc = -3;
else if (moneyowedtor in(-1, -2, -3)) then stockc = -3;

/****************************/
/* Compute HOME             */
/****************************/

/******************************************/
/* HOME Component - home1                 */
/******************************************/

if (nfa_1 = 1 & nfa_1a_trunc >= 0) then home1 = (home1 + nfa_1a_trunc);
 else if (nfa_1 = 1 & nfa_1_ref_1 = 1 & nfa_1a_sr000001_trunc < 0 & nfa_1a_sr000002_trunc < 0 
 & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = -1;
  else if (nfa_1 = 1 & nfa_1a_trunc in(-1, -2) & nfa_1a_sr000001_trunc < 0 & nfa_1a_sr000002_trunc < 0 
  & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = nfa_1a_trunc;
    else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002_trunc >= 0 & nfa_1a_sr000002_trunc = nfa_1a_sr000001_trunc) then 
    home1 = (home1 + nfa_1a_sr000001_trunc);
     else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002_trunc >= 0 & nfa_1a_sr000002_trunc > nfa_1a_sr000001_trunc) then 
     home1 = (home1 + (((nfa_1a_sr000002_trunc - nfa_1a_sr000001_trunc)/2) + nfa_1a_sr000001_trunc));
      else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002_trunc >= 0 & nfa_1a_sr000002_trunc < nfa_1a_sr000001_trunc) then 
      home1 = (home1 + (((nfa_1a_sr000001_trunc - nfa_1a_sr000002_trunc)/2) + nfa_1a_sr000002_trunc));
       else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 0) then home1 = (home1 + quartile1);
        else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 1) then home1 = (home1 + quartile2);
         else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 0) then home1 = (home1 + quartile3);
          else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 1) then home1 = (home1 + 200000);
           else if (nfa_1a_uab_a in(-1, -2) | nfa_1a_uab_b in(-1, -2) | nfa_1a_uab_c in(-1, -2)) then home1 = -3;
 
/******************************************/
/* HOME Component - secondhome            */
/******************************************/

if (nfa_2 = 1 & nfa_2a_trunc >= 0) then secondhome = (secondhome + nfa_2a_trunc);
 else if (nfa_2 = 1 & nfa_2_ref_1 = 1 & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
 & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = -1;
  else if (nfa_2 = 1 & nfa_2a_trunc in(-1, -2) & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
  & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = nfa_2a_trunc;
    else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 = nfa_2a_sr000001) then 
    secondhome = (secondhome + nfa_2a_sr000001);
     else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 > nfa_2a_sr000001) then 
     secondhome = (secondhome + (((nfa_2a_sr000002 - nfa_2a_sr000001)/2) + nfa_2a_sr000001));
      else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 < nfa_2a_sr000001) then 
      secondhome = (secondhome + (((nfa_2a_sr000001 - nfa_2a_sr000002)/2) + nfa_2a_sr000002));
       else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 0) then secondhome = (secondhome + quartile1);
        else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 1) then secondhome = (secondhome + quartile2);
         else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 0) then secondhome = (secondhome + quartile3);
          else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 1) then secondhome = (secondhome + 180000);
           else if (nfa_2a_uab_a in(-1, -2) | nfa_2a_uab_b in(-1, -2) | nfa_2a_uab_c in(-1, -2)) then secondhome = -3;
 
/*******************************/
/* Add components HOME         */
/*******************************/

if (home1 >= 0) then homec = (homec + home1); 
if (secondhome >= 0) then homec = (homec + secondhome);
if (home1 in(-1, -2, -3)) then homec = -3;
else if (secondhome in(-1, -2, -3)) then homec = -3;

/****************************/
/* Compute MORT             */
/****************************/

/******************************************/
/* MORT Component - mort1                 */
/******************************************/

if (nfa_1b_trunc >= 0) then mort1 = (mort1 + nfa_1b_trunc);
 else if (nfa_1b_ref_1 = 1 & nfa_1b_sr000001_trunc < 0 & nfa_1b_sr000002_trunc < 0 
 & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0) then mort1 = -1;
  else if (nfa_1b_trunc in(-1, -2) & nfa_1b_sr000001_trunc < 0 & nfa_1b_sr000002_trunc < 0 
  & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0) then mort1 = nfa_1b_trunc;
    else if (nfa_1b_sr000001_trunc >= 0 & nfa_1b_sr000002_trunc >= 0 & nfa_1b_sr000002_trunc = nfa_1b_sr000001_trunc) then 
    mort1 = (mort1 + nfa_1b_sr000001_trunc);
     else if (nfa_1b_sr000001_trunc >= 0 & nfa_1b_sr000002_trunc >= 0 & nfa_1b_sr000002_trunc > nfa_1b_sr000001_trunc) then 
     mort1 = (mort1 + (((nfa_1b_sr000002_trunc - nfa_1b_sr000001_trunc)/2) + nfa_1b_sr000001_trunc));
      else if (nfa_1b_sr000001_trunc >= 0 & nfa_1b_sr000002_trunc >= 0 & nfa_1b_sr000002_trunc < nfa_1b_sr000001_trunc) then 
      mort1 = (mort1 + (((nfa_1b_sr000001_trunc - nfa_1b_sr000002_trunc)/2) + nfa_1b_sr000002_trunc));
       else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 0) then mort1 = (mort1 + quartile1);
        else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 1) then mort1 = (mort1 + quartile2);
         else if (nfa_1b_uab_a in(-1, -2) | nfa_1b_uab_b in(-1, -2)) then mort1 = -3;
 
/******************************************/
/* MORT Component - secondmort            */
/******************************************/

if (nfa_2b_trunc >= 0) then secondmort = (secondmort + nfa_2b_trunc);
 else if (nfa_2b_ref_1 = 1 & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
 & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = -1;
  else if (nfa_2b_trunc in(-1, -2) & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
  & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = nfa_2b_trunc;
    else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 = nfa_2b_sr000001) then 
    secondmort = (secondmort + nfa_2b_sr000001);
     else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 > nfa_2b_sr000001) then 
     secondmort = (secondmort + (((nfa_2b_sr000002 - nfa_2b_sr000001)/2) + nfa_2b_sr000001));
      else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 < nfa_2b_sr000001) then 
      secondmort = (secondmort + (((nfa_2b_sr000001 - nfa_2b_sr000002)/2) + nfa_2b_sr000002));
       else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 0) then secondmort = (secondmort + quartile1);
        else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 1) then secondmort = (secondmort + quartile2);
         else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 0) then secondmort = (secondmort + quartile3);
          else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 1) then secondmort = (secondmort + 145000);
           else if (nfa_2b_uab_a in(-1, -2) | nfa_2b_uab_b in(-1, -2) | nfa_2b_uab_c in(-1, -2)) then secondmort = -3;
 
/*******************************/
/* Add components MORT         */
/*******************************/

if (mort1 >= 0) then mortc = (mortc + mort1); 
if (secondmort >= 0) then mortc = (mortc + secondmort);
if (mort1 in(-1, -2, -3)) then mortc = -3;
else if (secondmort in(-1, -2, -3)) then mortc = -3;

/****************************/
/* Compute PDEBT            */
/****************************/

/******************************************/
/* PDEBT Component - pdebt1               */
/******************************************/

if (nfa_1c >= 0) then pdebt1 = (pdebt1 + nfa_1c);
 else if (nfa_1c_ref_1 = 1 & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
 & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = -1;
  else if (nfa_1c in(-1, -2) & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
  & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = nfa_1c;
    else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 = nfa_1c_sr000001) then 
    pdebt1 = (pdebt1 + nfa_1c_sr000001);
     else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 > nfa_1c_sr000001) then 
     pdebt1 = (pdebt1 + (((nfa_1c_sr000002 - nfa_1c_sr000001)/2) + nfa_1c_sr000001));
      else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 < nfa_1c_sr000001) then 
      pdebt1 = (pdebt1 + (((nfa_1c_sr000001 - nfa_1c_sr000002)/2) + nfa_1c_sr000002));
       else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 0) then pdebt1 = (pdebt1 + quartile1);
        else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 1) then pdebt1 = (pdebt1 + quartile2);
         else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 0) then pdebt1 = (pdebt1 + quartile3);
          else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 1) then pdebt1 = (pdebt1 + 50000);
           else if (nfa_1c_uab_a in(-1, -2) | nfa_1c_uab_b in(-1, -2) | nfa_1c_uab_c in(-1, -2)) then pdebt1 = -3;
 
/******************************************/
/* PDEBT Component - secondpdebt          */
/******************************************/

if (nfa_2c >= 0) then secondpdebt = (secondpdebt + nfa_2c);
 else if (nfa_2c_ref_1 = 1 & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 
 & nfa_2c_uab_a < 0) then secondpdebt = -1;
  else if (nfa_2c in(-1, -2) & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 
  & nfa_2c_uab_a < 0) then secondpdebt = nfa_2c;
    else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 = nfa_2c_sr000001) then 
    secondpdebt = (secondpdebt + nfa_2c_sr000001);
     else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 > nfa_2c_sr000001) then 
     secondpdebt = (secondpdebt + (((nfa_2c_sr000002 - nfa_2c_sr000001)/2) + nfa_2c_sr000001));
      else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 < nfa_2c_sr000001) then 
      secondpdebt = (secondpdebt + (((nfa_2c_sr000001 - nfa_2c_sr000002)/2) + nfa_2c_sr000002));
       else if (nfa_2c_uab_a in(-1, -2)) then secondpdebt = -3;

/*******************************/
/* Add components PDEBT        */
/*******************************/

if (pdebt1 >= 0) then pdebtc = (pdebtc + pdebt1); 
if (secondpdebt >= 0) then pdebtc = (pdebtc + secondpdebt);
if (pdebt1 in(-1, -2, -3)) then pdebtc = -3;
else if (secondpdebt in(-1, -2, -3)) then pdebtc = -3;

/****************************/
/* Compute IRA              */
/****************************/

/******************************************/
/* IRA Component - ira1                   */
/******************************************/

if (fa_8 = 1 & fa_8d_trunc_01 >= 0) then ira1 = (ira1 + fa_8d_trunc_01);
 else if (fa_8 = 1 & fa_8d_trunc_01 in(-1, -2) & fa_8d_sr000001_01 < 0 & fa_8d_sr000002_01 < 0 
 & fa_8d_uab_a_01 < 0 & fa_8d_uab_b_01 < 0 & fa_8d_uab_c_01 < 0) then ira1 = fa_8d_trunc_01;
  else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 = fa_8d_sr000001_01) then 
  ira1 = (ira1 + fa_8d_sr000001_01);
   else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 > fa_8d_sr000001_01) then 
   ira1 = (ira1 + (((fa_8d_sr000002_01 - fa_8d_sr000001_01)/2) + fa_8d_sr000001_01));
    else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 < fa_8d_sr000001_01) then 
    ira1 = (ira1 + (((fa_8d_sr000001_01 - fa_8d_sr000002_01)/2) + fa_8d_sr000002_01));
     else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 0) then ira1 = (ira1 + quartile1);
      else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 1) then ira1 = (ira1 + quartile2);
       else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 0) then ira1 = (ira1 + quartile3);
        else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 1) then ira1 = (ira1 + 80000);
         else if (fa_8d_uab_a_01 in(-1, -2) | fa_8d_uab_b_01 in(-1, -2) | fa_8d_uab_c_01 in(-1, -2)) then ira1 = -3;

/******************************************/
/* IRA Component - ira2                   */
/******************************************/

if (fa_8 = 1 & fa_8d_trunc_02 >= 0) then ira2 = (ira2 + fa_8d_trunc_02);
 else if (fa_8 = 1 & fa_8d_trunc_02 in(-1, -2) & fa_8d_sr000001_02 < 0 & fa_8d_sr000002_02 < 0 
 & fa_8d_uab_a_02 < 0 & fa_8d_uab_b_02 < 0 & fa_8d_uab_c_02 < 0) then ira2 = fa_8d_trunc_02;
  else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 = fa_8d_sr000001_02) then 
  ira2 = (ira2 + fa_8d_sr000001_02);
   else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 > fa_8d_sr000001_02) then 
   ira2 = (ira2 + (((fa_8d_sr000002_02 - fa_8d_sr000001_02)/2) + fa_8d_sr000001_02));
    else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 < fa_8d_sr000001_02) then 
    ira2 = (ira2 + (((fa_8d_sr000001_02 - fa_8d_sr000002_02)/2) + fa_8d_sr000002_02));
     else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 0) then ira2 = (ira2 + quartile1);
      else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 1) then ira2 = (ira2 + quartile2);
       else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 0) then ira2 = (ira2 + quartile3);
        else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 1) then ira2 = (ira2 + 55000);
         else if (fa_8d_uab_a_02 in(-1, -2) | fa_8d_uab_b_02 in(-1, -2) | fa_8d_uab_c_02 in(-1, -2)) then ira2 = -3;
 
/******************************************/
/* IRA Component - ira3                   */
/******************************************/

if (fa_8 = 1 & fa_8d_03 >= 0) then ira3 = (ira3 + fa_8d_03);
  else if (fa_8 = 1 & fa_8d_03 in(-1, -2) & fa_8d_sr000001_03 < 0 & fa_8d_sr000002_03 < 0 
  & fa_8d_uab_a_03 < 0 & fa_8d_uab_c_03 < 0) then ira3 = fa_8d_03;
    else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 = fa_8d_sr000001_03) then 
    ira3 = (ira3 + fa_8d_sr000001_03);
     else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 > fa_8d_sr000001_03) then 
     ira3 = (ira3 + (((fa_8d_sr000002_03 - fa_8d_sr000001_03)/2) + fa_8d_sr000001_03));
      else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 < fa_8d_sr000001_03) then 
      ira3 = (ira3 + (((fa_8d_sr000001_03 - fa_8d_sr000002_03)/2) + fa_8d_sr000002_03));
       else if (fa_8d_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 0) then ira3 = (ira3 + quartile3);
        else if (fa_8d_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 1) then ira3 = (ira3 + 100000);
         else if (fa_8d_uab_a_03 in(-1, -2) | fa_8d_uab_c_03 in(-1, -2)) then ira3 = -3;

/******************************************/
/* IRA Component - ira4                   */
/******************************************/

if (fa_8 = 1 & fa_8d_04 >= 0) then ira4 = (ira4 + fa_8d_04);
  else if (fa_8 = 1 & fa_8d_04 in(-1, -2) & fa_8d_sr000001_04 < 0 & fa_8d_sr000002_04 < 0 
  & fa_8d_uab_a_04 < 0 & fa_8d_uab_c_04 < 0) then ira4 = fa_8d_04;
    else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 = fa_8d_sr000001_04) then 
    ira4 = (ira4 + fa_8d_sr000001_04);
     else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 > fa_8d_sr000001_04) then 
     ira4 = (ira4 + (((fa_8d_sr000002_04 - fa_8d_sr000001_04)/2) + fa_8d_sr000001_04));
      else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 < fa_8d_sr000001_04) then 
      ira4 = (ira4 + (((fa_8d_sr000001_04 - fa_8d_sr000002_04)/2) + fa_8d_sr000002_04));
       else if (fa_8d_04 in(-1, -2, -4) & fa_8d_uab_c_04 = 0) then ira4 = (ira4 + quartile3);
        else if (fa_8d_04 in(-1, -2, -4) & fa_8d_uab_c_04 = 1) then ira4 = (ira4 + 115000);
         else if (fa_8d_uab_a_04 in(-1, -2) | fa_8d_uab_c_04 in(-1, -2)) then ira4 = -3;

/******************************************/
/* IRA Component - ira5                   */
/******************************************/

if (fa_8 = 1 & fa_8d_trunc_05 >= 0) then ira5 = (ira5 + fa_8d_trunc_05);
  else if (fa_8 = 1 & fa_8d_trunc_05 in(-1, -2) & fa_8d_sr000001_05 < 0 & fa_8d_sr000002_05 < 0 
  & fa_8d_uab_a_05 < 0 & fa_8d_uab_c_05 < 0) then ira5 = fa_8d_trunc_05;
    else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 = fa_8d_sr000001_05) then 
    ira5 = (ira5 + fa_8d_sr000001_05);
     else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 > fa_8d_sr000001_05) then 
     ira5 = (ira5 + (((fa_8d_sr000002_05 - fa_8d_sr000001_05)/2) + fa_8d_sr000001_05));
      else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 < fa_8d_sr000001_05) then 
      ira5 = (ira5 + (((fa_8d_sr000001_05 - fa_8d_sr000002_05)/2) + fa_8d_sr000002_05));
       else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 0) then ira5 = (ira5 + quartile3);
        else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 1) then ira5 = (ira5 + 65000);
         else if (fa_8d_uab_a_05 in(-1, -2) | fa_8d_uab_c_05 in(-1, -2)) then ira5 = -3;
 
/******************************************/
/* IRA Component - ira6                   */
/******************************************/

if (fa_8 = 1 & fa_8d_06 >= 0) then ira6 = (ira6 + fa_8d_06);
  else if (fa_8 = 1 & fa_8d_06 in(-1, -2) & fa_8d_sr000001_06 < 0 & fa_8d_sr000002_06 < 0 
  & fa_8d_uab_a_06 < 0 & fa_8d_uab_b_06 < 0 & fa_8d_uab_c_06 < 0) then ira6 = fa_8d_06;
    else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 = fa_8d_sr000001_06) then 
    ira6 = (ira6 + fa_8d_sr000001_06);
     else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 > fa_8d_sr000001_06) then 
     ira6 = (ira6 + (((fa_8d_sr000002_06 - fa_8d_sr000001_06)/2) + fa_8d_sr000001_06));
      else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 < fa_8d_sr000001_06) then 
      ira6 = (ira6 + (((fa_8d_sr000001_06 - fa_8d_sr000002_06)/2) + fa_8d_sr000002_06));
       else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 0) then ira6 = (ira6 + quartile1);
        else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 1) then ira6 = (ira6 + quartile2);
         else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 0) then ira6 = (ira6 + quartile3);
          else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 1) then ira6 = (ira6 + 59000);
           else if (fa_8d_uab_a_06 in(-1, -2) | fa_8d_uab_b_06 in(-1, -2) | fa_8d_uab_c_06 in(-1, -2)) then ira6 = -3;
 
/******************************************/
/* IRA Component - ira7                   */
/******************************************/

if (fa_8 = 1 & fa_8d_trunc_07 >= 0) then ira7 = (ira7 + fa_8d_trunc_07);
  else if (fa_8 = 1 & fa_8d_trunc_07 in(-1, -2) & fa_8d_sr000001_07 < 0 & fa_8d_sr000002_07 < 0 
  & fa_8d_uab_a_07 < 0 & fa_8d_uab_b_07 < 0 & fa_8d_uab_c_07 < 0) then ira7 = fa_8d_trunc_07;
    else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 = fa_8d_sr000001_07) then 
    ira7 = (ira7 + fa_8d_sr000001_07);
     else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 > fa_8d_sr000001_07) then 
     ira7 = (ira7 + (((fa_8d_sr000002_07 - fa_8d_sr000001_07)/2) + fa_8d_sr000001_07));
      else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 < fa_8d_sr000001_07) then 
      ira7 = (ira7 + (((fa_8d_sr000001_07 - fa_8d_sr000002_07)/2) + fa_8d_sr000002_07));
       else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_b_07 = 0) then ira7 = (ira7 + quartile1);
        else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_b_07 = 1) then ira7 = (ira7 + quartile2);
         else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 0) then ira7 = (ira7 + quartile3);
          else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 1) then ira7 = (ira7 + 65000);
           else if (fa_8d_uab_a_07 in(-1, -2) | fa_8d_uab_b_07 in(-1, -2) | fa_8d_uab_c_07 in(-1, -2)) then ira7 = -3;
 
/*******************************/
/* Add components IRA          */
/*******************************/

if (ira1 >= 0) then irac = (irac + ira1); 
if (ira2 >= 0) then irac = (irac + ira2); 
if (ira3 >= 0) then irac = (irac + ira3); 
if (ira4 >= 0) then irac = (irac + ira4); 
if (ira5 >= 0) then irac = (irac + ira5); 
if (ira6 >= 0) then irac = (irac + ira6); 
if (ira7 >= 0) then irac = (irac + ira7); 
if (ira1 in(-1, -2, -3)) then irac = -3;
else if (ira2 in(-1, -2, -3)) then irac = -3;
else if (ira3 in(-1, -2, -3)) then irac = -3;
else if (ira4 in(-1, -2, -3)) then irac = -3;
else if (ira5 in(-1, -2, -3)) then irac = -3;
else if (ira6 in(-1, -2, -3)) then irac = -3;
else if (ira7 in(-1, -2, -3)) then irac = -3;

/****************************/
/* Compute A401K            */
/****************************/

/******************************************/
/* A401K component - r_401k               */
/******************************************/

if (fa_6b = 1 & fa_6e_trunc >= 0) then r_401k = (r_401k + fa_6e_trunc);
 else if (fa_6b = 1 & fa_6e_ref_1 = 1 & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
 & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = -1;
  else if (fa_6b = 1 & fa_6e_trunc in(-1, -2) & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
  & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = fa_6e_trunc;
   else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 = fa_6e_sr000001) then 
    r_401k = (r_401k + fa_6e_sr000001);
     else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 > fa_6e_sr000001) then 
     r_401k = (r_401k + (((fa_6e_sr000002 - fa_6e_sr000001)/2) + fa_6e_sr000001));
      else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 < fa_6e_sr000001) then 
      r_401k = (r_401k + (((fa_6e_sr000001 - fa_6e_sr000002)/2) + fa_6e_sr000002));
       else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 0) then r_401k = (r_401k + quartile1);
        else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 1) then r_401k = (r_401k + quartile2);
         else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 0) then r_401k = (r_401k + quartile3);
          else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 1) then r_401k = (r_401k + 80000);
           else if (fa_6e_uab_a in(-1, -2) | fa_6e_uab_b in(-1, -2) | fa_6e_uab_c in(-1, -2)) then r_401k = -3;

/******************************************/
/* A401K component - sp_401k              */
/******************************************/

if (fa_7 = 1 & fa_7c_trunc >= 0) then sp_401k = (sp_401k + fa_7c_trunc);
 else if (fa_7 = 1 & fa_7c_ref_1 = 1 & fa_7c_sr000001 < 0 & fa_7c_sr000002_trunc < 0 
 & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = -1;
  else if (fa_7 = 1 & fa_7c_trunc in(-1, -2) & fa_7c_sr000001 < 0 & fa_7c_sr000002_trunc < 0 
  & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = fa_7c_trunc;
    else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002_trunc >= 0 & fa_7c_sr000002_trunc = fa_7c_sr000001) then 
    sp_401k = (sp_401k + fa_7c_sr000001);
     else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002_trunc >= 0 & fa_7c_sr000002_trunc > fa_7c_sr000001) then 
     sp_401k = (sp_401k + (((fa_7c_sr000002_trunc - fa_7c_sr000001)/2) + fa_7c_sr000001));
      else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002_trunc >= 0 & fa_7c_sr000002_trunc < fa_7c_sr000001) then 
      sp_401k = (sp_401k + (((fa_7c_sr000001 - fa_7c_sr000002_trunc)/2) + fa_7c_sr000002_trunc));
       else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 0) then sp_401k = (sp_401k + quartile1);
        else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 1) then sp_401k = (sp_401k + quartile2);
         else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 0) then sp_401k = (sp_401k + quartile3);
          else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 1) then sp_401k = (sp_401k + 94500);
           else if (fa_7c_uab_a in(-1, -2) | fa_7c_uab_b in(-1, -2) | fa_7c_uab_c in(-1, -2)) then sp_401k = -3;

/*******************************/
/* Add components A401K        */
/*******************************/

if (r_401k >= 0) then a401kc = (a401kc + r_401k); 
if (sp_401k >= 0) then a401kc = (a401kc + sp_401k); 
if (r_401k in(-1, -2, -3)) then a401kc = -3;
else if (sp_401k in(-1, -2, -3)) then a401kc = -3;

/****************************/
/* Compute CDEBT            */
/****************************/

/*******************************************/
/* CDEBT Component - amtowe_assetpoorcars1 */
/*******************************************/

if (sc_12b_01 >= 0) then amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_01);
 else if (sc_12b_01 = 1 & sc_12b_ref_1a_01 = 1 & sc_12b_sr000001_01 < 0 & sc_12b_sr000002_01 < 0) then amtowe_assetpoorcars1 = -1;
 else if (sc_12b_01 in(-1, -2) & sc_12b_sr000001_01 < 0 & sc_12b_sr000002_01 < 0) then amtowe_assetpoorcars1 = sc_12b_01;
  else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 = sc_12b_sr000001_01) then 
  amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_sr000001_01);
   else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 > sc_12b_sr000001_01) then 
   amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000002_01 - sc_12b_sr000001_01)/2) + sc_12b_sr000001_01));
    else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 < sc_12b_sr000001_01) then 
    amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000001_01 - sc_12b_sr000002_01)/2) + sc_12b_sr000002_01));
 
/*******************************************/
/* CDEBT Component - amtowe_assetpoorcars2 */
/*******************************************/

if (sc_12b_02 >= 0) then amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + sc_12b_02);
 else if (sc_12b_02 = 1 & sc_12b_ref_1a_02 = 1) then amtowe_assetpoorcars2 = -1;
  else if (sc_12b_02 in(-1, -2)) then amtowe_assetpoorcars2 = sc_12b_02;

/*******************************************/
/* CDEBT Component - amtowe_assetpoorcars3 */
/*******************************************/

if (sc_12b_03 >= 0) then amtowe_assetpoorcars3 = (amtowe_assetpoorcars3 + sc_12b_03);
 else if (sc_12b_03 = 1 & sc_12b_ref_1a_03 = 1) then amtowe_assetpoorcars3 = -1;
 else if (sc_12b_03 in(-1, -2)) then amtowe_assetpoorcars3 = sc_12b_03;

/*******************************************/
/* CDEBT Component - amtowe_assetpoorcars4 */
/*******************************************/

if (sc_12b_04 >= 0) then amtowe_assetpoorcars4 = (amtowe_assetpoorcars4 + sc_12b_04);
 else if (sc_12b_04 = 1 & sc_12b_ref_1a_04 = 1) then amtowe_assetpoorcars4 = -1;
 else if (sc_12b_04 in(-1, -2)) then amtowe_assetpoorcars4 = sc_12b_04;

/*******************************************/
/* CDEBT Component - amtowe_assetpoorcars5 */
/*******************************************/

if (sc_12b_05 >= 0) then amtowe_assetpoorcars5 = (amtowe_assetpoorcars5 + sc_12b_05);
 else if (sc_12b_05 = 1 & sc_12b_ref_1a_05 = 1) then amtowe_assetpoorcars5 = -1;
 else if (sc_12b_05 in(-1, -2)) then amtowe_assetpoorcars5 = sc_12b_05;

/******************************************/
/* CDEBT Component - amountowe_vehicles1  */
/******************************************/

if (nfa_4f_trunc_01 >= 0) then amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_trunc_01);
 else if (nfa_4f_trunc_01 in(-1, -2) & nfa_4f_sr000001_01 < 0 & nfa_4f_sr000002_01 < 0 
 & nfa_4f_uab_a_01 < 0 & nfa_4f_uab_b_01 < 0 & nfa_4f_uab_c_01 < 0) then amountowe_vehicles1 = nfa_4f_trunc_01;
   else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 >= 0 & nfa_4f_sr000002_01 = nfa_4f_sr000001_01) then 
   amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_sr000001_01);
    else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 >= 0 & nfa_4f_sr000002_01 > nfa_4f_sr000001_01) then 
    amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000002_01 - nfa_4f_sr000001_01)/2) + nfa_4f_sr000001_01));
     else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 >= 0 & nfa_4f_sr000002_01 < nfa_4f_sr000001_01) then 
     amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000001_01 - nfa_4f_sr000002_01)/2) + nfa_4f_sr000002_01));
      else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile1);
       else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile2);
        else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile3);
         else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + 38000);
          else if (nfa_4f_uab_a_01 in(-1, -2) | nfa_4f_uab_b_01 in(-1, -2) | nfa_4f_uab_c_01 in(-1, -2)) then amtowe_vehicles1 = -3;
 
/******************************************/
/* CDEBT Component - amountowe_vehicles2  */
/******************************************/

if (nfa_4f_trunc_02 >= 0) then amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_trunc_02);
 else if (nfa_4f_trunc_02 in(-1, -2) & nfa_4f_sr000001_02 < 0 & nfa_4f_sr000002_02 < 0 
 & nfa_4f_uab_a_02 < 0 & nfa_4f_uab_b_02 < 0 & nfa_4f_uab_c_02 < 0) then amountowe_vehicles2 = nfa_4f_trunc_02;
   else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 >= 0 & nfa_4f_sr000002_02 = nfa_4f_sr000001_02) then 
   amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_sr000001_02);
    else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 >= 0 & nfa_4f_sr000002_02 > nfa_4f_sr000001_02) then 
    amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000002_02 - nfa_4f_sr000001_02)/2) + nfa_4f_sr000001_02));
     else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 >= 0 & nfa_4f_sr000002_02 < nfa_4f_sr000001_02) then 
     amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000001_02 - nfa_4f_sr000002_02)/2) + nfa_4f_sr000002_02));
      else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile1);
       else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile2);
        else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile3);
         else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + 36000);
          else if (nfa_4f_uab_a_02 in(-1, -2) | nfa_4f_uab_b_02 in(-1, -2) | nfa_4f_uab_c_02 in(-1, -2)) then amtowe_vehicles2 = -3;
 
/******************************************/
/* CDEBT Component - amountowe_vehicles3  */
/******************************************/

if (nfa_4f_trunc_03 >= 0) then amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_trunc_03);
 else if (nfa_4f_trunc_03 in(-1, -2) & nfa_4f_sr000001_03 < 0 & nfa_4f_sr000002_03 < 0 
 & nfa_4f_uab_a_03 < 0 & nfa_4f_uab_b_03 < 0 & nfa_4f_uab_c_03 < 0) then amountowe_vehicles3 = nfa_4f_trunc_03;
   else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 >= 0 & nfa_4f_sr000002_03 = nfa_4f_sr000001_03) then 
   amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_sr000001_03);
    else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 >= 0 & nfa_4f_sr000002_03 > nfa_4f_sr000001_03) then 
    amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000002_03 - nfa_4f_sr000001_03)/2) + nfa_4f_sr000001_03));
     else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 >= 0 & nfa_4f_sr000002_03 < nfa_4f_sr000001_03) then 
     amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000001_03 - nfa_4f_sr000002_03)/2) + nfa_4f_sr000002_03));
      else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_b_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile1);
       else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_b_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile2);
        else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile3);
         else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + 35000);
          else if (nfa_4f_uab_a_03 in(-1, -2) | nfa_4f_uab_b_03 in(-1, -2) | nfa_4f_uab_c_03 in(-1, -2)) then amtowe_vehicles3 = -3;
 
/******************************************/
/* CDEBT Component - amountowe_vehicles4  */
/******************************************/

if (nfa_4f_04 >= 0) then amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_04);
 else if (nfa_4f_04 in(-1, -2) & nfa_4f_sr000001_04 < 0 & nfa_4f_sr000002_04 < 0 
 & nfa_4f_uab_a_04 < 0 & nfa_4f_uab_b_04 < 0 & nfa_4f_uab_c_04 < 0) then amountowe_vehicles4 = nfa_4f_04;
  else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 >= 0 & nfa_4f_sr000002_04 = nfa_4f_sr000001_04) then 
  amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_sr000001_04);
   else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 >= 0 & nfa_4f_sr000002_04 > nfa_4f_sr000001_04) then 
   amountowe_vehicles4 = (amountowe_vehicles4 + (((nfa_4f_sr000002_04 - nfa_4f_sr000001_04)/2) + nfa_4f_sr000001_04));
    else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 >= 0 & nfa_4f_sr000002_04 < nfa_4f_sr000001_04) then 
    amountowe_vehicles4 = (amountowe_vehicles4 + (((nfa_4f_sr000001_04 - nfa_4f_sr000002_04)/2) + nfa_4f_sr000002_04));
     else if (nfa_4f_04 in(-1, -2, -4) & nfa_4f_uab_b_04 = 0) then amountowe_vehicles4 = (amountowe_vehicles4 + quartile1);
      else if (nfa_4f_04 in(-1, -2, -4) & nfa_4f_uab_b_04 = 1) then amountowe_vehicles4 = (amountowe_vehicles4 + quartile2);
       else if (nfa_4f_04 in(-1, -2, -4) & nfa_4f_uab_c_04 = 0) then amountowe_vehicles4 = (amountowe_vehicles4 + quartile3);
        else if (nfa_4f_04 in(-1, -2, -4) & nfa_4f_uab_c_04 = 1) then amountowe_vehicles4 = (amountowe_vehicles4 + 30000);
          else if (nfa_4f_uab_a_04 in(-1, -2) | nfa_4f_uab_b_04 in(-1, -2) | nfa_4f_uab_c_04 in(-1, -2)) then amtowe_vehicles4 = -3;
 
/******************************************/
/* CDEBT Component - amountowe_vehicles5  */
/******************************************/

if (nfa_4f_trunc_05 >= 0) then amountowe_vehicles5 = (amountowe_vehicles5 + nfa_4f_trunc_05);
 else if (nfa_4f_trunc_05 in(-1, -2) & nfa_4f_sr000001_05 < 0 & nfa_4f_sr000002_05 < 0 
 & nfa_4f_uab_a_05 < 0 & nfa_4f_uab_c_05 < 0) then amountowe_vehicles5 = nfa_4f_trunc_05;
  else if (nfa_4f_sr000001_05 >= 0 & nfa_4f_sr000002_05 >= 0 & nfa_4f_sr000002_05 = nfa_4f_sr000001_05) then 
  amountowe_vehicles5 = (amountowe_vehicles5 + nfa_4f_sr000001_05);
   else if (nfa_4f_sr000001_05 >= 0 & nfa_4f_sr000002_05 >= 0 & nfa_4f_sr000002_05 > nfa_4f_sr000001_05) then 
   amountowe_vehicles5 = (amountowe_vehicles5 + (((nfa_4f_sr000002_05 - nfa_4f_sr000001_05)/2) + nfa_4f_sr000001_05));
    else if (nfa_4f_sr000001_05 >= 0 & nfa_4f_sr000002_05 >= 0 & nfa_4f_sr000002_05 < nfa_4f_sr000001_05) then 
    amountowe_vehicles5 = (amountowe_vehicles5 + (((nfa_4f_sr000001_05 - nfa_4f_sr000002_05)/2) + nfa_4f_sr000002_05));
     else if (nfa_4f_trunc_05 in(-1, -2, -4) & nfa_4f_uab_c_05 = 0) then amountowe_vehicles5 = (amountowe_vehicles5 + quartile3);
      else if (nfa_4f_trunc_05 in(-1, -2, -4) & nfa_4f_uab_c_05 = 1) then amountowe_vehicles5 = (amountowe_vehicles5 + 122000);
        else if (nfa_4f_uab_a_05 in(-1, -2) | nfa_4f_uab_c_05 in(-1, -2)) then amtowe_vehicles5 = -3;
 
/******************************************/
/* CDEBT Component - amountowe_vehicles6  */
/******************************************/

if (nfa_4f_06 >= 0) then amountowe_vehicles6 = (amountowe_vehicles6 + nfa_4f_06);
 else if (nfa_4f_06 in(-1, -2)) then amountowe_vehicles6 = nfa_4f_06;

/******************************************/
/* CDEBT Component - amountowe_vehicles7  */
/******************************************/

if (nfa_4f_07 >= 0) then amountowe_vehicles7 = (amountowe_vehicles7 + nfa_4f_07);
 else if (nfa_4f_07 in(-1, -2)) then amountowe_vehicles7 = nfa_4f_07;

/*******************************************/
/* CDEBT Component - amtowe_othervehicles  */
/*******************************************/

if (nfa_5 = 1 & nfa_5b_trunc >= 0) then amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_trunc);
 else if (nfa_5 = 1 & nfa_5b_trunc in(-1, -2) & nfa_5b_sr000001 < 0 & nfa_5b_sr000002 < 0
 & nfa_5b_uab_a < 0 & nfa_5b_uab_c < 0) then amtowe_othervehicles = nfa_5b_trunc;
   else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 = nfa_5b_sr000001) then 
   amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_sr000001);
    else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 > nfa_5b_sr000001) then 
    amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000002 - nfa_5b_sr000001)/2) + nfa_5b_sr000001));
     else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 < nfa_5b_sr000001) then 
     amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000001 - nfa_5b_sr000002)/2) + nfa_5b_sr000002));
      else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 0) then amtowe_othervehicles = (amtowe_othervehicles + quartile3);
       else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 1) then amtowe_othervehicles = (amtowe_othervehicles + 51000);
        else if (nfa_5b_uab_a in(-1, -2) | nfa_5b_uab_c in(-1, -2)) then amtowe_othervehicles = -3;
 
/*******************************/
/* Add components CDEBT        */
/*******************************/

if (amtowe_assetpoorcars1 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars1); 
if (amtowe_assetpoorcars2 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars2); 
if (amtowe_assetpoorcars3 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars3); 
if (amtowe_assetpoorcars4 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars4); 
if (amtowe_assetpoorcars5 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars5); 
if (amountowe_vehicles1 >= 0) then cdebtc = (cdebtc + amountowe_vehicles1); 
if (amountowe_vehicles2 >= 0) then cdebtc = (cdebtc + amountowe_vehicles2); 
if (amountowe_vehicles3 >= 0) then cdebtc = (cdebtc + amountowe_vehicles3); 
if (amountowe_vehicles4 >= 0) then cdebtc = (cdebtc + amountowe_vehicles4); 
if (amountowe_vehicles5 >= 0) then cdebtc = (cdebtc + amountowe_vehicles5); 
if (amountowe_vehicles6 >= 0) then cdebtc = (cdebtc + amountowe_vehicles6); 
if (amountowe_vehicles7 >= 0) then cdebtc = (cdebtc + amountowe_vehicles7);
if (amtowe_othervehicles >= 0) then cdebtc = (cdebtc + amtowe_othervehicles);

if (amtowe_assetpoorcars1 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars2 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars3 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars4 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars5 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles1 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles2 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles3 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles4 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles5 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles6 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles7 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_othervehicles in(-1, -2, -3)) then cdebtc = -3;

/****************************/
/* Compute CAR              */
/****************************/
/******************************************/
/* CAR Component - mktval_assetpoorcars1  */
/******************************************/

if (sc_12a_01 >= 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_01);
 else if (sc_12a_ref_1a_01 = 1 & sc_12a_sr000001_01 < 0 & sc_12a_sr000002_01 < 0 
 & sc_12a_uab_a_01 < 0 & sc_12a_uab_b_01 < 0) then mktval_assetpoorcars1 = -1;
  else if (sc_12a_01 in(-1, -2) & sc_12a_sr000001_01 < 0 & sc_12a_sr000002_01 < 0 
  & sc_12a_uab_a_01 < 0 & sc_12a_uab_b_01 < 0) then mktval_assetpoorcars1 = sc_12a_01;
    else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 = sc_12a_sr000001_01) then 
    mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_sr000001_01);
     else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 > sc_12a_sr000001_01) then 
     mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000002_01 - sc_12a_sr000001_01)/2) + sc_12a_sr000001_01));
      else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 < sc_12a_sr000001_01) then 
      mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000001_01 - sc_12a_sr000002_01)/2) + sc_12a_sr000001_02));
       else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile1);
        else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 1) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile2);
         else if (sc_12a_uab_a_01 in(-1, -2) | sc_12a_uab_b_01 in(-1, -2)) then mktval_assetpoorcars1 = -3;

/******************************************/
/* CAR Component - mktval_assetpoorcars2  */
/******************************************/

if (sc_12a_02 >= 0) then mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_02);
 else if (sc_12a_02 = 1 & sc_12a_ref_1a_02 = 1 & sc_12a_sr000001_02 < 0 & sc_12a_sr000002_02 < 0) then mktval_assetpoorcars2 = -1;
 else if (sc_12a_02 in(-1, -2) & sc_12a_sr000001_02 < 0 & sc_12a_sr000002_02 < 0) then mktval_assetpoorcars2 = sc_12a_02;
   else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 = sc_12a_sr000001_02) then 
   mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_sr000001_02);
    else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 > sc_12a_sr000001_02) then 
    mktval_assetpoorcars2 = (mktval_assetpoorcars2 + (((sc_12a_sr000002_02 - sc_12a_sr000001_02)/2) + sc_12a_sr000001_02));
     else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 < sc_12a_sr000001_02) then 
     mktval_assetpoorcars2 = (mktval_assetpoorcars2 + (((sc_12a_sr000001_02 - sc_12a_sr000002_02)/2) + sc_12a_sr000002_02));

/******************************************/
/* CAR Component - mktval_assetpoorcars3  */
/******************************************/

if (sc_12a_03 >= 0) then mktval_assetpoorcars3 = (mktval_assetpoorcars3 + sc_12a_03);
 else if (sc_12a_03 = 1 & sc_12a_ref_1a_03 = 1) then mktval_assetpoorcars3 = -1;
  else if (sc_12a_03 in(-1, -2)) then mktval_assetpoorcars3 = sc_12a_03;

/******************************************/
/* CAR Component - mktval_assetpoorcars4  */
/******************************************/

if (sc_12a_04 >= 0) then mktval_assetpoorcars4 = (mktval_assetpoorcars4 + sc_12a_04);
 else if (sc_12a_04 = 1 & sc_12a_ref_1a_04 = 1) then mktval_assetpoorcars4 = -1;
  else if (sc_12a_04 in(-1, -2)) then mktval_assetpoorcars4 = sc_12a_04;

/******************************************/
/* CAR Component - mktval_assetpoorcars5  */
/******************************************/

if (sc_12a_05 >= 0) then mktval_assetpoorcars5 = (mktval_assetpoorcars5 + sc_12a_05);
 else if (sc_12a_05 = 1 & sc_12a_ref_1a_05 = 1) then mktval_assetpoorcars5 = -1;
  else if (sc_12a_05 in(-1, -2)) then mktval_assetpoorcars5 = sc_12a_05;

/******************************************/
/* CAR Component - marketvalue_vehicles1  */
/******************************************/

if (nfa_4c_trunc_01 >= 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_trunc_01);
 else if (nfa_4c_trunc_01 in(-1, -2) & nfa_4c_sr000001_01 < 0 & nfa_4c_sr000002_01 < 0 
 & nfa_4c_uab_a_01 < 0 & nfa_4c_uab_b_01 < 0 & nfa_4c_uab_c_01 < 0) then marketvalue_vehicles1 = nfa_4c_trunc_01;
   else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 >= 0 & nfa_4c_sr000002_01 = nfa_4c_sr000001_01) then 
   marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_sr000001_01);
    else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 >= 0 & nfa_4c_sr000002_01 > nfa_4c_sr000001_01) then 
    marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000002_01 - nfa_4c_sr000001_01)/2) + nfa_4c_sr000001_01));
     else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 >= 0 & nfa_4c_sr000002_01 < nfa_4c_sr000001_01) then 
     marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000001_01 - nfa_4c_sr000002_01)/2) + nfa_4c_sr000002_01));
      else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile1);
       else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile2);
        else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile3);
         else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + 40000);
          else if (nfa_4c_uab_a_01 in(-1, -2) | nfa_4c_uab_b_01 in(-1, -2) | nfa_4c_uab_c_01 in(-1, -2)) then marketvalue_vehicles1 = -3;
 
/******************************************/
/* CAR Component - marketvalue_vehicles2  */
/******************************************/

if (nfa_4c_trunc_02 >= 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_trunc_02);
 else if (nfa_4c_trunc_02 in(-1, -2) & nfa_4c_sr000001_02 < 0 & nfa_4c_sr000002_02 < 0 
 & nfa_4c_uab_a_02 < 0 & nfa_4c_uab_b_02 < 0 & nfa_4c_uab_c_02 < 0) then marketvalue_vehicles2 = nfa_4c_trunc_02;
   else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 >= 0 & nfa_4c_sr000002_02 = nfa_4c_sr000001_02) then 
   marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_sr000001_02);
    else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 >= 0 & nfa_4c_sr000002_02 > nfa_4c_sr000001_02) then 
    marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000002_02 - nfa_4c_sr000001_02)/2) + nfa_4c_sr000001_02));
     else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 >= 0 & nfa_4c_sr000002_02 < nfa_4c_sr000001_02) then 
     marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000001_02 - nfa_4c_sr000002_02)/2) + nfa_4c_sr000002_02));
      else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile1);
       else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile2);
        else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile3);
         else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + 40000);
          else if (nfa_4c_uab_a_02 in(-1, -2) | nfa_4c_uab_b_02 in(-1, -2) | nfa_4c_uab_c_02 in(-1, -2)) then marketvalue_vehicles2 = -3;
 
/******************************************/
/* CAR Component - marketvalue_vehicles3  */
/******************************************/

if (nfa_4c_trunc_03 >= 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_trunc_03);
 else if (nfa_4c_trunc_03 in(-1, -2) & nfa_4c_sr000001_03 < 0 & nfa_4c_sr000002_03 < 0 
 & nfa_4c_uab_a_03 < 0 & nfa_4c_uab_b_03 < 0 & nfa_4c_uab_c_03 < 0) then marketvalue_vehicles3 = nfa_4c_trunc_03;
   else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 >= 0 & nfa_4c_sr000002_03 = nfa_4c_sr000001_03) then 
   marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_sr000001_03);
    else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 >= 0 & nfa_4c_sr000002_03 > nfa_4c_sr000001_03) then 
    marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000002_03 - nfa_4c_sr000001_03)/2) + nfa_4c_sr000001_03));
     else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 >= 0 & nfa_4c_sr000002_03 < nfa_4c_sr000001_03) then 
     marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000001_03 - nfa_4c_sr000002_03)/2) + nfa_4c_sr000002_03));
      else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile1);
       else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile2);
        else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile3);
         else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + 40000);
          else if (nfa_4c_uab_a_03 in(-1, -2) | nfa_4c_uab_b_03 in(-1, -2) | nfa_4c_uab_c_03 in(-1, -2)) then marketvalue_vehicles3 = -3;

/******************************************/
/* CAR Component - marketvalue_vehicles4  */
/******************************************/

if (nfa_4c_trunc_04 >= 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_trunc_04);
 else if (nfa_4c_trunc_04 in(-1, -2) & nfa_4c_sr000001_04 < 0 & nfa_4c_sr000002_04 < 0 
 & nfa_4c_uab_a_04 < 0 & nfa_4c_uab_b_04 < 0 & nfa_4c_uab_c_04 < 0) then marketvalue_vehicles4 = nfa_4c_trunc_04;
   else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 >= 0 & nfa_4c_sr000002_04 = nfa_4c_sr000001_04) then 
   marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_sr000001_04);
    else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 >= 0 & nfa_4c_sr000002_04 > nfa_4c_sr000001_04) then 
    marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000002_04 - nfa_4c_sr000001_04)/2) + nfa_4c_sr000001_04));
     else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 >= 0 & nfa_4c_sr000002_04 < nfa_4c_sr000001_04) then 
     marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000001_04 - nfa_4c_sr000002_04)/2) + nfa_4c_sr000002_04));
      else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_b_04 = 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile1);
       else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_b_04 = 1) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile2);
        else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_c_04 = 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile3);
         else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_c_04 = 1) then marketvalue_vehicles4 = (marketvalue_vehicles4 + 40000);
          else if (nfa_4c_uab_a_04 in(-1, -2) | nfa_4c_uab_b_04 in(-1, -2) | nfa_4c_uab_c_04 in(-1, -2)) then marketvalue_vehicles4 = -3;

/******************************************/
/* CAR Component - marketvalue_vehicles5  */
/******************************************/

if (nfa_4c_trunc_05 >= 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_trunc_05);
 else if (nfa_4c_trunc_05 in(-1, -2) & nfa_4c_sr000001_05 < 0 & nfa_4c_sr000002_05 < 0 
 & nfa_4c_uab_a_05 < 0 & nfa_4c_uab_b_05 < 0 & nfa_4c_uab_c_05 < 0) then marketvalue_vehicles5 = nfa_4c_trunc_05;
   else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 >= 0 & nfa_4c_sr000002_05 = nfa_4c_sr000001_05) then 
   marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_sr000001_05);
    else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 >= 0 & nfa_4c_sr000002_05 > nfa_4c_sr000001_05) then 
    marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000002_05 - nfa_4c_sr000001_05)/2) + nfa_4c_sr000001_05));
     else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 >= 0 & nfa_4c_sr000002_05 < nfa_4c_sr000001_05) then 
     marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000001_05 - nfa_4c_sr000002_05)/2) + nfa_4c_sr000002_05));
      else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_b_05 = 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile1);
       else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_b_05 = 1) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile2);
        else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_c_05 = 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile3);
         else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_c_05 = 1) then marketvalue_vehicles5 = (marketvalue_vehicles5 + 75000);
          else if (nfa_4c_uab_a_05 in(-1, -2) | nfa_4c_uab_b_05 in(-1, -2) | nfa_4c_uab_c_05 in(-1, -2)) then marketvalue_vehicles5 = -3;

/******************************************/
/* CAR Component - marketvalue_vehicles6  */
/******************************************/

if (nfa_4c_trunc_06 >= 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_trunc_06);
 else if (nfa_4c_trunc_06 in(-1, -2) & nfa_4c_sr000001_06 < 0 & nfa_4c_sr000002_06 < 0 
 & nfa_4c_uab_a_06 < 0) then marketvalue_vehicles6 = nfa_4c_trunc_06;
  else if (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 >= 0 & nfa_4c_sr000002_06 = nfa_4c_sr000001_06) then 
  marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_sr000001_06);
   else if (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 >= 0 & nfa_4c_sr000002_06 > nfa_4c_sr000001_06) then 
   marketvalue_vehicles6 = (marketvalue_vehicles6 + (((nfa_4c_sr000002_06 - nfa_4c_sr000001_06)/2) + nfa_4c_sr000001_06));
    else if (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 >= 0 & nfa_4c_sr000002_06 < nfa_4c_sr000001_06) then 
    marketvalue_vehicles6 = (marketvalue_vehicles6 + (((nfa_4c_sr000001_06 - nfa_4c_sr000002_06)/2) + nfa_4c_sr000002_06));
     else if (nfa_4c_uab_a_06 in(-1, -2)) then marketvalue_vehicles6 = -3;

/******************************************/
/* CAR Component - marketvalue_vehicles7  */
/******************************************/

if (nfa_4c_trunc_07 >= 0) then marketvalue_vehicles7 = (marketvalue_vehicles7 + nfa_4c_trunc_07);
 else if (nfa_4c_trunc_07 in(-1, -2) & nfa_4c_uab_a_07 < 0) then marketvalue_vehicles7 = nfa_4c_trunc_07;
  else if (nfa_4c_uab_a_07 in(-1, -2)) then marketvalue_vehicles7 = -3;

/******************************************/
/* CAR Component - marketvalue_vehicles8  */
/******************************************/

if (nfa_4c_08 >= 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + nfa_4c_08);
 else if (nfa_4c_08 in(-1, -2) & nfa_4c_uab_a_08 < 0) then marketvalue_vehicles8 = nfa_4c_08;
  else if (nfa_4c_uab_a_08 in(-1, -2)) then marketvalue_vehicles8 = -3;

/******************************************/
/* CAR Component - marketvalue_vehicles9  */
/******************************************/

if (nfa_4c_trunc_09 >= 0) then marketvalue_vehicles9 = (marketvalue_vehicles9 + nfa_4c_trunc_09);
 else if (nfa_4c_trunc_09 in(-1, -2) & nfa_4c_uab_a_09 < 0) then marketvalue_vehicles9 = nfa_4c_trunc_09;
  else if (nfa_4c_uab_a_09 in(-1, -2)) then marketvalue_vehicles9 = -3;

/*******************************************/
/* CAR Component - marketvalue_vehicles10  */
/*******************************************/

if (nfa_4c_trunc_10 >= 0) then marketvalue_vehicles10 = (marketvalue_vehicles10 + nfa_4c_trunc_10);
 else if (nfa_4c_trunc_10 in(-1, -2) & nfa_4c_uab_a_10 < 0) then marketvalue_vehicles10 = nfa_4c_trunc_10;
  else if (nfa_4c_uab_a_10 in(-1, -2)) then marketvalue_vehicles10 = -3;

/*******************************************/
/* CAR Component - marketvalue_vehicles11  */
/*******************************************/

if (nfa_4c_11 >= 0) then marketvalue_vehicles11 = (marketvalue_vehicles11 + nfa_4c_11);
 else if (nfa_4c_11 in(-1, -2) & nfa_4c_sr000001_11 < 0 & nfa_4c_sr000002_11 < 0
 & nfa_4c_uab_a_11 < 0 & nfa_4c_uab_c_11 < 0) then marketvalue_vehicles11 = nfa_4c_11;
  else if (nfa_4c_sr000001_11 >= 0 & nfa_4c_sr000002_11 >= 0 & nfa_4c_sr000002_11 = nfa_4c_sr000001_11) then 
  marketvalue_vehicles11 = (marketvalue_vehicles11 + nfa_4c_sr000001_11);
   else if (nfa_4c_sr000001_11 >= 0 & nfa_4c_sr000002_11 >= 0 & nfa_4c_sr000002_11 > nfa_4c_sr000001_11) then 
   marketvalue_vehicles11 = (marketvalue_vehicles11 + (((nfa_4c_sr000002_11 - nfa_4c_sr000001_11)/2) + nfa_4c_sr000001_11));
    else if (nfa_4c_sr000001_11 >= 0 & nfa_4c_sr000002_11 >= 0 & nfa_4c_sr000002_11 < nfa_4c_sr000001_11) then 
    marketvalue_vehicles11 = (marketvalue_vehicles11 + (((nfa_4c_sr000001_11 - nfa_4c_sr000002_11)/2) + nfa_4c_sr000002_11));
     else if (nfa_4c_11 in(-1, -2, -4) & nfa_4c_uab_c_11 = 0) then marketvalue_vehicles11 = (marketvalue_vehicles11 + quartile3);
      else if (nfa_4c_11 in(-1, -2, -4) & nfa_4c_uab_c_11 = 1) then marketvalue_vehicles11 = (marketvalue_vehicles11 + 30000);
       else if (nfa_4c_uab_a_11 in(-1, -2) | nfa_4c_uab_c_11 in(-1, -2)) then marketvalue_vehicles11 = -3;

/*******************************************/
/* CAR Component - marketvalue_vehicles12  */
/*******************************************/

if (nfa_4c_trunc_12 >= 0) then marketvalue_vehicles12 = (marketvalue_vehicles12 + nfa_4c_trunc_12);
 else if (nfa_4c_trunc_12 in(-1, -2) & nfa_4c_sr000001_12 < 0 & nfa_4c_sr000002_12 < 0
 & nfa_4c_uab_a_12 < 0) then marketvalue_vehicles12 = nfa_4c_trunc_12;
  else if (nfa_4c_sr000001_12 >= 0 & nfa_4c_sr000002_12 >= 0 & nfa_4c_sr000002_12 = nfa_4c_sr000001_12) then 
  marketvalue_vehicles12 = (marketvalue_vehicles12 + nfa_4c_sr000001_12);
   else if (nfa_4c_sr000001_12 >= 0 & nfa_4c_sr000002_12 >= 0 & nfa_4c_sr000002_12 > nfa_4c_sr000001_12) then 
   marketvalue_vehicles12 = (marketvalue_vehicles12 + (((nfa_4c_sr000002_12 - nfa_4c_sr000001_12)/2) + nfa_4c_sr000001_12));
    else if (nfa_4c_sr000001_12 >= 0 & nfa_4c_sr000002_12 >= 0 & nfa_4c_sr000002_12 < nfa_4c_sr000001_12) then 
    marketvalue_vehicles12 = (marketvalue_vehicles12 + (((nfa_4c_sr000001_12 - nfa_4c_sr000002_12)/2) + nfa_4c_sr000002_12));
         else if (nfa_4c_uab_a_12 in(-1, -2)) then marketvalue_vehicles12 = -3;
 
/*******************************************/
/* CAR Component - marketvalue_vehicles13  */
/*******************************************/

if (nfa_4c_13 >= 0) then marketvalue_vehicles13 = (marketvalue_vehicles13 + nfa_4c_13);
 else if (nfa_4c_13 in(-1, -2) & nfa_4c_uab_a_13 < 0) then marketvalue_vehicles13 = nfa_4c_13;
  else if (nfa_4c_uab_a_13 in(-1, -2)) then marketvalue_vehicles13 = -3;

/*******************************************/
/* CAR Component - marketvalue_vehicles14  */
/*******************************************/

if (nfa_4c_14 >= 0) then marketvalue_vehicles14 = (marketvalue_vehicles14 + nfa_4c_14);
 else if (nfa_4c_14 in(-1, -2) & nfa_4c_uab_a_14 < 0) then marketvalue_vehicles14 = nfa_4c_14;
  else if (nfa_4c_uab_a_14 in(-1, -2)) then marketvalue_vehicles14 = -3;

/*******************************************/
/* CAR Component - marketvalue_vehicles15  */
/*******************************************/

if (nfa_4c_15 >= 0) then marketvalue_vehicles15 = (marketvalue_vehicles15 + nfa_4c_15);
 else if (nfa_4c_15 in(-1, -2) & nfa_4c_uab_a_15 < 0) then marketvalue_vehicles15 = nfa_4c_15;
  else if (nfa_4c_uab_a_15 in(-1, -2)) then marketvalue_vehicles15 = -3;
 
/*******************************************/
/* CAR Component - marketvalue_vehicles16  */
/*******************************************/

if (nfa_4c_16 >= 0) then marketvalue_vehicles16 = (marketvalue_vehicles16 + nfa_4c_16);
 else if (nfa_4c_16 in(-1, -2) & nfa_4c_uab_a_16 < 0) then marketvalue_vehicles16 = nfa_4c_16;
  else if (nfa_4c_uab_a_16 in(-1, -2)) then marketvalue_vehicles16 = -3;
 
/*******************************************/
/* CAR Component - marketvalue_vehicles17  */
/*******************************************/

if (nfa_4c_17 >= 0) then marketvalue_vehicles17 = (marketvalue_vehicles17 + nfa_4c_17);
 else if (nfa_4c_17 in(-1, -2) & nfa_4c_uab_a_17 < 0) then marketvalue_vehicles17 = nfa_4c_17;
  else if (nfa_4c_uab_a_17 in(-1, -2)) then marketvalue_vehicles17 = -3;
 
/******************************************/
/* CAR Component - mktval_othervehicles   */
/******************************************/

if (nfa_5 = 1 & nfa_5c >= 0) then mktval_othervehicles = (mktval_othervehicles + nfa_5c);
 else if (nfa_5 = 1 & nfa_5c_ref_1 = 1 & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
 & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = -1;
  else if (nfa_5 = 1 & nfa_5c in(-1, -2) & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
  & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = nfa_5c;
    else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 = nfa_5c_sr000001) then 
    mktval_othervehicles = (mktval_othervehicles + nfa_5c_sr000001);
     else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 > nfa_5c_sr000001) then 
     mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000002 - nfa_5c_sr000001)/2) + nfa_5c_sr000001));
      else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 < nfa_5c_sr000001) then 
      mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000001 - nfa_5c_sr000002)/2) + nfa_5c_sr000002));
       else if (nfa_5c in(-1, -2, -4) & nfa_5c_uab_b = 0) then mktval_othervehicles = (mktval_othervehicles+ quartile1);
        else if (nfa_5c in(-1, -2, -4) & nfa_5c_uab_b = 1) then mktval_othervehicles = (mktval_othervehicles + quartile2);
         else if (nfa_5c in(-1, -2, -4) & nfa_5c_uab_c = 0) then mktval_othervehicles = (mktval_othervehicles + quartile3);
          else if (nfa_5c in(-1, -2, -4) & nfa_5c_uab_c = 1) then mktval_othervehicles = (mktval_othervehicles + 50000);
           else if (nfa_5c_uab_a in(-1, -2) | nfa_5c_uab_b in(-1, -2) | nfa_5c_uab_c in(-1, -2)) then mktval_othervehicles = -3;
 
/*******************************/
/* Add components CAR          */
/*******************************/

if (mktval_assetpoorcars1 >= 0) then carc = (carc + mktval_assetpoorcars1); 
if (mktval_assetpoorcars2 >= 0) then carc = (carc + mktval_assetpoorcars2); 
if (mktval_assetpoorcars3 >= 0) then carc = (carc + mktval_assetpoorcars3); 
if (mktval_assetpoorcars4 >= 0) then carc = (carc + mktval_assetpoorcars4); 
if (mktval_assetpoorcars5 >= 0) then carc = (carc + mktval_assetpoorcars5); 
if (marketvalue_vehicles1 >= 0) then carc = (carc + marketvalue_vehicles1); 
if (marketvalue_vehicles2 >= 0) then carc = (carc + marketvalue_vehicles2); 
if (marketvalue_vehicles3 >= 0) then carc = (carc + marketvalue_vehicles3); 
if (marketvalue_vehicles4 >= 0) then carc = (carc + marketvalue_vehicles4); 
if (marketvalue_vehicles5 >= 0) then carc = (carc + marketvalue_vehicles5); 
if (marketvalue_vehicles6 >= 0) then carc = (carc + marketvalue_vehicles6); 
if (marketvalue_vehicles7 >= 0) then carc = (carc + marketvalue_vehicles7); 
if (marketvalue_vehicles8 >= 0) then carc = (carc + marketvalue_vehicles8); 
if (marketvalue_vehicles9 >= 0) then carc = (carc + marketvalue_vehicles9); 
if (marketvalue_vehicles10 >= 0) then carc = (carc + marketvalue_vehicles10); 
if (marketvalue_vehicles11 >= 0) then carc = (carc + marketvalue_vehicles11); 
if (marketvalue_vehicles12 >= 0) then carc = (carc + marketvalue_vehicles12); 
if (marketvalue_vehicles13 >= 0) then carc = (carc + marketvalue_vehicles13); 
if (marketvalue_vehicles14 >= 0) then carc = (carc + marketvalue_vehicles14); 
if (marketvalue_vehicles15 >= 0) then carc = (carc + marketvalue_vehicles15); 
if (marketvalue_vehicles16 >= 0) then carc = (carc + marketvalue_vehicles16); 
if (marketvalue_vehicles17 >= 0) then carc = (carc + marketvalue_vehicles17); 
if (mktval_othervehicles >= 0) then carc = (carc + mktval_othervehicles); 

if (mktval_assetpoorcars1 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars2 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars3 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars4 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars5 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles1 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles2 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles3 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles4 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles5 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles6 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles7 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles8 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles9 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles10 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles11 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles12 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles13 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles14 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles15 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles16 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles17 in(-1, -2, -3)) then carc = -3; 
else if (mktval_othervehicles in(-1, -2, -3)) then carc = -3; 

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (irac   >= 0) then tnfw_trunc = (tnfw_trunc + irac  );
if (a401kc >= 0) then tnfw_trunc = (tnfw_trunc + a401kc);
if (cdsc   >= 0) then tnfw_trunc = (tnfw_trunc + cdsc  );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (irac   in(-1, -2, -3)) then tnfw_trunc = -3;
if (a401kc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdsc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/****************************************/
/* APPLY TOPCODE TO TNFW_TRUNC FOR 2008 */
/****************************************/
if (tnfw_trunc_2008 > 2138310) then tnfw_trunc_2008 = 3527333;

tnfw_trunc_2008 = round(tnfw_trunc_2008);

/***************************************************************/
/* TNFW_TRUNC - adjust for partially missing range estimates   */
/***************************************************************/

if (tnfw_trunc ~= -3 & 
    ((nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 in(-1, -2)) | (nfa_1a_sr000001 in(-1, -2) & nfa_1a_sr000002 >= 0)
  | (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 in(-1, -2)) | (nfa_1b_sr000001 in(-1, -2) & nfa_1b_sr000002 >= 0) 
  | (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 in(-1, -2)) | (nfa_1c_sr000001 in(-1, -2) & nfa_1c_sr000002 >= 0)
  | (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 in(-1, -2)) | (nfa_2a_sr000001 in(-1, -2) & nfa_2a_sr000002 >= 0)
  | (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 in(-1, -2)) | (nfa_2b_sr000001 in(-1, -2) & nfa_2b_sr000002 >= 0) 
  | (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 in(-1, -2)) | (nfa_2c_sr000001 in(-1, -2) & nfa_2c_sr000002 >= 0) 
  | (fa_1a_sr000001 >= 0 & fa_1a_sr000002 in(-1, -2)) | (fa_1a_sr000001 in(-1, -2) & fa_1a_sr000002 >= 0)
  | (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 in(-1, -2)) | (fa_8d_sr000001_01 in(-1, -2) & fa_8d_sr000002_01 >= 0)
  | (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 in(-1, -2)) | (fa_8d_sr000001_02 in(-1, -2) & fa_8d_sr000002_02 >= 0)
  | (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 in(-1, -2)) | (fa_8d_sr000001_03 in(-1, -2) & fa_8d_sr000002_03 >= 0)
  | (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 in(-1, -2)) | (fa_8d_sr000001_04 in(-1, -2) & fa_8d_sr000002_04 >= 0)
  | (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 in(-1, -2)) | (fa_8d_sr000001_05 in(-1, -2) & fa_8d_sr000002_05 >= 0)
  | (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 in(-1, -2)) | (fa_8d_sr000001_06 in(-1, -2) & fa_8d_sr000002_06 >= 0)
  | (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 in(-1, -2)) | (fa_8d_sr000001_07 in(-1, -2) & fa_8d_sr000002_07 >= 0)
  | (fa_6e_sr000001 >= 0 & fa_6e_sr000002 in(-1, -2)) | (fa_6e_sr000001 in(-1, -2) & fa_6e_sr000002 >= 0)
  | (fa_7c_sr000001 >= 0 & fa_7c_sr000002 in(-1, -2)) | (fa_7c_sr000001 in(-1, -2) & fa_7c_sr000002 >= 0)
  | (fa_2a_sr000001 >= 0 & fa_2a_sr000002 in(-1, -2)) | (fa_2a_sr000001 in(-1, -2) & fa_2a_sr000002 >= 0)
  | (fa_3a_sr000001 >= 0 & fa_3a_sr000002 in(-1, -2)) | (fa_3a_sr000001 in(-1, -2) & fa_3a_sr000002 >= 0)
  | (fa_4a_sr000001 >= 0 & fa_4a_sr000002 in(-1, -2)) | (fa_4a_sr000001 in(-1, -2) & fa_4a_sr000002 >= 0)
  | (fa_5a_sr000001 >= 0 & fa_5a_sr000002 in(-1, -2)) | (fa_5a_sr000001 in(-1, -2) & fa_5a_sr000002 >= 0)
  | (fa_9a_sr000001 >= 0 & fa_9a_sr000002 in(-1, -2)) | (fa_9a_sr000001 in(-1, -2) & fa_9a_sr000002 >= 0)
  | (fa_10a_sr000001 >= 0 & fa_10a_sr000002 in(-1, -2)) | (fa_10a_sr000001 in(-1, -2) & fa_10a_sr000002 >= 0)
  | (fa_11a_sr000001 >= 0 & fa_11a_sr000002 in(-1, -2)) | (fa_11a_sr000001 in(-1, -2) & fa_11a_sr000002 >= 0)
  | (q13_131_sr000001 >= 0 & q13_131_sr000002 in(-1, -2)) | (q13_131_sr000001 in(-1, -2) & q13_131_sr000002 >= 0)
  | (q13_132_sr000001 >= 0 & q13_132_sr000002 in(-1, -2)) | (q13_132_sr000001 in(-1, -2) & q13_132_sr000002 >= 0)
  | (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 in(-1, -2)) | (sc_12b_sr000001_01 in(-1, -2) & sc_12b_sr000002_01 >= 0)
  | (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 in(-1, -2)) | (nfa_4f_sr000001_01 in(-1, -2) & nfa_4f_sr000002_01 >= 0)
  | (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 in(-1, -2)) | (nfa_4f_sr000001_02 in(-1, -2) & nfa_4f_sr000002_02 >= 0)
  | (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 in(-1, -2)) | (nfa_4f_sr000001_03 in(-1, -2) & nfa_4f_sr000002_03 >= 0)
  | (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 in(-1, -2)) | (nfa_4f_sr000001_04 in(-1, -2) & nfa_4f_sr000002_04 >= 0)
  | (nfa_4f_sr000001_05 >= 0 & nfa_4f_sr000002_05 in(-1, -2)) | (nfa_4f_sr000001_05 in(-1, -2) & nfa_4f_sr000002_05 >= 0)
  | (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 in(-1, -2)) | (sc_12a_sr000001_01 in(-1, -2) & sc_12a_sr000002_01 >= 0)
  | (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 in(-1, -2)) | (sc_12a_sr000001_02 in(-1, -2) & sc_12a_sr000002_02 >= 0)
  | (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 in(-1, -2)) | (nfa_4c_sr000001_01 in(-1, -2) & nfa_4c_sr000002_01 >= 0)
  | (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 in(-1, -2)) | (nfa_4c_sr000001_02 in(-1, -2) & nfa_4c_sr000002_02 >= 0)
  | (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 in(-1, -2)) | (nfa_4c_sr000001_03 in(-1, -2) & nfa_4c_sr000002_03 >= 0)
  | (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 in(-1, -2)) | (nfa_4c_sr000001_04 in(-1, -2) & nfa_4c_sr000002_04 >= 0)
  | (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 in(-1, -2)) | (nfa_4c_sr000001_05 in(-1, -2) & nfa_4c_sr000002_05 >= 0)
  | (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 in(-1, -2)) | (nfa_4c_sr000001_06 in(-1, -2) & nfa_4c_sr000002_06 >= 0)
  | (nfa_4c_sr000001_11 >= 0 & nfa_4c_sr000002_11 in(-1, -2)) | (nfa_4c_sr000001_11 in(-1, -2) & nfa_4c_sr000002_11 >= 0)
  | (nfa_4c_sr000001_12 >= 0 & nfa_4c_sr000002_12 in(-1, -2)) | (nfa_4c_sr000001_12 in(-1, -2) & nfa_4c_sr000002_12 >= 0)
  | (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 in(-1, -2)) | (nfa_5c_sr000001 in(-1, -2) & nfa_5c_sr000002 >= 0)
  | (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 in(-1, -2)) | (nfa_6e_sr000001 in(-1, -2) & nfa_6e_sr000002 >= 0)
  | (debt_1a_sr000001 >= 0 & debt_1a_sr000002 in(-1, -2)) | (debt_1a_sr000001 in(-1, -2) & debt_1a_sr000002 >= 0)))
 then tnfw_trunc = -3;
end;

2012 TNFW_TRUNC variable creation


/***************************************************/
/* Compute dollar amt for dollars & cents vars     */
/***************************************************/

nfa_7d_truncc = nfa_7d_trunc;
if (nfa_7d_trunc > 0) then nfa_7d_truncc = (nfa_7d_trunc/100);

/***************************************************/
/* Compute dynamic QUARTILE VALUES for estimates   */
/***************************************************/

array quartileqs (i) quartile1 quartile2 quartile3 quartile4;

do i = 1 to 4;
 quartileqs = 0;
end;

if (symbol_entry_othhh = 7200) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((7200-5000)/2));
  quartile3 = (7200 + ((30000-7200)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;
else if (symbol_entry_othhh = 13000) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((13000-5000)/2));
  quartile3 = (13000 + ((30000-13000)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i)      homec mortc pdebtc cashc irac a401kc cdsc stockc trustc bizc 
                       bdebtc cdebtc carc posesc odebtc tnfw_trunc
                       collections items ccdebt studentloan childstudentloan owebusiness otherdebt
                       solebiz farm_1_value1 farm_2_value1 business_1_value1 business_2_value1
                       business_3_value1 business_4_value1 business_5_value1 realestate_1_value1 
                       realestate_2_value1 realestate_3_value1 realestate_4_value1
                       farm_1_value farm_2_value business_1_value business_2_value
                       business_3_value business_4_value business_5_value realestate_1_value 
                       realestate_2_value realestate_3_value realestate_4_value
                       debtbiz farm_1_debt1 farm_2_debt1 business_1_debt1 business_2_debt1
                       business_3_debt1 business_4_debt1 business_5_debt1 realestate_1_debt1 
                       realestate_2_debt1 realestate_3_debt1 realestate_4_debt1
                       farm_1_debt farm_2_debt business_1_debt business_2_debt
                       business_3_debt business_4_debt business_5_debt realestate_1_debt
                       govbonds mutual lifeinsure shares corpbond moneyowedtor
                       home1 secondhome mort1 secondmort pdebt1 secondpdebt
                       ira1 ira2 ira3 ira4 ira5 ira6 ira7 r_401k sp_401k
                       amtowe_assetpoorcars1 amtowe_assetpoorcars2 amtowe_assetpoorcars3
                       amountowe_vehicles1 amountowe_vehicles2 amountowe_vehicles3 amountowe_vehicles4
                       amountowe_vehicles5 amountowe_vehicles6 amountowe_vehicles9 amtowe_othervehicles
                       mktval_assetpoorcars1 mktval_assetpoorcars2 mktval_assetpoorcars3
                       marketvalue_vehicles1 marketvalue_vehicles2 marketvalue_vehicles3 marketvalue_vehicles4
                       marketvalue_vehicles5 marketvalue_vehicles6 marketvalue_vehicles7 marketvalue_vehicles8
                       marketvalue_vehicles9 marketvalue_vehicles10 marketvalue_vehicles11 marketvalue_vehicles12 
                       marketvalue_vehicles13 marketvalue_vehicles14 marketvalue_vehicles15 marketvalue_vehicles16 
                       marketvalue_vehicles17 mktval_othervehicles;

do i = 1 to 119;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;

/****************************/
/* Compute POSES            */
/****************************/
/*************************************************/
/* POSES Component - collections                 */
/*************************************************/

if (nfa_6a = 1 & nfa_6e_trunc >= 0) then collections = (collections + nfa_6e_trunc);
 else if (nfa_6a = 1 & nfa_6e_ref_1 = 1 & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0 
 & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = -1;
  else if (nfa_6a = 1 & nfa_6e_trunc in(-1, -2) & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0 
  & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = nfa_6e_trunc;
    else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 = nfa_6e_sr000001) then 
    collections = (collections + nfa_6e_sr000001);
     else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 > nfa_6e_sr000001) then 
     collections = (collections + (((nfa_6e_sr000002 - nfa_6e_sr000001)/2) + nfa_6e_sr000001));
      else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 < nfa_6e_sr000001) then 
      collections = (collections + (((nfa_6e_sr000001 - nfa_6e_sr000002)/2) + nfa_6e_sr000002));
       else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 0) then collections = (collections + quartile1);
        else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 1) then collections = (collections + quartile2);
         else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 0) then collections = (collections + quartile3);
          else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 1) then collections = (collections + 66000);
           else if (nfa_6e_uab_a in(-1, -2) | nfa_6e_uab_b in(-1, -2) | nfa_6e_uab_c in(-1, -2)) then collections = -3;
 
/*************************************************/
/* POSES Component - items                       */
/*************************************************/

if (nfa_7 = 1 & nfa_7d_truncc >= 0) then items = (items + nfa_7d_truncc);
 else if (nfa_7 = 1 & nfa_7d_ref_1 = 1 & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = -1;
  else if (nfa_7 = 1 & nfa_7d_truncc in(-1, -2) & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = nfa_7d_truncc;
   else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 0) then items = (items + quartile1);
    else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 1) then items = (items + quartile2);
     else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 0) then items = (items + quartile3);
      else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 1) then items = (items + 50000);
       else if (nfa_7d_uab_a in(-1, -2) | nfa_7d_uab_b in(-1, -2) | nfa_7d_uab_c in(-1, -2)) then items = -3;

/*******************************/
/* Add components POSES        */
/*******************************/

if (collections >= 0) then posesc = (posesc + collections); 
if (items >= 0) then posesc = (posesc + items);
if (collections in(-1, -2, -3)) then posesc = -3;
else if (items in(-1, -2, -3)) then posesc = -3;


/****************************/
/* Compute ODEBT            */
/****************************/

/*************************************************/
/* ODEBT Component - ccdebt                      */
/*************************************************/

if (debt_1 = 1 & debt_1a_trunc >= 0) then ccdebt = (ccdebt + debt_1a_trunc);
 else if (debt_1 = 1 & debt_1a_ref_1 = 1 & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0 
 & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = -1;
  else if (debt_1 = 1 & debt_1a_trunc in(-1, -2) & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0 
  & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = debt_1a_trunc;
    else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 = debt_1a_sr000001) then 
    ccdebt = (ccdebt + debt_1a_sr000001);
     else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 > debt_1a_sr000001) then 
     ccdebt = (ccdebt + (((debt_1a_sr000002 - debt_1a_sr000001)/2) + debt_1a_sr000001));
      else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 < debt_1a_sr000001) then 
      ccdebt = (ccdebt + (((debt_1a_sr000001 - debt_1a_sr000002)/2) + debt_1a_sr000002));
       else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_b = 0) then ccdebt = (ccdebt + quartile1);
        else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_b = 1) then ccdebt = (ccdebt + quartile2);
         else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_c = 0) then ccdebt = (ccdebt + quartile3);
          else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_c = 1) then ccdebt = (ccdebt + 45000);
           else if (debt_1a_uab_a in(-1, -2) | debt_1a_uab_b in(-1, -2) | debt_1a_uab_c in(-1, -2)) then ccdebt = -3;
 
/*************************************************/
/* ODEBT Component - studentloan                 */
/*************************************************/

if (debt_2 = 1 & debt_2a_trunc >= 0) then studentloan = (studentloan + debt_2a_trunc);
 else if (debt_2 = 1 & debt_2a_ref_1 = 1 & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 
 & debt_2a_uab_c < 0) then studentloan = -1;
  else if (debt_2 = 1 & debt_2a_trunc in(-1, -2) & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 
  & debt_2a_uab_c < 0) then studentloan = debt_2a_trunc;
   else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_b = 0) then studentloan = (studentloan + quartile1);
    else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_b = 1) then studentloan = (studentloan + quartile2);
     else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_c = 0) then studentloan = (studentloan + quartile3);
      else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_c = 1) then studentloan = (studentloan + 52500);
       else if (debt_2a_uab_a in(-1, -2) | debt_2a_uab_b in(-1, -2) | debt_2a_uab_c in(-1, -2)) then studentloan = -3;

/*************************************************/
/* ODEBT Component - childstudentloan            */
/*************************************************/

if (debt_2c = 1 & debt_2d_trunc >= 0) then childstudentloan = (childstudentloan + debt_2d_trunc);
 else if (debt_2c = 1 & debt_2d_ref_1 = 1 & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 
 & debt_2d_uab_c < 0) then childstudentloan = -1;
  else if (debt_2c = 1 & debt_2d_trunc in(-1, -2) & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 
  & debt_2d_uab_c < 0) then childstudentloan = debt_2d_trunc;
   else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_b = 0) then childstudentloan = (childstudentloan + quartile1);
    else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_b = 1) then childstudentloan = (childstudentloan + quartile2);
     else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_c = 0) then childstudentloan = (childstudentloan + quartile3);
      else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_c = 1) then childstudentloan = (childstudentloan + 50000);
       else if (debt_2d_uab_a in(-1, -2) | debt_2d_uab_b in(-1, -2) | debt_2d_uab_c in(-1, -2)) then childstudentloan = -3;

/*************************************************/
/* ODEBT Component - owebusiness                 */
/*************************************************/

if (debt_3 = 1 & debt_3a_trunc >= 0) then owebusiness = (owebusiness + debt_3a_trunc);
 else if (debt_3 = 1 & debt_3a_ref_1 = 1 & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 
 & debt_3a_uab_c < 0) then owebusiness = -1;
  else if (debt_3 = 1 & debt_3a_trunc in(-1, -2) & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 
  & debt_3a_uab_c < 0) then owebusiness = debt_3a_trunc;
   else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 0) then owebusiness = (owebusiness + quartile1);
    else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 1) then owebusiness = (owebusiness + quartile2);
     else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 0) then owebusiness = (owebusiness + quartile3);
      else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 1) then owebusiness = (owebusiness + 68000);
       else if (debt_3a_uab_a in(-1, -2) | debt_3a_uab_b in(-1, -2) | debt_3a_uab_c in(-1, -2)) then owebusiness = -3;

/*************************************************/
/* ODEBT Component - otherdebt                   */
/*************************************************/

if (debt_4 = 1 & debt_4a_trunc >= 0) then otherdebt = (otherdebt + debt_4a_trunc);
 else if (debt_4 = 1 & debt_4a_ref_1 = 1 & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 
 & debt_4a_uab_c < 0) then otherdebt = -1;
  else if (debt_4 = 1 & debt_4a_trunc in(-1, -2) & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 
  & debt_4a_uab_c < 0) then otherdebt = debt_4a_trunc;
   else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 0) then otherdebt = (otherdebt + quartile1);
    else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 1) then otherdebt = (otherdebt + quartile2);
     else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_c = 0) then otherdebt = (otherdebt + quartile3);
      else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_c = 1) then otherdebt = (otherdebt + 55500);
       else if (debt_4a_uab_a in(-1, -2) | debt_4a_uab_b in(-1, -2) | debt_4a_uab_c in(-1, -2)) then otherdebt = -3;

/*******************************/
/* Add components ODEBT        */
/*******************************/

if (ccdebt >= 0) then odebtc = (odebtc + ccdebt); 
if (studentloan >= 0) then odebtc = (odebtc + studentloan);
if (childstudentloan >= 0) then odebtc = (odebtc + childstudentloan);
if (owebusiness >= 0) then odebtc = (odebtc + owebusiness);
if (otherdebt >= 0) then odebtc = (odebtc + otherdebt);
if (ccdebt in(-1, -2, -3)) then odebtc = -3;
else if (studentloan in(-1, -2, -3)) then odebtc = -3;
else if (childstudentloan in(-1, -2, -3)) then odebtc = -3;
else if (owebusiness in(-1, -2, -3)) then odebtc = -3;
else if (otherdebt in(-1, -2, -3)) then odebtc = -3;

/****************************/
/* Compute BIZ              */
/****************************/

/*************************************************/
/* BIZ Component - solebiz                       */
/*************************************************/

if (q13_131_trunc >= 0) then solebiz = (solebiz + q13_131_trunc);
 else if (q13_131_ref_1 = 1 & q13_131_sr000001 < 0 & q13_131_sr000002_trunc < 0 
 & q13_131_uab_a < 0 & q13_131_uab_c < 0) then solebiz = -1;
  else if (q13_131_trunc in(-1, -2) & q13_131_sr000001 < 0 & q13_131_sr000002_trunc < 0 
  & q13_131_uab_a < 0 & q13_131_uab_c < 0) then solebiz = q13_131_trunc;
    else if (q13_131_sr000001 >= 0 & q13_131_sr000002_trunc >= 0 & q13_131_sr000002_trunc = q13_131_sr000001) then 
    solebiz = (solebiz + q13_131_sr000001);
     else if (q13_131_sr000001 >= 0 & q13_131_sr000002_trunc >= 0 & q13_131_sr000002_trunc > q13_131_sr000001) then 
     solebiz = (solebiz + (((q13_131_sr000002_trunc - q13_131_sr000001)/2) + q13_131_sr000001));
      else if (q13_131_sr000001 >= 0 & q13_131_sr000002_trunc >= 0 & q13_131_sr000002_trunc < q13_131_sr000001) then 
      solebiz = (solebiz + (((q13_131_sr000001 - q13_131_sr000002_trunc)/2) + q13_131_sr000002_trunc));
       else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 0) then solebiz = (solebiz + quartile3);
        else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 1) then solebiz = (solebiz + 250000);
         else if (q13_131_uab_a in(-1, -2) | q13_131_uab_c in(-1, -2)) then solebiz = -3;
 /********************************************************************************************************/
/* BIZ Components - farm_#_value, business_#_value, realestate_#_value & percentage ownership           */
/********************************************************************************************************/

if (q13_fjt_11_trunc_01 > -4) then farm_1_value1 = q13_fjt_11_trunc_01;
if (q13_fjt_11_trunc_02 > -4) then farm_2_value1 = q13_fjt_11_trunc_02;
if (q13_bppjt_11_trunc_01 > -4) then business_1_value1 = q13_bppjt_11_trunc_01;
if (q13_bppjt_11_trunc_02 > -4) then business_2_value1 = q13_bppjt_11_trunc_02;
if (q13_bppjt_11_trunc_03 > -4) then business_3_value1 = q13_bppjt_11_trunc_03;
if (q13_bppjt_11_trunc_04 > -4) then business_4_value1 = q13_bppjt_11_trunc_04;
if (q13_bppjt_11_trunc_05 > -4) then business_5_value1 = q13_bppjt_11_trunc_05;
if (q13_rejt_11_trunc_01 > -4) then realestate_1_value1 = q13_rejt_11_trunc_01;
if (q13_rejt_11_trunc_02 > -4) then realestate_2_value1 = q13_rejt_11_trunc_02;
if (q13_rejt_11_trunc_03 > -4) then realestate_3_value1 = q13_rejt_11_trunc_03;
if (q13_rejt_11_trunc_04 > -4) then realestate_4_value1 = q13_rejt_11_trunc_04;

if (q13_fjt_12b_01 > -4) then farm_1_pcntshare = q13_fjt_12b_01;
if (q13_fjt_12b_02 > -4) then farm_2_pcntshare = q13_fjt_12b_02;
if (q13_bppjt_12b_01 > -4) then business_1_pcntshare = q13_bppjt_12b_01;
if (q13_bppjt_12b_02 > -4) then business_2_pcntshare = q13_bppjt_12b_02;
if (q13_bppjt_12b_03 > -4) then business_3_pcntshare = q13_bppjt_12b_03;
if (q13_rejt_12b_01 > -4) then realestate_1_pcntshare = q13_rejt_12b_01;
if (q13_rejt_12b_02 > -4) then realestate_2_pcntshare = q13_rejt_12b_02;
if (q13_rejt_12b_03 > -4) then realestate_3_pcntshare = q13_rejt_12b_03;
if (q13_rejt_12b_04 > -4) then realestate_4_pcntshare = q13_rejt_12b_04;

if (farm_1_pcntshare > 0) then farm_1_pcntshare = (farm_1_pcntshare / 100);
if (farm_2_pcntshare > 0) then farm_2_pcntshare = (farm_2_pcntshare / 100);
if (business_1_pcntshare > 0) then business_1_pcntshare = (business_1_pcntshare / 100);
if (business_2_pcntshare > 0) then business_2_pcntshare = (business_2_pcntshare / 100);
if (business_3_pcntshare > 0) then business_3_pcntshare = (business_3_pcntshare / 100);
if (realestate_1_pcntshare > 0) then realestate_1_pcntshare = (realestate_1_pcntshare / 100);
if (realestate_2_pcntshare > 0) then realestate_2_pcntshare = (realestate_2_pcntshare / 100);
if (realestate_3_pcntshare > 0) then realestate_3_pcntshare = (realestate_3_pcntshare / 100);
if (realestate_4_pcntshare > 0) then realestate_4_pcntshare = (realestate_4_pcntshare / 100);

if (farm_1_value1 >= 0 & farm_1_pcntshare >= 0) then farm_1_value = (farm_1_value1 * farm_1_pcntshare);
if (farm_2_value1 >= 0 & farm_2_pcntshare >= 0) then farm_2_value = (farm_2_value1 * farm_2_pcntshare);
if (business_1_value1 >= 0 & business_1_pcntshare >= 0) then business_1_value = (business_1_value1 * business_1_pcntshare);
if (business_2_value1 >= 0 & business_2_pcntshare >= 0) then business_2_value = (business_2_value1 * business_2_pcntshare);
if (business_3_value1 >= 0 & business_3_pcntshare >= 0) then business_3_value = (business_3_value1 * business_3_pcntshare);
if (realestate_1_value1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_value = (realestate_1_value1 * realestate_1_pcntshare);
if (realestate_2_value1 >= 0 & realestate_2_pcntshare >= 0) then realestate_2_value = (realestate_2_value1 * realestate_2_pcntshare);
if (realestate_3_value1 >= 0 & realestate_3_pcntshare >= 0) then realestate_3_value = (realestate_3_value1 * realestate_3_pcntshare);
if (realestate_4_value1 >= 0 & realestate_4_pcntshare >= 0) then realestate_4_value = (realestate_4_value1 * realestate_4_pcntshare);

/*******************************/
/* Add components BIZ          */
/*******************************/

if (solebiz >= 0) then bizc = (bizc + solebiz); 
if (farm_1_value >= 0) then bizc = (bizc + farm_1_value);
if (farm_2_value >= 0) then bizc = (bizc + farm_2_value);
if (business_1_value >= 0) then bizc = (bizc + business_1_value);
if (business_2_value >= 0) then bizc = (bizc + business_2_value);
if (business_3_value >= 0) then bizc = (bizc + business_3_value);
if (business_4_value >= 0) then bizc = (bizc + business_4_value);
if (business_5_value >= 0) then bizc = (bizc + business_5_value);
if (realestate_1_value >= 0) then bizc = (bizc + realestate_1_value);
if (realestate_2_value >= 0) then bizc = (bizc + realestate_2_value);
if (realestate_3_value >= 0) then bizc = (bizc + realestate_3_value);
if (realestate_4_value >= 0) then bizc = (bizc + realestate_4_value);

if (solebiz in(-1, -2, -3)) then bizc = -3;
if (farm_1_value in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_2_value in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_1_value in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_2_value in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_3_value in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_4_value in(-1, -2, -3)) then bizc = -3;
if (business_5_value in(-1, -2, -3)) then bizc = -3;
if (realestate_1_value in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_2_value in(-1, -2, -3) | realestate_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_3_value in(-1, -2, -3) | realestate_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_4_value in(-1, -2, -3) | realestate_4_pcntshare in(-1, -2, -3)) then bizc = -3;

/****************************/
/* Compute BDEBT       */
/****************************/

/*************************************************/
/* BDEBT Component - debtbiz                     */
/*************************************************/

if (q13_132_trunc >= 0) then debtbiz = (debtbiz + q13_132_trunc);
 else if (q13_132_trunc = 1 & q13_132_ref_1 = 1 & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
 & q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = -1;
  else if (q13_132_trunc in(-1, -2) & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
  & q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = q13_132_trunc;
    else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 = q13_132_sr000001) then 
    debtbiz = (debtbiz + q13_132_sr000001);
     else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 > q13_132_sr000001) then 
     debtbiz = (debtbiz + (((q13_132_sr000002 - q13_132_sr000001)/2) + q13_132_sr000001));
      else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 < q13_132_sr000001) then 
      debtbiz = (debtbiz + (((q13_132_sr000001 - q13_132_sr000002)/2) + q13_132_sr000002));
       else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 0) then debtbiz = (debtbiz + quartile3);
        else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 1) then debtbiz = (debtbiz + 200000);
         else if (q13_132_uab_a in(-1, -2) | q13_132_uab_c in(-1, -2)) then debtbiz = -3;
 
/********************************************************************************************************/
/* BDEBT Components - farm_#_debt, business_#_debt, realestate_#_debt                                   */
/*       (use ownership percentage computed above for bizc)                                             */
/********************************************************************************************************/

if (q13_fjt_12_trunc_01 > -4) then farm_1_debt1 = q13_fjt_12_trunc_01;
if (q13_fjt_12_trunc_02 > -4) then farm_2_debt1 = q13_fjt_12_trunc_02;
if (q13_bppjt_12_trunc_01 > -4) then business_1_debt1 = q13_bppjt_12_trunc_01;
if (q13_bppjt_12_trunc_02 > -4) then business_2_debt1 = q13_bppjt_12_trunc_02;
if (q13_bppjt_12_trunc_03 > -4) then business_3_debt1 = q13_bppjt_12_trunc_03;
if (q13_bppjt_12_trunc_04 > -4) then business_4_debt1 = q13_bppjt_12_trunc_04;
if (q13_bppjt_12_trunc_05 > -4) then business_5_debt1 = q13_bppjt_12_trunc_05;
if (q13_rejt_12_trunc > -4) then realestate_1_debt1 = q13_rejt_12_trunc;

if (farm_1_debt1 >= 0 & farm_1_pcntshare >= 0) then farm_1_debt = (farm_1_debt1 * farm_1_pcntshare);
if (farm_2_debt1 >= 0 & farm_2_pcntshare >= 0) then farm_2_debt = (farm_2_debt1 * farm_2_pcntshare);
if (business_1_debt1 >= 0 & business_1_pcntshare >= 0) then business_1_debt = (business_1_debt1 * business_1_pcntshare);
if (business_2_debt1 >= 0 & business_2_pcntshare >= 0) then business_2_debt = (business_2_debt1 * business_2_pcntshare);
if (business_3_debt1 >= 0 & business_3_pcntshare >= 0) then business_3_debt = (business_3_debt1 * business_3_pcntshare);
if (business_4_debt1 >= 0) then business_4_debt = (business_4_debt1);
if (business_5_debt1 >= 0) then business_5_debt = (business_5_debt1);
if (realestate_1_debt1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_debt = (realestate_1_debt1 * realestate_1_pcntshare);

/*******************************/
/* Add components BDEBT        */
/*******************************/

if (debtbiz >= 0) then bdebtc = (bdebtc + debtbiz); 
if (farm_1_debt >= 0) then bdebtc = (bdebtc + farm_1_debt);
if (farm_2_debt >= 0) then bdebtc = (bdebtc + farm_2_debt);
if (business_1_debt >= 0) then bdebtc = (bdebtc + business_1_debt);
if (business_2_debt >= 0) then bdebtc = (bdebtc + business_2_debt);
if (business_3_debt >= 0) then bdebtc = (bdebtc + business_3_debt);
if (business_4_debt >= 0) then bdebtc = (bdebtc + business_4_debt);
if (business_5_debt >= 0) then bdebtc = (bdebtc + business_5_debt);
if (realestate_1_debt >= 0) then bdebtc = (bdebtc + realestate_1_debt);

if (debtbiz in(-1, -2, -3)) then bdebtc = -3; 
if (farm_1_debt in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_2_debt in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_1_debt in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_2_debt in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_3_debt in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_4_debt in(-1, -2, -3)) then bdebtc = -3;
if (business_5_debt in(-1, -2, -3)) then bdebtc = -3;
if (realestate_1_debt in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;


/****************************/
/* Compute CASH             */
/****************************/

/*************************************************/
/* CASH Component - cash                         */
/*************************************************/

if (fa_1 = 1 & fa_1a_trunc >= 0) then cashc = (cashc + fa_1a_trunc);
 else if (fa_1 = 1 & fa_1_ref_1 = 1 & fa_1a_sr000001_trunc < 0 & fa_1a_sr000002_trunc < 0 
 & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = -1;
  else if (fa_1 = 1 & fa_1a_trunc in(-1, -2) & fa_1a_sr000001_trunc < 0 & fa_1a_sr000002_trunc < 0 
  & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = fa_1a_trunc;
    else if (fa_1a_sr000001_trunc >= 0 & fa_1a_sr000002_trunc >= 0 & fa_1a_sr000002_trunc = fa_1a_sr000001_trunc) then 
    cashc = (cashc + fa_1a_sr000001_trunc);
     else if (fa_1a_sr000001_trunc >= 0 & fa_1a_sr000002_trunc >= 0 & fa_1a_sr000002_trunc > fa_1a_sr000001_trunc) then 
     cashc = (cashc + (((fa_1a_sr000002_trunc - fa_1a_sr000001_trunc)/2) + fa_1a_sr000001_trunc));
      else if (fa_1a_sr000001_trunc >= 0 & fa_1a_sr000002_trunc >= 0 & fa_1a_sr000002_trunc < fa_1a_sr000001_trunc) then 
      cashc = (cashc + (((fa_1a_sr000001_trunc - fa_1a_sr000002_trunc)/2) + fa_1a_sr000002_trunc));
       else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 0) then cashc = (cashc + quartile1);
        else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 1) then cashc = (cashc + quartile2);
         else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 0) then cashc = (cashc + quartile3);
          else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 1) then cashc = (cashc + 80000);
           else if (fa_1a_uab_a in(-1, -2) | fa_1a_uab_b in(-1, -2) | fa_1a_uab_c in(-1, -2)) then cashc = -3;

/*************************************************************/
/* No need to add components for CASHC - set -3 missing      */
/*************************************************************/

if (cashc in(-1, -2, -3)) then cashc = -3;

/****************************/
/* Compute CDS              */
/****************************/

/*************************************************/
/* CDS Component - cds                           */
/*************************************************/

if (fa_2 = 1 & fa_2a_trunc >= 0) then cdsc = (cdsc + fa_2a_trunc);
 else if (fa_2 = 1 & fa_2_ref_1 = 1 & fa_2a_sr000001 < 0 & fa_2a_sr000002_trunc < 0 
 & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = -1;
  else if (fa_2 = 1 & fa_2a_trunc in(-1, -2) & fa_2a_sr000001 < 0 & fa_2a_sr000002_trunc < 0 
  & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = fa_2a_trunc;
    else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002_trunc >= 0 & fa_2a_sr000002_trunc = fa_2a_sr000001) then 
    cdsc = (cdsc + fa_2a_sr000001);
     else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002_trunc >= 0 & fa_2a_sr000002_trunc > fa_2a_sr000001) then 
     cdsc = (cdsc + (((fa_2a_sr000002_trunc - fa_2a_sr000001)/2) + fa_2a_sr000001));
      else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002_trunc >= 0 & fa_2a_sr000002_trunc < fa_2a_sr000001) then 
      cdsc = (cdsc + (((fa_2a_sr000001 - fa_2a_sr000002_trunc)/2) + fa_2a_sr000002_trunc));
       else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 0) then cdsc = (cdsc + quartile1);
        else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 1) then cdsc = (cdsc + quartile2);
         else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 0) then cdsc = (cdsc + quartile3);
          else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 1) then cdsc = (cdsc + 70000);
           else if (fa_2a_uab_a in(-1, -2) | fa_2a_uab_b in(-1, -2) | fa_2a_uab_c in(-1, -2)) then cdsc = -3;
 
/*************************************************************/
/* No need to add components for CDSC - set -3 missing       */
/*************************************************************/

if (cdsc in(-1, -2, -3)) then cdsc = -3;

/****************************/
/* Compute STOCK            */
/****************************/

/*************************************************/
/* STOCK Component - govbonds                    */
/*************************************************/

if (fa_3 = 1 & fa_3a >= 0) then govbonds = (govbonds + fa_3a);
 else if (fa_3 = 1 & fa_3_ref_1 = 1 & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
 & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = -1;
  else if (fa_3 = 1 & fa_3a in(-1, -2) & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
  & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = fa_3a;
    else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 = fa_3a_sr000001) then 
    govbonds = (govbonds + fa_3a_sr000001);
     else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 > fa_3a_sr000001) then 
     govbonds = (govbonds + (((fa_3a_sr000002 - fa_3a_sr000001)/2) + fa_3a_sr000001));
      else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 < fa_3a_sr000001) then 
      govbonds = (govbonds + (((fa_3a_sr000001 - fa_3a_sr000002)/2) + fa_3a_sr000002));
       else if (fa_3a in(-1, -2, -4) & fa_3a_uab_b = 0) then govbonds = (govbonds + quartile1);
        else if (fa_3a in(-1, -2, -4) & fa_3a_uab_b = 1) then govbonds = (govbonds + quartile2);
         else if (fa_3a in(-1, -2, -4) & fa_3a_uab_c = 0) then govbonds = (govbonds + quartile3);
          else if (fa_3a in(-1, -2, -4) & fa_3a_uab_c = 1) then govbonds = (govbonds + 50000);
           else if (fa_3a_uab_a in(-1, -2) | fa_3a_uab_b in(-1, -2) | fa_3a_uab_c in(-1, -2)) then govbonds = -3;

/*************************************************/
/* STOCK Component - mutual                      */
/*************************************************/

if (fa_4 = 1 & fa_4a_trunc >= 0) then mutual = (mutual + fa_4a_trunc);
 else if (fa_4 = 1 & fa_4_ref_1 = 1 & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
 & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = -1;
  else if (fa_4 = 1 & fa_4a_trunc in(-1, -2) & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
  & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = fa_4a_trunc;
    else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 = fa_4a_sr000001) then 
    mutual = (mutual + fa_4a_sr000001);
     else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 > fa_4a_sr000001) then 
     mutual = (mutual + (((fa_4a_sr000002 - fa_4a_sr000001)/2) + fa_4a_sr000001));
      else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 < fa_4a_sr000001) then 
      mutual = (mutual + (((fa_4a_sr000001 - fa_4a_sr000002)/2) + fa_4a_sr000002));
       else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 0) then mutual = (mutual + quartile1);
        else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 1) then mutual = (mutual + quartile2);
         else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 0) then mutual = (mutual + quartile3);
          else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 1) then mutual = (mutual + 115000);
           else if (fa_4a_uab_a in(-1, -2) | fa_4a_uab_b in(-1, -2) | fa_4a_uab_c in(-1, -2)) then mutual = -3;

/*************************************************/
/* STOCK Component - lifeinsure                  */
/*************************************************/

if (fa_5 = 1 & fa_5a_trunc >= 0) then lifeinsure = (lifeinsure + fa_5a_trunc);
 else if (fa_5 = 1 & fa_5_ref_1 = 1 & fa_5a_sr000001 < 0 & fa_5a_sr000002_trunc < 0 
 & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = -1;
  else if (fa_5 = 1 & fa_5a_trunc in(-1, -2) & fa_5a_sr000001 < 0 & fa_5a_sr000002_trunc < 0 
  & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = fa_5a_trunc;
    else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc >= 0 & fa_5a_sr000002_trunc = fa_5a_sr000001) then 
    lifeinsure = (lifeinsure + fa_5a_sr000001);
     else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc >= 0 & fa_5a_sr000002_trunc > fa_5a_sr000001) then 
     lifeinsure = (lifeinsure + (((fa_5a_sr000002_trunc - fa_5a_sr000001)/2) + fa_5a_sr000001));
      else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc >= 0 & fa_5a_sr000002_trunc < fa_5a_sr000001) then 
      lifeinsure = (lifeinsure + (((fa_5a_sr000001 - fa_5a_sr000002_trunc)/2) + fa_5a_sr000002_trunc));
       else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 0) then lifeinsure = (lifeinsure + quartile1);
        else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 1) then lifeinsure = (lifeinsure + quartile2);
         else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 0) then lifeinsure = (lifeinsure + quartile3);
          else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 1) then lifeinsure = (lifeinsure + 100000);
           else if (fa_5a_uab_a in(-1, -2) | fa_5a_uab_b in(-1, -2) | fa_5a_uab_c in(-1, -2)) then lifeinsure = -3;

/*************************************************/
/* STOCK Component - shares                      */
/*************************************************/

if (fa_9 = 1 & fa_9a_trunc >= 0) then shares = (shares + fa_9a_trunc);
 else if (fa_9 = 1 & fa_9_ref_1 = 1 & fa_9a_sr000001 < 0 & fa_9a_sr000002_trunc < 0 
 & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = -1;
  else if (fa_9 = 1 & fa_9a_trunc in(-1, -2) & fa_9a_sr000001 < 0 & fa_9a_sr000002_trunc < 0 
  & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = fa_9a_trunc;
    else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002_trunc >= 0 & fa_9a_sr000002_trunc = fa_9a_sr000001) then 
    shares = (shares + fa_9a_sr000001);
     else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002_trunc >= 0 & fa_9a_sr000002_trunc > fa_9a_sr000001) then 
     shares = (shares + (((fa_9a_sr000002_trunc - fa_9a_sr000001)/2) + fa_9a_sr000001));
      else if (fa_9a_sr000001 >= 0 & fa_9a_sr000002_trunc >= 0 & fa_9a_sr000002_trunc < fa_9a_sr000001) then 
      shares = (shares + (((fa_9a_sr000001 - fa_9a_sr000002_trunc)/2) + fa_9a_sr000002_trunc));
       else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 0) then shares = (shares + quartile1);
        else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 1) then shares = (shares + quartile2);
         else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 0) then shares = (shares + quartile3);
          else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 1) then shares = (shares + 125000);
           else if (fa_9a_uab_a in(-1, -2) | fa_9a_uab_b in(-1, -2) | fa_9a_uab_c in(-1, -2)) then shares = -3;

/*************************************************/
/* STOCK Component - corpbond                    */
/*************************************************/

if (fa_10 = 1 & fa_10a_trunc >= 0) then corpbond = (corpbond + fa_10a_trunc);
 else if (fa_10 = 1 & fa_10_ref_1 = 1 & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0 
 & fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = -1;
  else if (fa_10 = 1 & fa_10a_trunc in(-1, -2) & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0 
  & fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = fa_10a_trunc;
    else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 = fa_10a_sr000001) then 
    corpbond = (corpbond + fa_10a_sr000001);
     else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 > fa_10a_sr000001) then 
     corpbond = (corpbond + (((fa_10a_sr000002 - fa_10a_sr000001)/2) + fa_10a_sr000001));
      else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 < fa_10a_sr000001) then 
      corpbond = (corpbond + (((fa_10a_sr000001 - fa_10a_sr000002)/2) + fa_10a_sr000002));
       else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 0) then corpbond = (corpbond + quartile1);
        else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 1) then corpbond = (corpbond + quartile2);
         else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 0) then corpbond = (corpbond + quartile3);
          else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 1) then corpbond = (corpbond + 100000);
           else if (fa_10a_uab_a in(-1, -2) | fa_10a_uab_b in(-1, -2) | fa_10a_uab_c in(-1, -2)) then corpbond = -3;

/*************************************************/
/* STOCK Component - moneyowedtor                */
/*************************************************/

if (fa_11 = 1 & fa_11a >= 0) then moneyowedtor = (moneyowedtor + fa_11a);
 else if (fa_11 = 1 & fa_11_ref_1 = 1 & fa_11a_sr000001_trunc < 0 & fa_11a_sr000002_trunc < 0 
 & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = -1;
  else if (fa_11 = 1 & fa_11a in(-1, -2) & fa_11a_sr000001_trunc < 0 & fa_11a_sr000002_trunc < 0 
  & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = fa_11a;
    else if (fa_11a_sr000001_trunc >= 0 & fa_11a_sr000002_trunc >= 0 & fa_11a_sr000002_trunc = fa_11a_sr000001_trunc) then 
    moneyowedtor = (moneyowedtor + fa_11a_sr000001_trunc);
     else if (fa_11a_sr000001_trunc >= 0 & fa_11a_sr000002_trunc >= 0 & fa_11a_sr000002_trunc > fa_11a_sr000001_trunc) then 
     moneyowedtor = (moneyowedtor + (((fa_11a_sr000002_trunc - fa_11a_sr000001_trunc)/2) + fa_11a_sr000001_trunc));
      else if (fa_11a_sr000001_trunc >= 0 & fa_11a_sr000002_trunc >= 0 & fa_11a_sr000002_trunc < fa_11a_sr000001_trunc) then 
      moneyowedtor = (moneyowedtor + (((fa_11a_sr000001_trunc - fa_11a_sr000002_trunc)/2) + fa_11a_sr000002_trunc));
       else if (fa_11a in(-1, -2, -4) & fa_11a_uab_b = 0) then moneyowedtor = (moneyowedtor + quartile1);
        else if (fa_11a in(-1, -2, -4) & fa_11a_uab_b = 1) then moneyowedtor = (moneyowedtor + quartile2);
         else if (fa_11a in(-1, -2, -4) & fa_11a_uab_c = 0) then moneyowedtor = (moneyowedtor + quartile3);
          else if (fa_11a in(-1, -2, -4) & fa_11a_uab_c = 1) then moneyowedtor = (moneyowedtor + 67500);
           else if (fa_11a_uab_a in(-1, -2) | fa_11a_uab_b in(-1, -2) | fa_11a_uab_c in(-1, -2)) then moneyowedtor = -3;

/*******************************/
/* Add components STOCK        */
/*******************************/

if (govbonds >= 0) then stockc = (stockc + govbonds); 
if (mutual >= 0) then stockc = (stockc + mutual);
if (lifeinsure >= 0) then stockc = (stockc + lifeinsure);
if (shares >= 0) then stockc = (stockc + shares);
if (corpbond >= 0) then stockc = (stockc + corpbond);
if (moneyowedtor >= 0) then stockc = (stockc + moneyowedtor);
if (govbonds in(-1, -2, -3)) then stockc = -3;
else if (mutual in(-1, -2, -3)) then stockc = -3;
else if (lifeinsure in(-1, -2, -3)) then stockc = -3;
else if (shares in(-1, -2, -3)) then stockc = -3;
else if (corpbond in(-1, -2, -3)) then stockc = -3;
else if (moneyowedtor in(-1, -2, -3)) then stockc = -3;

/****************************/
/* Compute HOME             */
/****************************/

/*************************************************/
/* HOME Component - home1                        */
/*************************************************/

if (nfa_1 = 1 & nfa_1a_trunc >= 0) then home1 = (home1 + nfa_1a_trunc);
 else if (nfa_1 = 1 & nfa_1_ref_1 = 1 & nfa_1a_sr000001_trunc < 0 & nfa_1a_sr000002_trunc < 0 
 & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = -1;
  else if (nfa_1 = 1 & nfa_1a_trunc in(-1, -2) & nfa_1a_sr000001_trunc < 0 & nfa_1a_sr000002_trunc < 0 
  & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = nfa_1a_trunc;
    else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002_trunc >= 0 & nfa_1a_sr000002_trunc = nfa_1a_sr000001_trunc) then 
    home1 = (home1 + nfa_1a_sr000001_trunc);
     else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002_trunc >= 0 & nfa_1a_sr000002_trunc > nfa_1a_sr000001_trunc) then 
     home1 = (home1 + (((nfa_1a_sr000002_trunc - nfa_1a_sr000001_trunc)/2) + nfa_1a_sr000001_trunc));
      else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002_trunc >= 0 & nfa_1a_sr000002_trunc < nfa_1a_sr000001_trunc) then 
      home1 = (home1 + (((nfa_1a_sr000001_trunc - nfa_1a_sr000002_trunc)/2) + nfa_1a_sr000002_trunc));
       else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 0) then home1 = (home1 + quartile1);
        else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 1) then home1 = (home1 + quartile2);
         else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 0) then home1 = (home1 + quartile3);
          else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 1) then home1 = (home1 + 175000);
           else if (nfa_1a_uab_a in(-1, -2) | nfa_1a_uab_b in(-1, -2) | nfa_1a_uab_c in(-1, -2)) then home1 = -3;

/*************************************************/
/* HOME Component - secondhome                   */
/*************************************************/

if (nfa_2 = 1 & nfa_2a_trunc >= 0) then secondhome = (secondhome + nfa_2a_trunc);
 else if (nfa_2 = 1 & nfa_2_ref_1 = 1 & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
 & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = -1;
  else if (nfa_2 = 1 & nfa_2a_trunc in(-1, -2) & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
  & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = nfa_2a_trunc;
    else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 = nfa_2a_sr000001) then 
    secondhome = (secondhome + nfa_2a_sr000001);
     else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 > nfa_2a_sr000001) then 
     secondhome = (secondhome + (((nfa_2a_sr000002 - nfa_2a_sr000001)/2) + nfa_2a_sr000001));
      else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 < nfa_2a_sr000001) then 
      secondhome = (secondhome + (((nfa_2a_sr000001 - nfa_2a_sr000002)/2) + nfa_2a_sr000002));
       else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 0) then secondhome = (secondhome + quartile1);
        else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 1) then secondhome = (secondhome + quartile2);
         else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 0) then secondhome = (secondhome + quartile3);
          else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 1) then secondhome = (secondhome + 150000);
           else if (nfa_2a_uab_a in(-1, -2) | nfa_2a_uab_b in(-1, -2) | nfa_2a_uab_c in(-1, -2)) then secondhome = -3;

/*******************************/
/* Add components HOME         */
/*******************************/

if (home1 >= 0) then homec = (homec + home1); 
if (secondhome >= 0) then homec = (homec + secondhome);
if (home1 in(-1, -2, -3)) then homec = -3;
else if (secondhome in(-1, -2, -3)) then homec = -3;

/****************************/
/* Compute MORT             */
/****************************/

/*************************************************/
/* MORT Component - mort1                        */
/*************************************************/

if (nfa_1b_trunc >= 0) then mort1 = (mort1 + nfa_1b_trunc);
 else if (nfa_1b_ref_1 = 1 & nfa_1b_sr000001 < 0 & nfa_1b_sr000002 < 0 
 & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = -1;
  else if (nfa_1b_trunc in(-1, -2) & nfa_1b_sr000001 < 0 & nfa_1b_sr000002 < 0 
  & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = nfa_1b_trunc;
    else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 = nfa_1b_sr000001) then 
    mort1 = (mort1 + nfa_1b_sr000001);
     else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 > nfa_1b_sr000001) then 
     mort1 = (mort1 + (((nfa_1b_sr000002 - nfa_1b_sr000001)/2) + nfa_1b_sr000001));
      else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 < nfa_1b_sr000001) then 
      mort1 = (mort1 + (((nfa_1b_sr000001 - nfa_1b_sr000002)/2) + nfa_1b_sr000002));
       else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 0) then mort1 = (mort1 + quartile1);
        else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 1) then mort1 = (mort1 + quartile2);
         else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 0) then mort1 = (mort1 + quartile3);
          else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 1) then mort1 = (mort1 + 120000);
           else if (nfa_1b_uab_a in(-1, -2) | nfa_1b_uab_b in(-1, -2) | nfa_1b_uab_c in(-1, -2)) then mort1 = -3;

/*************************************************/
/* MORT Component - secondmort                   */
/*************************************************/

if (nfa_2b_trunc >= 0) then secondmort = (secondmort + nfa_2b_trunc);
 else if (nfa_2b_ref_1 = 1 & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
 & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = -1;
  else if (nfa_2b_trunc in(-1, -2) & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
  & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = nfa_2b_trunc;
    else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 = nfa_2b_sr000001) then 
    secondmort = (secondmort + nfa_2b_sr000001);
     else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 > nfa_2b_sr000001) then 
     secondmort = (secondmort + (((nfa_2b_sr000002 - nfa_2b_sr000001)/2) + nfa_2b_sr000001));
      else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 < nfa_2b_sr000001) then 
      secondmort = (secondmort + (((nfa_2b_sr000001 - nfa_2b_sr000002)/2) + nfa_2b_sr000002));
       else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 0) then secondmort = (secondmort + quartile1);
        else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 1) then secondmort = (secondmort + quartile2);
         else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 0) then secondmort = (secondmort + quartile3);
          else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 1) then secondmort = (secondmort + 120000);
           else if (nfa_2b_uab_a in(-1, -2) | nfa_2b_uab_b in(-1, -2) | nfa_2b_uab_c in(-1, -2)) then secondmort = -3;

/*******************************/
/* Add components MORT         */
/*******************************/

if (mort1 >= 0) then mortc = (mortc + mort1); 
if (secondmort >= 0) then mortc = (mortc + secondmort);
if (mort1 in(-1, -2, -3)) then mortc = -3;
else if (secondmort in(-1, -2, -3)) then mortc = -3;

/****************************/
/* Compute PDEBT            */
/****************************/

/*************************************************/
/* PDEBT Component - pdebt1                      */
/*************************************************/

if (nfa_1c >= 0) then pdebt1 = (pdebt1 + nfa_1c);
 else if (nfa_1c_ref_1 = 1 & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
 & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = -1;
  else if (nfa_1c in(-1, -2) & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
  & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = nfa_1c;
    else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 = nfa_1c_sr000001) then 
    pdebt1 = (pdebt1 + nfa_1c_sr000001);
     else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 > nfa_1c_sr000001) then 
     pdebt1 = (pdebt1 + (((nfa_1c_sr000002 - nfa_1c_sr000001)/2) + nfa_1c_sr000001));
      else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 < nfa_1c_sr000001) then 
      pdebt1 = (pdebt1 + (((nfa_1c_sr000001 - nfa_1c_sr000002)/2) + nfa_1c_sr000002));
       else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 0) then pdebt1 = (pdebt1 + quartile1);
        else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 1) then pdebt1 = (pdebt1 + quartile2);
         else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 0) then pdebt1 = (pdebt1 + quartile3);
          else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 1) then pdebt1 = (pdebt1 + 45000);
           else if (nfa_1c_uab_a in(-1, -2) | nfa_1c_uab_b in(-1, -2) | nfa_1c_uab_c in(-1, -2)) then pdebt1 = -3;

/*************************************************/
/* PDEBT Component - secondpdebt                 */
/*************************************************/

if (nfa_2c >= 0) then secondpdebt = (secondpdebt + nfa_2c);
 else if (nfa_2c_ref_1 = 1 & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 
 & nfa_2c_uab_a < 0 & nfa_2c_uab_b < 0 & nfa_2c_uab_c < 0) then secondpdebt = -1;
  else if (nfa_2c in(-1, -2) & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 
  & nfa_2c_uab_a < 0 & nfa_2c_uab_b < 0 & nfa_2c_uab_c < 0) then secondpdebt = nfa_2c;
    else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 = nfa_2c_sr000001) then 
    secondpdebt = (secondpdebt + nfa_2c_sr000001);
     else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 > nfa_2c_sr000001) then 
     secondpdebt = (secondpdebt + (((nfa_2c_sr000002 - nfa_2c_sr000001)/2) + nfa_2c_sr000001));
      else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 < nfa_2c_sr000001) then 
      secondpdebt = (secondpdebt + (((nfa_2c_sr000001 - nfa_2c_sr000002)/2) + nfa_2c_sr000002));
       else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_b = 0) then secondpdebt = (secondpdebt + quartile1);
        else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_b = 1) then secondpdebt = (secondpdebt + quartile2);
         else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_c = 0) then secondpdebt = (secondpdebt + quartile3);
          else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_c = 1) then secondpdebt = (secondpdebt + 45000);
           else if (nfa_2c_uab_a in(-1, -2)) then secondpdebt = -3;

/*******************************/
/* Add components PDEBT        */
/*******************************/

if (pdebt1 >= 0) then pdebtc = (pdebtc + pdebt1); 
if (secondpdebt >= 0) then pdebtc = (pdebtc + secondpdebt);
if (pdebt1 in(-1, -2, -3)) then pdebtc = -3;
else if (secondpdebt in(-1, -2, -3)) then pdebtc = -3;

/****************************/
/* Compute IRA              */
/****************************/

/*************************************************/
/* IRA Component - ira1                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_01 >= 0) then ira1 = (ira1 + fa_8d_trunc_01);
  else if (fa_8 = 1 & fa_8d_trunc_01 in(-1, -2) & fa_8d_sr000001_01 < 0 & fa_8d_sr000002_01 < 0 
  & fa_8d_uab_a_01 < 0 & fa_8d_uab_b_01 < 0 & fa_8d_uab_c_01 < 0) then ira1 = fa_8d_trunc_01;
    else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 = fa_8d_sr000001_01) then 
    ira1 = (ira1 + fa_8d_sr000001_01);
     else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 > fa_8d_sr000001_01) then 
     ira1 = (ira1 + (((fa_8d_sr000002_01 - fa_8d_sr000001_01)/2) + fa_8d_sr000001_01));
      else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 < fa_8d_sr000001_01) then 
      ira1 = (ira1 + (((fa_8d_sr000001_01 - fa_8d_sr000002_01)/2) + fa_8d_sr000002_01));
       else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 0) then ira1 = (ira1 + quartile1);
        else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 1) then ira1 = (ira1 + quartile2);
         else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 0) then ira1 = (ira1 + quartile3);
          else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 1) then ira1 = (ira1 + 100000);
           else if (fa_8d_uab_a_01 in(-1, -2) | fa_8d_uab_b_01 in(-1, -2) | fa_8d_uab_c_01 in(-1, -2)) then ira1 = -3;

/*************************************************/
/* IRA Component - ira2                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_02 >= 0) then ira2 = (ira2 + fa_8d_trunc_02);
  else if (fa_8 = 1 & fa_8d_trunc_02 in(-1, -2) & fa_8d_sr000001_02 < 0 & fa_8d_sr000002_02 < 0 
  & fa_8d_uab_a_02 < 0 & fa_8d_uab_b_02 < 0 & fa_8d_uab_c_02 < 0) then ira2 = fa_8d_trunc_02;
    else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 = fa_8d_sr000001_02) then 
    ira2 = (ira2 + fa_8d_sr000001_02);
     else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 > fa_8d_sr000001_02) then 
     ira2 = (ira2 + (((fa_8d_sr000002_02 - fa_8d_sr000001_02)/2) + fa_8d_sr000001_02));
      else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 < fa_8d_sr000001_02) then 
      ira2 = (ira2 + (((fa_8d_sr000001_02 - fa_8d_sr000002_02)/2) + fa_8d_sr000002_02));
       else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 0) then ira2 = (ira2 + quartile1);
        else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 1) then ira2 = (ira2 + quartile2);
         else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 0) then ira2 = (ira2 + quartile3);
          else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 1) then ira2 = (ira2 + 54000);
           else if (fa_8d_uab_a_02 in(-1, -2) | fa_8d_uab_b_02 in(-1, -2) | fa_8d_uab_c_02 in(-1, -2)) then ira2 = -3;

/*************************************************/
/* IRA Component - ira3                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_03 >= 0) then ira3 = (ira3 + fa_8d_trunc_03);
  else if (fa_8 = 1 & fa_8d_trunc_03 in(-1, -2) & fa_8d_sr000001_03 < 0 & fa_8d_sr000002_03 < 0 
  & fa_8d_uab_a_03 < 0 & fa_8d_uab_c_03 < 0) then ira3 = fa_8d_trunc_03;
    else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 = fa_8d_sr000001_03) then 
    ira3 = (ira3 + fa_8d_sr000001_03);
     else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 > fa_8d_sr000001_03) then 
     ira3 = (ira3 + (((fa_8d_sr000002_03 - fa_8d_sr000001_03)/2) + fa_8d_sr000001_03));
      else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 >= 0 & fa_8d_sr000002_03 < fa_8d_sr000001_03) then 
      ira3 = (ira3 + (((fa_8d_sr000001_03 - fa_8d_sr000002_03)/2) + fa_8d_sr000002_03));
       else if (fa_8d_trunc_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 0) then ira3 = (ira3 + quartile3);
        else if (fa_8d_trunc_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 1) then ira3 = (ira3 + 80000);
         else if (fa_8d_uab_a_03 in(-1, -2) | fa_8d_uab_c_03 in(-1, -2)) then ira3 = -3;

/*************************************************/
/* IRA Component - ira4                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_04 >= 0) then ira4 = (ira4 + fa_8d_trunc_04);
  else if (fa_8 = 1 & fa_8d_trunc_04 in(-1, -2) & fa_8d_sr000001_04 < 0 & fa_8d_sr000002_04 < 0) 
  then ira4 = fa_8d_trunc_04;
    else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 = fa_8d_sr000001_04) then 
    ira4 = (ira4 + fa_8d_sr000001_04);
     else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 > fa_8d_sr000001_04) then 
     ira4 = (ira4 + (((fa_8d_sr000002_04 - fa_8d_sr000001_04)/2) + fa_8d_sr000001_04));
      else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 >= 0 & fa_8d_sr000002_04 < fa_8d_sr000001_04) then 
      ira4 = (ira4 + (((fa_8d_sr000001_04 - fa_8d_sr000002_04)/2) + fa_8d_sr000002_04));

/*************************************************/
/* IRA Component - ira5                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_05 >= 0) then ira5 = (ira5 + fa_8d_trunc_05);
  else if (fa_8 = 1 & fa_8d_trunc_05 in(-1, -2) & fa_8d_sr000001_05 < 0 & fa_8d_sr000002_05 < 0 
  & fa_8d_uab_a_05 < 0 & fa_8d_uab_c_05 < 0) then ira5 = fa_8d_trunc_05;
    else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 = fa_8d_sr000001_05) then 
    ira5 = (ira5 + fa_8d_sr000001_05);
     else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 > fa_8d_sr000001_05) then 
     ira5 = (ira5 + (((fa_8d_sr000002_05 - fa_8d_sr000001_05)/2) + fa_8d_sr000001_05));
      else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 < fa_8d_sr000001_05) then 
      ira5 = (ira5 + (((fa_8d_sr000001_05 - fa_8d_sr000002_05)/2) + fa_8d_sr000002_05));
       else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 0) then ira5 = (ira5 + quartile3);
        else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 1) then ira5 = (ira5 + 84000);
         else if (fa_8d_uab_a_05 in(-1, -2) | fa_8d_uab_c_05 in(-1, -2)) then ira5 = -3;
 
/*************************************************/
/* IRA Component - ira6                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_06 >= 0) then ira6 = (ira6 + fa_8d_trunc_06);
  else if (fa_8 = 1 & fa_8d_trunc_06 in(-1, -2) & fa_8d_sr000001_06 < 0 & fa_8d_sr000002_06 < 0 
  & fa_8d_uab_a_06 < 0 & fa_8d_uab_b_06 < 0 & fa_8d_uab_c_06 < 0) then ira6 = fa_8d_trunc_06;
    else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 = fa_8d_sr000001_06) then 
    ira6 = (ira6 + fa_8d_sr000001_06);
     else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 > fa_8d_sr000001_06) then 
     ira6 = (ira6 + (((fa_8d_sr000002_06 - fa_8d_sr000001_06)/2) + fa_8d_sr000001_06));
      else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 < fa_8d_sr000001_06) then 
      ira6 = (ira6 + (((fa_8d_sr000001_06 - fa_8d_sr000002_06)/2) + fa_8d_sr000002_06));
       else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 0) then ira6 = (ira6 + quartile1);
        else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 1) then ira6 = (ira6 + quartile2);
         else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 0) then ira6 = (ira6 + quartile3);
          else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 1) then ira6 = (ira6 + 60000);
           else if (fa_8d_uab_a_06 in(-1, -2) | fa_8d_uab_b_06 in(-1, -2) | fa_8d_uab_c_06 in(-1, -2)) then ira6 = -3;
 
/*************************************************/
/* IRA Component - ira7                          */
/*************************************************/

if (fa_8 = 1 & fa_8d_trunc_07 >= 0) then ira7 = (ira7 + fa_8d_trunc_07);
  else if (fa_8 = 1 & fa_8d_trunc_07 in(-1, -2) & fa_8d_sr000001_07 < 0 & fa_8d_sr000002_07 < 0 
  & fa_8d_uab_a_07 < 0 & fa_8d_uab_c_07 < 0) then ira7 = fa_8d_trunc_07;
    else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 = fa_8d_sr000001_07) then 
    ira7 = (ira7 + fa_8d_sr000001_07);
     else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 > fa_8d_sr000001_07) then 
     ira7 = (ira7 + (((fa_8d_sr000002_07 - fa_8d_sr000001_07)/2) + fa_8d_sr000001_07));
      else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 < fa_8d_sr000001_07) then 
      ira7 = (ira7 + (((fa_8d_sr000001_07 - fa_8d_sr000002_07)/2) + fa_8d_sr000002_07));
       else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 0) then ira7 = (ira7 + quartile3);
        else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 1) then ira7 = (ira7 + 130000);
         else if (fa_8d_uab_a_07 in(-1, -2) | fa_8d_uab_c_07 in(-1, -2)) then ira7 = -3;
 
/*******************************/
/* Add components IRA          */
/*******************************/

if (ira1 >= 0) then irac = (irac + ira1); 
if (ira2 >= 0) then irac = (irac + ira2); 
if (ira3 >= 0) then irac = (irac + ira3); 
if (ira4 >= 0) then irac = (irac + ira4); 
if (ira5 >= 0) then irac = (irac + ira5); 
if (ira6 >= 0) then irac = (irac + ira6); 
if (ira7 >= 0) then irac = (irac + ira7); 
if (ira1 in(-1, -2, -3)) then irac = -3;
else if (ira2 in(-1, -2, -3)) then irac = -3;
else if (ira3 in(-1, -2, -3)) then irac = -3;
else if (ira4 in(-1, -2, -3)) then irac = -3;
else if (ira5 in(-1, -2, -3)) then irac = -3;
else if (ira6 in(-1, -2, -3)) then irac = -3;
else if (ira7 in(-1, -2, -3)) then irac = -3;

/****************************/
/* Compute A401K            */
/****************************/

/*************************************************/
/* A401K component - r_401k                 */
/*************************************************/

if (fa_6b = 1 & fa_6e_trunc >= 0) then r_401k = (r_401k + fa_6e_trunc);
 else if (fa_6b = 1 & fa_6e_ref_1 = 1 & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
 & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = -1;
  else if (fa_6b = 1 & fa_6e_trunc in(-1, -2) & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
  & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = fa_6e_trunc;
   else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 = fa_6e_sr000001) then 
    r_401k = (r_401k + fa_6e_sr000001);
     else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 > fa_6e_sr000001) then 
     r_401k = (r_401k + (((fa_6e_sr000002 - fa_6e_sr000001)/2) + fa_6e_sr000001));
      else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 < fa_6e_sr000001) then 
      r_401k = (r_401k + (((fa_6e_sr000001 - fa_6e_sr000002)/2) + fa_6e_sr000002));
       else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 0) then r_401k = (r_401k + quartile1);
        else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 1) then r_401k = (r_401k + quartile2);
         else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 0) then r_401k = (r_401k + quartile3);
          else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 1) then r_401k = (r_401k + 100000);
           else if (fa_6e_uab_a in(-1, -2) | fa_6e_uab_b in(-1, -2) | fa_6e_uab_c in(-1, -2)) then r_401k = -3;


/*************************************************/
/* A401K component - sp_401k                     */
/*************************************************/

if (fa_7 = 1 & fa_7c_trunc >= 0) then sp_401k = (sp_401k + fa_7c_trunc);
 else if (fa_7 = 1 & fa_7c_ref_1 = 1 & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0 
 & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = -1;
  else if (fa_7 = 1 & fa_7c_trunc in(-1, -2) & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0 
  & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = fa_7c_trunc;
    else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 = fa_7c_sr000001) then 
    sp_401k = (sp_401k + fa_7c_sr000001);
     else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 > fa_7c_sr000001) then 
     sp_401k = (sp_401k + (((fa_7c_sr000002 - fa_7c_sr000001)/2) + fa_7c_sr000001));
      else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 < fa_7c_sr000001) then 
      sp_401k = (sp_401k + (((fa_7c_sr000001 - fa_7c_sr000002)/2) + fa_7c_sr000002));
       else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 0) then sp_401k = (sp_401k + quartile1);
        else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 1) then sp_401k = (sp_401k + quartile2);
         else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 0) then sp_401k = (sp_401k + quartile3);
          else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 1) then sp_401k = (sp_401k + 100000);
           else if (fa_7c_uab_a in(-1, -2) | fa_7c_uab_b in(-1, -2) | fa_7c_uab_c in(-1, -2)) then sp_401k = -3;

/*******************************/
/* Add components A401K        */
/*******************************/

if (r_401k >= 0) then a401kc = (a401kc + r_401k); 
if (sp_401k >= 0) then a401kc = (a401kc + sp_401k); 
if (r_401k in(-1, -2, -3)) then a401kc = -3;
else if (sp_401k in(-1, -2, -3)) then a401kc = -3;

/****************************/
/* Compute CDEBT            */
/****************************/
/*************************************************/
/* CDEBT Component - amtowe_assetpoorcars1       */
/*************************************************/

if (sc_12b_01 >= 0) then amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_01);
  else if (sc_12b_01 in(-1, -2) & sc_12b_sr000001_01 < 0 & sc_12b_sr000002_01 < 0 
  & sc_12b_uab_a_01 < 0) then amtowe_assetpoorcars1 = sc_12b_01;
   else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 = sc_12b_sr000001_01) then 
   amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_sr000001_01);
    else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 > sc_12b_sr000001_01) then 
    amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000002_01 - sc_12b_sr000001_01)/2) + sc_12b_sr000001_01));
     else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 < sc_12b_sr000001_01) then 
     amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000001_01 - sc_12b_sr000002_01)/2) + sc_12b_sr000002_01));

/*************************************************/
/* CDEBT Component - amtowe_assetpoorcars2       */
/*************************************************/

if (sc_12b_02 >= 0) then amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + sc_12b_02);
  else if (sc_12b_02 in(-1, -2) /* & sc_12b_sr000001_02 < 0 & sc_12b_sr000002_02 < 0 
  & sc_12b_uab_a_02 < 0 & sc_12b_uab_b_02 < 0 & sc_12b_uab_c_02 < 0*/) then amtowe_assetpoorcars2 = sc_12b_02;

/*************************************************/
/* CDEBT Component - amtowe_assetpoorcars3       */
/*************************************************/

if (sc_12b_03 >= 0) then amtowe_assetpoorcars3 = (amtowe_assetpoorcars3 + sc_12b_03);
  else if (sc_12b_03 in(-1, -2) & sc_12b_sr000001_03 < 0 & sc_12b_sr000002_03 < 0 
  & sc_12b_uab_a_03 < 0) then amtowe_assetpoorcars3 = sc_12b_03;
   else if (sc_12b_sr000001_03 >= 0 & sc_12b_sr000002_03 >= 0 & sc_12b_sr000002_03 = sc_12b_sr000001_03) then 
   amtowe_assetpoorcars3 = (amtowe_assetpoorcars3 + sc_12b_sr000001_03);
    else if (sc_12b_sr000001_03 >= 0 & sc_12b_sr000002_03 >= 0 & sc_12b_sr000002_03 > sc_12b_sr000001_03) then 
    amtowe_assetpoorcars3 = (amtowe_assetpoorcars3 + (((sc_12b_sr000002_03 - sc_12b_sr000001_03)/2) + sc_12b_sr000001_03));
     else if (sc_12b_sr000001_03 >= 0 & sc_12b_sr000002_03 >= 0 & sc_12b_sr000002_03 < sc_12b_sr000001_03) then 
     amtowe_assetpoorcars3 = (amtowe_assetpoorcars3 + (((sc_12b_sr000001_03 - sc_12b_sr000002_03)/2) + sc_12b_sr000002_03));
 
/*************************************************/
/* CDEBT Component - amountowe_vehicles1         */
/*************************************************/

if (nfa_4f_trunc_01 >= 0) then amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_trunc_01);
 else if (nfa_4f_trunc_01 in(-1, -2) & nfa_4f_sr000001_trunc_01 < 0 & nfa_4f_sr000002_trunc_01 < 0 
 & nfa_4f_uab_a_01 < 0 & nfa_4f_uab_b_01 < 0 & nfa_4f_uab_c_01 < 0) then amountowe_vehicles1 = nfa_4f_trunc_01;
   else if (nfa_4f_sr000001_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 = nfa_4f_sr000001_trunc_01) then 
   amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_sr000001_trunc_01);
    else if (nfa_4f_sr000001_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 > nfa_4f_sr000001_trunc_01) then 
    amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000002_trunc_01 - nfa_4f_sr000001_trunc_01)/2) + nfa_4f_sr000001_trunc_01));
     else if (nfa_4f_sr000001_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 < nfa_4f_sr000001_trunc_01) then 
     amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000001_trunc_01 - nfa_4f_sr000002_trunc_01)/2) + nfa_4f_sr000002_trunc_01));
      else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile1);
       else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile2);
        else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile3);
         else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + 37000);
          else if (nfa_4f_uab_a_01 in(-1, -2) | nfa_4f_uab_b_01 in(-1, -2) | nfa_4f_uab_c_01 in(-1, -2)) then amtowe_vehicles1 = -3;
 
/*************************************************/
/* CDEBT Component - amountowe_vehicles2         */
/*************************************************/

if (nfa_4f_trunc_02 >= 0) then amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_trunc_02);
 else if (nfa_4f_trunc_02 in(-1, -2) & nfa_4f_sr000001_trunc_02 < 0 & nfa_4f_sr000002_trunc_02 < 0 
 & nfa_4f_uab_a_02 < 0 & nfa_4f_uab_b_02 < 0 & nfa_4f_uab_c_02 < 0) then amountowe_vehicles2 = nfa_4f_trunc_02;
   else if (nfa_4f_sr000001_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 = nfa_4f_sr000001_trunc_02) then 
   amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_sr000001_trunc_02);
    else if (nfa_4f_sr000001_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 > nfa_4f_sr000001_trunc_02) then 
    amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000002_trunc_02 - nfa_4f_sr000001_trunc_02)/2) + nfa_4f_sr000001_trunc_02));
     else if (nfa_4f_sr000001_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 < nfa_4f_sr000001_trunc_02) then 
     amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000001_trunc_02 - nfa_4f_sr000002_trunc_02)/2) + nfa_4f_sr000002_trunc_02));
      else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile1);
       else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile2);
        else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile3);
         else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + 35000);
          else if (nfa_4f_uab_a_02 in(-1, -2) | nfa_4f_uab_b_02 in(-1, -2) | nfa_4f_uab_c_02 in(-1, -2)) then amtowe_vehicles2 = -3;

/*************************************************/
/* CDEBT Component - amountowe_vehicles3         */
/*************************************************/

if (nfa_4f_trunc_03 >= 0) then amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_trunc_03);
 else if (nfa_4f_trunc_03 in(-1, -2) & nfa_4f_sr000001_trunc_03 < 0 & nfa_4f_sr000002_trunc_03 < 0 
 & nfa_4f_uab_a_03 < 0 & nfa_4f_uab_b_03 < 0 & nfa_4f_uab_c_03 < 0) then amountowe_vehicles3 = nfa_4f_trunc_03;
   else if (nfa_4f_sr000001_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 = nfa_4f_sr000001_trunc_03) then 
   amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_sr000001_trunc_03);
    else if (nfa_4f_sr000001_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 > nfa_4f_sr000001_trunc_03) then 
    amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000002_trunc_03 - nfa_4f_sr000001_trunc_03)/2) + nfa_4f_sr000001_trunc_03));
     else if (nfa_4f_sr000001_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 < nfa_4f_sr000001_trunc_03) then 
     amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000001_trunc_03 - nfa_4f_sr000002_trunc_03)/2) + nfa_4f_sr000002_trunc_03));
      else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_b_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile1);
       else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_b_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile2);
        else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile3);
         else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + 38000);
          else if (nfa_4f_uab_a_03 in(-1, -2) | nfa_4f_uab_b_03 in(-1, -2) | nfa_4f_uab_c_03 in(-1, -2)) then amtowe_vehicles3 = -3;

/*************************************************/
/* CDEBT Component - amountowe_vehicles4         */
/*************************************************/

if (nfa_4f_trunc_04 >= 0) then amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_trunc_04);
 else if (nfa_4f_trunc_04 in(-1, -2)) then amountowe_vehicles4 = nfa_4f_trunc_04;

/*************************************************/
/* CDEBT Component - amountowe_vehicles5         */
/*************************************************/

if (nfa_4f_trunc_05 >= 0) then amountowe_vehicles5 = (amountowe_vehicles5 + nfa_4f_trunc_05);
 else if (nfa_4f_trunc_05 in(-1, -2)) then amountowe_vehicles5 = nfa_4f_trunc_05;

/*************************************************/
/* CDEBT Component - amountowe_vehicles6         */
/*************************************************/

if (nfa_4f_trunc_06 >= 0) then amountowe_vehicles6 = (amountowe_vehicles6 + nfa_4f_trunc_06);
 else if (nfa_4f_trunc_06 in(-1, -2) & nfa_4f_sr000001_trunc_06 < 0 & nfa_4f_sr000002_trunc_06 < 0 
 & nfa_4f_uab_a_06 < 0) then amountowe_vehicles6 = nfa_4f_trunc_06;
   else if (nfa_4f_sr000001_trunc_06 >= 0 & nfa_4f_sr000002_trunc_06 >= 0 & nfa_4f_sr000002_trunc_06 = nfa_4f_sr000001_trunc_06) then 
   amountowe_vehicles6 = (amountowe_vehicles6 + nfa_4f_sr000001_trunc_06);
    else if (nfa_4f_sr000001_trunc_06 >= 0 & nfa_4f_sr000002_trunc_06 >= 0 & nfa_4f_sr000002_trunc_06 > nfa_4f_sr000001_trunc_06) then 
    amountowe_vehicles6 = (amountowe_vehicles6 + (((nfa_4f_sr000002_trunc_06 - nfa_4f_sr000001_trunc_06)/2) + nfa_4f_sr000001_trunc_06));
     else if (nfa_4f_sr000001_trunc_06 >= 0 & nfa_4f_sr000002_trunc_06 >= 0 & nfa_4f_sr000002_trunc_06 < nfa_4f_sr000001_trunc_06) then 
     amountowe_vehicles6 = (amountowe_vehicles6 + (((nfa_4f_sr000001_trunc_06 - nfa_4f_sr000002_trunc_06)/2) + nfa_4f_sr000002_trunc_06));
      else if (nfa_4f_uab_a_06 in(-1, -2)) then amtowe_vehicles6 = -3;

/*************************************************/
/* CDEBT Component - amountowe_vehicles9         */
/*************************************************/

if (nfa_4f_trunc_09 >= 0) then amountowe_vehicles9 = (amountowe_vehicles9 + nfa_4f_trunc_09);
 else if (nfa_4f_trunc_09 in(-1, -2)) then amountowe_vehicles9 = nfa_4f_trunc_09;

/*************************************************/
/* CDEBT Component - amtowe_othervehicles        */
/*************************************************/

if (nfa_5 = 1 & nfa_5b_trunc >= 0) then amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_trunc);
 else if (nfa_5 = 1 & nfa_5b_trunc in(-1, -2) & nfa_5b_sr000001 < 0 & nfa_5b_sr000002 < 0
 & nfa_5b_uab_a < 0 & nfa_5b_uab_c < 0) then amtowe_othervehicles = nfa_5b_trunc;
   else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 = nfa_5b_sr000001) then 
   amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_sr000001);
    else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 > nfa_5b_sr000001) then 
    amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000002 - nfa_5b_sr000001)/2) + nfa_5b_sr000001));
     else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 < nfa_5b_sr000001) then 
     amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000001 - nfa_5b_sr000002)/2) + nfa_5b_sr000002));
      else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 0) then amtowe_othervehicles = (amtowe_othervehicles + quartile3);
       else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 1) then amtowe_othervehicles = (amtowe_othervehicles + 50500);
        else if (nfa_5b_uab_a in(-1, -2) | nfa_5b_uab_c in(-1, -2)) then amtowe_othervehicles = -3;

/*******************************/
/* Add components CDEBT        */
/*******************************/

if (amtowe_assetpoorcars1 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars1); 
if (amtowe_assetpoorcars2 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars2); 
if (amtowe_assetpoorcars3 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars3); 
if (amountowe_vehicles1 >= 0) then cdebtc = (cdebtc + amountowe_vehicles1); 
if (amountowe_vehicles2 >= 0) then cdebtc = (cdebtc + amountowe_vehicles2); 
if (amountowe_vehicles3 >= 0) then cdebtc = (cdebtc + amountowe_vehicles3); 
if (amountowe_vehicles4 >= 0) then cdebtc = (cdebtc + amountowe_vehicles4); 
if (amountowe_vehicles5 >= 0) then cdebtc = (cdebtc + amountowe_vehicles5); 
if (amountowe_vehicles6 >= 0) then cdebtc = (cdebtc + amountowe_vehicles6); 
if (amountowe_vehicles9 >= 0) then cdebtc = (cdebtc + amountowe_vehicles9);
if (amtowe_othervehicles >= 0) then cdebtc = (cdebtc + amtowe_othervehicles);

if (amtowe_assetpoorcars1 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars2 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars3 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles1 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles2 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles3 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles4 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles5 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles6 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles9 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_othervehicles in(-1, -2, -3)) then cdebtc = -3;

/****************************/
/* Compute CAR              */
/****************************/
/*************************************************/
/* CAR Component - mktval_assetpoorcars1         */
/*************************************************/

if (sc_12a_01 >= 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_01);
   else if (sc_12a_01 in(-1, -2) & sc_12a_sr000001_01 < 0 & sc_12a_sr000002_01 < 0 
  & sc_12a_uab_a_01 < 0 & sc_12a_uab_b_01 < 0 & sc_12a_uab_c_01 < 0) then mktval_assetpoorcars1 = sc_12a_01;
    else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 = sc_12a_sr000001_01) then 
    mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_sr000001_01);
     else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 > sc_12a_sr000001_01) then 
     mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000002_01 - sc_12a_sr000001_01)/2) + sc_12a_sr000001_01));
      else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 < sc_12a_sr000001_01) then 
      mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000001_01 - sc_12a_sr000002_01)/2) + sc_12a_sr000001_02));
       else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile1);
        else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 1) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile2);
         else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_c_01 = 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile3);
          else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_c_01 = 1) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + 40000);
           else if (sc_12a_uab_a_01 in(-1, -2) | sc_12a_uab_b_01 in(-1, -2) | sc_12a_uab_c_01 in(-1, -2)) then mktval_assetpoorcars1 = -3;

/*************************************************/
/* CAR Component - mktval_assetpoorcars2         */
/*************************************************/

if (sc_12a_02 >= 0) then mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_02);
  else if (sc_12a_02 in(-1, -2) & sc_12a_sr000001_02 < 0 & sc_12a_sr000002_02 < 0 
  & sc_12a_uab_a_02 < 0) then mktval_assetpoorcars2 = sc_12a_02;
   else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 = sc_12a_sr000001_02) then 
   mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_sr000001_02);
    else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 > sc_12a_sr000001_02) then 
    mktval_assetpoorcars2 = (mktval_assetpoorcars2 + (((sc_12a_sr000002_02 - sc_12a_sr000001_02)/2) + sc_12a_sr000001_02));
     else if (sc_12a_sr000001_02 >= 0 & sc_12a_sr000002_02 >= 0 & sc_12a_sr000002_02 < sc_12a_sr000001_02) then 
     mktval_assetpoorcars2 = (mktval_assetpoorcars2 + (((sc_12a_sr000001_02 - sc_12a_sr000002_02)/2) + sc_12a_sr000002_02));
      else if (sc_12a_uab_a_02 in(-1, -2)) then mktval_assetpoorcars2 = -3;

/*************************************************/
/* CAR Component - mktval_assetpoorcars3         */
/*************************************************/

if (sc_12a_03 >= 0) then mktval_assetpoorcars3 = (mktval_assetpoorcars3 + sc_12a_03);
  else if (sc_12a_03 in(-1, -2)) then mktval_assetpoorcars3 = sc_12a_03;

/*************************************************/
/* CAR Component - marketvalue_vehicles1         */
/*************************************************/

if (nfa_4c_trunc_01 >= 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_trunc_01);
 else if (nfa_4c_trunc_01 in(-1, -2) & nfa_4c_sr000001_trunc_01 < 0 & nfa_4c_sr000002_trunc_01 < 0 
 & nfa_4c_uab_a_01 < 0 & nfa_4c_uab_b_01 < 0 & nfa_4c_uab_c_01 < 0) then marketvalue_vehicles1 = nfa_4c_trunc_01;
   else if (nfa_4c_sr000001_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 = nfa_4c_sr000001_trunc_01) then 
   marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_sr000001_trunc_01);
    else if (nfa_4c_sr000001_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 > nfa_4c_sr000001_trunc_01) then 
    marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000002_trunc_01 - nfa_4c_sr000001_trunc_01)/2) + nfa_4c_sr000001_trunc_01));
     else if (nfa_4c_sr000001_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 < nfa_4c_sr000001_trunc_01) then 
     marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000001_trunc_01 - nfa_4c_sr000002_trunc_01)/2) + nfa_4c_sr000002_trunc_01));
      else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile1);
       else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile2);
        else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile3);
         else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + 40000);
          else if (nfa_4c_uab_a_01 in(-1, -2) | nfa_4c_uab_b_01 in(-1, -2) | nfa_4c_uab_c_01 in(-1, -2)) then marketvalue_vehicles1 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles2         */
/*************************************************/

if (nfa_4c_trunc_02 >= 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_trunc_02);
 else if (nfa_4c_trunc_02 in(-1, -2) & nfa_4c_sr000001_trunc_02 < 0 & nfa_4c_sr000002_trunc_02 < 0 
 & nfa_4c_uab_a_02 < 0 & nfa_4c_uab_b_02 < 0 & nfa_4c_uab_c_02 < 0) then marketvalue_vehicles2 = nfa_4c_trunc_02;
   else if (nfa_4c_sr000001_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 = nfa_4c_sr000001_trunc_02) then 
   marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_sr000001_trunc_02);
    else if (nfa_4c_sr000001_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 > nfa_4c_sr000001_trunc_02) then 
    marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000002_trunc_02 - nfa_4c_sr000001_trunc_02)/2) + nfa_4c_sr000001_trunc_02));
     else if (nfa_4c_sr000001_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 < nfa_4c_sr000001_trunc_02) then 
     marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000001_trunc_02 - nfa_4c_sr000002_trunc_02)/2) + nfa_4c_sr000002_trunc_02));
      else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile1);
       else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile2);
        else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile3);
         else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + 38000);
          else if (nfa_4c_uab_a_02 in(-1, -2) | nfa_4c_uab_b_02 in(-1, -2) | nfa_4c_uab_c_02 in(-1, -2)) then marketvalue_vehicles2 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles3         */
/*************************************************/

if (nfa_4c_trunc_03 >= 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_trunc_03);
 else if (nfa_4c_trunc_03 in(-1, -2) & nfa_4c_sr000001_trunc_03 < 0 & nfa_4c_sr000002_trunc_03 < 0 
 & nfa_4c_uab_a_03 < 0 & nfa_4c_uab_b_03 < 0 & nfa_4c_uab_c_03 < 0) then marketvalue_vehicles3 = nfa_4c_trunc_03;
   else if (nfa_4c_sr000001_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 = nfa_4c_sr000001_trunc_03) then 
   marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_sr000001_trunc_03);
    else if (nfa_4c_sr000001_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 > nfa_4c_sr000001_trunc_03) then 
    marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000002_trunc_03 - nfa_4c_sr000001_trunc_03)/2) + nfa_4c_sr000001_trunc_03));
     else if (nfa_4c_sr000001_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 < nfa_4c_sr000001_trunc_03) then 
     marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000001_trunc_03 - nfa_4c_sr000002_trunc_03)/2) + nfa_4c_sr000002_trunc_03));
      else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile1);
       else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile2);
        else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile3);
         else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + 35000);
          else if (nfa_4c_uab_a_03 in(-1, -2) | nfa_4c_uab_b_03 in(-1, -2) | nfa_4c_uab_c_03 in(-1, -2)) then marketvalue_vehicles3 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles4         */
/*************************************************/

if (nfa_4c_trunc_04 >= 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_trunc_04);
 else if (nfa_4c_trunc_04 in(-1, -2) & nfa_4c_sr000001_trunc_04 < 0 & nfa_4c_sr000002_trunc_04 < 0 
 & nfa_4c_uab_a_04 < 0 & nfa_4c_uab_b_04 < 0 & nfa_4c_uab_c_04 < 0) then marketvalue_vehicles4 = nfa_4c_trunc_04;
   else if (nfa_4c_sr000001_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 = nfa_4c_sr000001_trunc_04) then 
   marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_sr000001_trunc_04);
    else if (nfa_4c_sr000001_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 > nfa_4c_sr000001_trunc_04) then 
    marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000002_trunc_04 - nfa_4c_sr000001_trunc_04)/2) + nfa_4c_sr000001_trunc_04));
     else if (nfa_4c_sr000001_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 < nfa_4c_sr000001_trunc_04) then 
     marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000001_trunc_04 - nfa_4c_sr000002_trunc_04)/2) + nfa_4c_sr000002_trunc_04));
      else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_b_04 = 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile1);
       else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_b_04 = 1) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile2);
        else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_c_04 = 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile3);
         else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_c_04 = 1) then marketvalue_vehicles4 = (marketvalue_vehicles4 + 40000);
          else if (nfa_4c_uab_a_04 in(-1, -2) | nfa_4c_uab_b_04 in(-1, -2) | nfa_4c_uab_c_04 in(-1, -2)) then marketvalue_vehicles4 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles5         */
/*************************************************/

if (nfa_4c_trunc_05 >= 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_trunc_05);
 else if (nfa_4c_trunc_05 in(-1, -2) & nfa_4c_sr000001_trunc_05 < 0 & nfa_4c_sr000002_trunc_05 < 0 
 & nfa_4c_uab_a_05 < 0 & nfa_4c_uab_b_05 < 0 & nfa_4c_uab_c_05 < 0) then marketvalue_vehicles5 = nfa_4c_trunc_05;
   else if (nfa_4c_sr000001_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 = nfa_4c_sr000001_trunc_05) then 
   marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_sr000001_trunc_05);
    else if (nfa_4c_sr000001_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 > nfa_4c_sr000001_trunc_05) then 
    marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000002_trunc_05 - nfa_4c_sr000001_trunc_05)/2) + nfa_4c_sr000001_trunc_05));
     else if (nfa_4c_sr000001_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 < nfa_4c_sr000001_trunc_05) then 
     marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000001_trunc_05 - nfa_4c_sr000002_trunc_05)/2) + nfa_4c_sr000002_trunc_05));
      else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_b_05 = 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile1);
       else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_b_05 = 1) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile2);
        else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_c_05 = 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile3);
         else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_c_05 = 1) then marketvalue_vehicles5 = (marketvalue_vehicles5 + 50000);
          else if (nfa_4c_uab_a_05 in(-1, -2) | nfa_4c_uab_b_05 in(-1, -2) | nfa_4c_uab_c_05 in(-1, -2)) then marketvalue_vehicles5 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles6         */
/*************************************************/

if (nfa_4c_trunc_06 >= 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_trunc_06);
 else if (nfa_4c_trunc_06 in(-1, -2) & nfa_4c_sr000001_trunc_06 < 0 & nfa_4c_sr000002_trunc_06 < 0 
 & nfa_4c_uab_a_06 < 0 & nfa_4c_uab_b_06 < 0 & nfa_4c_uab_c_06 < 0) then marketvalue_vehicles6 = nfa_4c_trunc_06;
   else if (nfa_4c_sr000001_trunc_06 >= 0 & nfa_4c_sr000002_trunc_06 >= 0 & nfa_4c_sr000002_trunc_06 = nfa_4c_sr000001_trunc_06) then 
   marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_sr000001_trunc_06);
    else if (nfa_4c_sr000001_trunc_06 >= 0 & nfa_4c_sr000002_trunc_06 >= 0 & nfa_4c_sr000002_trunc_06 > nfa_4c_sr000001_trunc_06) then 
    marketvalue_vehicles6 = (marketvalue_vehicles6 + (((nfa_4c_sr000002_trunc_06 - nfa_4c_sr000001_trunc_06)/2) + nfa_4c_sr000001_trunc_06));
     else if (nfa_4c_sr000001_trunc_06 >= 0 & nfa_4c_sr000002_trunc_06 >= 0 & nfa_4c_sr000002_trunc_06 < nfa_4c_sr000001_trunc_06) then 
     marketvalue_vehicles6 = (marketvalue_vehicles6 + (((nfa_4c_sr000001_trunc_06 - nfa_4c_sr000002_trunc_06)/2) + nfa_4c_sr000002_trunc_06));
      else if (nfa_4c_trunc_06 in(-1, -2, -4) & nfa_4c_uab_b_06 = 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + quartile1);
       else if (nfa_4c_trunc_06 in(-1, -2, -4) & nfa_4c_uab_b_06 = 1) then marketvalue_vehicles6 = (marketvalue_vehicles6 + quartile2);
        else if (nfa_4c_trunc_06 in(-1, -2, -4) & nfa_4c_uab_c_06 = 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + quartile3);
         else if (nfa_4c_trunc_06 in(-1, -2, -4) & nfa_4c_uab_c_06 = 1) then marketvalue_vehicles6 = (marketvalue_vehicles6 + 35000);
          else if (nfa_4c_uab_a_06 in(-1, -2) | nfa_4c_uab_b_06 in(-1, -2) | nfa_4c_uab_c_06 in(-1, -2)) then marketvalue_vehicles6 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles7         */
/*************************************************/

if (nfa_4c_trunc_07 >= 0) then marketvalue_vehicles7 = (marketvalue_vehicles7 + nfa_4c_trunc_07);
 else if (nfa_4c_trunc_07 in(-1, -2) & nfa_4c_sr000001_trunc_07 < 0 & nfa_4c_sr000002_trunc_07 < 0 
 & nfa_4c_uab_a_07 < 0 & nfa_4c_uab_b_07 < 0) then marketvalue_vehicles7 = nfa_4c_trunc_07;
   else if (nfa_4c_sr000001_trunc_07 >= 0 & nfa_4c_sr000002_trunc_07 >= 0 & nfa_4c_sr000002_trunc_07 = nfa_4c_sr000001_trunc_07) then 
   marketvalue_vehicles7 = (marketvalue_vehicles7 + nfa_4c_sr000001_trunc_07);
    else if (nfa_4c_sr000001_trunc_07 >= 0 & nfa_4c_sr000002_trunc_07 >= 0 & nfa_4c_sr000002_trunc_07 > nfa_4c_sr000001_trunc_07) then 
    marketvalue_vehicles7 = (marketvalue_vehicles7 + (((nfa_4c_sr000002_trunc_07 - nfa_4c_sr000001_trunc_07)/2) + nfa_4c_sr000001_trunc_07));
     else if (nfa_4c_sr000001_trunc_07 >= 0 & nfa_4c_sr000002_trunc_07 >= 0 & nfa_4c_sr000002_trunc_07 < nfa_4c_sr000001_trunc_07) then 
     marketvalue_vehicles7 = (marketvalue_vehicles7 + (((nfa_4c_sr000001_trunc_07 - nfa_4c_sr000002_trunc_07)/2) + nfa_4c_sr000002_trunc_07));
      else if (nfa_4c_trunc_07 in(-1, -2, -4) & nfa_4c_uab_b_07 = 0) then marketvalue_vehicles7 = (marketvalue_vehicles7 + quartile1);
       else if (nfa_4c_trunc_07 in(-1, -2, -4) & nfa_4c_uab_b_07 = 1) then marketvalue_vehicles7 = (marketvalue_vehicles7 + quartile2);
        else if (nfa_4c_uab_a_07 in(-1, -2) | nfa_4c_uab_b_07 in(-1, -2)) then marketvalue_vehicles7 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles8         */
/*************************************************/

if (nfa_4c_trunc_08 >= 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + nfa_4c_trunc_08);
 else if (nfa_4c_trunc_08 in(-1, -2) & nfa_4c_sr000001_trunc_08 < 0 & nfa_4c_sr000002_trunc_08 < 0 
 & nfa_4c_uab_a_08 < 0 & nfa_4c_uab_b_08 < 0) then marketvalue_vehicles8 = nfa_4c_trunc_08;
   else if (nfa_4c_sr000001_trunc_08 >= 0 & nfa_4c_sr000002_trunc_08 >= 0 & nfa_4c_sr000002_trunc_08 = nfa_4c_sr000001_trunc_08) then 
   marketvalue_vehicles8 = (marketvalue_vehicles8 + nfa_4c_sr000001_trunc_08);
    else if (nfa_4c_sr000001_trunc_08 >= 0 & nfa_4c_sr000002_trunc_08 >= 0 & nfa_4c_sr000002_trunc_08 > nfa_4c_sr000001_trunc_08) then 
    marketvalue_vehicles8 = (marketvalue_vehicles8 + (((nfa_4c_sr000002_trunc_08 - nfa_4c_sr000001_trunc_08)/2) + nfa_4c_sr000001_trunc_08));
     else if (nfa_4c_sr000001_trunc_08 >= 0 & nfa_4c_sr000002_trunc_08 >= 0 & nfa_4c_sr000002_trunc_08 < nfa_4c_sr000001_trunc_08) then 
     marketvalue_vehicles8 = (marketvalue_vehicles8 + (((nfa_4c_sr000001_trunc_08 - nfa_4c_sr000002_trunc_08)/2) + nfa_4c_sr000002_trunc_08));
      else if (nfa_4c_trunc_08 in(-1, -2, -4) & nfa_4c_uab_b_08 = 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + quartile1);
       else if (nfa_4c_trunc_08 in(-1, -2, -4) & nfa_4c_uab_b_08 = 1) then marketvalue_vehicles8 = (marketvalue_vehicles8 + quartile2);
        else if (nfa_4c_uab_a_08 in(-1, -2) | nfa_4c_uab_b_08 in(-1, -2)) then marketvalue_vehicles8 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles9         */
/*************************************************/

if (nfa_4c_trunc_09 >= 0) then marketvalue_vehicles9 = (marketvalue_vehicles9 + nfa_4c_trunc_09);
 else if (nfa_4c_trunc_09 in(-1, -2) & nfa_4c_uab_a_09 < 0) then marketvalue_vehicles9 = nfa_4c_trunc_09;
  else if (nfa_4c_uab_a_09 in(-1, -2)) then marketvalue_vehicles9 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles10        */
/*************************************************/

if (nfa_4c_trunc_10 >= 0) then marketvalue_vehicles10 = (marketvalue_vehicles10 + nfa_4c_trunc_10);
 else if (nfa_4c_trunc_10 in(-1, -2) & nfa_4c_uab_a_10 < 0) then marketvalue_vehicles10 = nfa_4c_trunc_10;
  else if (nfa_4c_uab_a_10 in(-1, -2)) then marketvalue_vehicles10 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles11        */
/*************************************************/

if (nfa_4c_trunc_11 >= 0) then marketvalue_vehicles11 = (marketvalue_vehicles11 + nfa_4c_trunc_11);
 else if (nfa_4c_trunc_11 in(-1, -2) & nfa_4c_uab_a_11 < 0) then marketvalue_vehicles11 = nfa_4c_trunc_11;
  else if (nfa_4c_uab_a_11 in(-1, -2)) then marketvalue_vehicles11 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles12        */
/*************************************************/

if (nfa_4c_trunc_12 >= 0) then marketvalue_vehicles12 = (marketvalue_vehicles12 + nfa_4c_trunc_12);
 else if (nfa_4c_trunc_12 in(-1, -2) & nfa_4c_uab_a_12 < 0) then marketvalue_vehicles12 = nfa_4c_trunc_12;
  else if (nfa_4c_uab_a_12 in(-1, -2)) then marketvalue_vehicles12 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles13        */
/*************************************************/

if (nfa_4c_trunc_13 >= 0) then marketvalue_vehicles13 = (marketvalue_vehicles13 + nfa_4c_trunc_13);
 else if (nfa_4c_trunc_13 in(-1, -2) & nfa_4c_uab_a_13 < 0) then marketvalue_vehicles13 = nfa_4c_trunc_13;
  else if (nfa_4c_uab_a_13 in(-1, -2)) then marketvalue_vehicles13 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles14        */
/*************************************************/

if (nfa_4c_trunc_14 >= 0) then marketvalue_vehicles14 = (marketvalue_vehicles14 + nfa_4c_trunc_14);
 else if (nfa_4c_trunc_14 in(-1, -2) & nfa_4c_uab_a_14 < 0) then marketvalue_vehicles14 = nfa_4c_trunc_14;
  else if (nfa_4c_uab_a_14 in(-1, -2)) then marketvalue_vehicles14 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles15        */
/*************************************************/

if (nfa_4c_trunc_15 >= 0) then marketvalue_vehicles15 = (marketvalue_vehicles15 + nfa_4c_trunc_15);
 else if (nfa_4c_trunc_15 in(-1, -2) & nfa_4c_uab_a_15 < 0) then marketvalue_vehicles15 = nfa_4c_trunc_15;
  else if (nfa_4c_uab_a_15 in(-1, -2)) then marketvalue_vehicles15 = -3;

/*************************************************/
/* CAR Component - marketvalue_vehicles16        */
/*************************************************/

if (nfa_4c_trunc_16 >= 0) then marketvalue_vehicles16 = (marketvalue_vehicles16 + nfa_4c_trunc_16);
 else if (nfa_4c_trunc_16 in(-1, -2)) then marketvalue_vehicles16 = nfa_4c_trunc_16;

/*************************************************/
/* CAR Component - marketvalue_vehicles17        */
/*************************************************/

if (nfa_4c_trunc_17 >= 0) then marketvalue_vehicles17 = (marketvalue_vehicles17 + nfa_4c_trunc_17);
 else if (nfa_4c_trunc_17 in(-1, -2)) then marketvalue_vehicles17 = nfa_4c_trunc_17;

/*************************************************/
/* CAR Component - mktval_othervehicles          */
/*************************************************/

if (nfa_5 = 1 & nfa_5c_trunc >= 0) then mktval_othervehicles = (mktval_othervehicles + nfa_5c_trunc);
 else if (nfa_5 = 1 & nfa_5c_ref_1 = 1 & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
 & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = -1;
  else if (nfa_5 = 1 & nfa_5c_trunc in(-1, -2) & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
  & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = nfa_5c_trunc;
    else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 = nfa_5c_sr000001) then 
    mktval_othervehicles = (mktval_othervehicles + nfa_5c_sr000001);
     else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 > nfa_5c_sr000001) then 
     mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000002 - nfa_5c_sr000001)/2) + nfa_5c_sr000001));
      else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 < nfa_5c_sr000001) then 
      mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000001 - nfa_5c_sr000002)/2) + nfa_5c_sr000002));
       else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 0) then mktval_othervehicles = (mktval_othervehicles + quartile1);
        else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 1) then mktval_othervehicles = (mktval_othervehicles + quartile2);
         else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 0) then mktval_othervehicles = (mktval_othervehicles + quartile3);
          else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 1) then mktval_othervehicles = (mktval_othervehicles + 50000);
           else if (nfa_5c_uab_a in(-1, -2) | nfa_5c_uab_b in(-1, -2) | nfa_5c_uab_c in(-1, -2)) then mktval_othervehicles = -3;

/*******************************/
/* Add components CAR          */
/*******************************/

if (mktval_assetpoorcars1 >= 0) then carc = (carc + mktval_assetpoorcars1); 
if (mktval_assetpoorcars2 >= 0) then carc = (carc + mktval_assetpoorcars2); 
if (mktval_assetpoorcars3 >= 0) then carc = (carc + mktval_assetpoorcars3); 
if (marketvalue_vehicles1 >= 0) then carc = (carc + marketvalue_vehicles1); 
if (marketvalue_vehicles2 >= 0) then carc = (carc + marketvalue_vehicles2); 
if (marketvalue_vehicles3 >= 0) then carc = (carc + marketvalue_vehicles3); 
if (marketvalue_vehicles4 >= 0) then carc = (carc + marketvalue_vehicles4); 
if (marketvalue_vehicles5 >= 0) then carc = (carc + marketvalue_vehicles5); 
if (marketvalue_vehicles6 >= 0) then carc = (carc + marketvalue_vehicles6); 
if (marketvalue_vehicles7 >= 0) then carc = (carc + marketvalue_vehicles7); 
if (marketvalue_vehicles8 >= 0) then carc = (carc + marketvalue_vehicles8); 
if (marketvalue_vehicles9 >= 0) then carc = (carc + marketvalue_vehicles9); 
if (marketvalue_vehicles10 >= 0) then carc = (carc + marketvalue_vehicles10); 
if (marketvalue_vehicles11 >= 0) then carc = (carc + marketvalue_vehicles11); 
if (marketvalue_vehicles12 >= 0) then carc = (carc + marketvalue_vehicles12); 
if (marketvalue_vehicles13 >= 0) then carc = (carc + marketvalue_vehicles13); 
if (marketvalue_vehicles14 >= 0) then carc = (carc + marketvalue_vehicles14); 
if (marketvalue_vehicles15 >= 0) then carc = (carc + marketvalue_vehicles15); 
if (marketvalue_vehicles16 >= 0) then carc = (carc + marketvalue_vehicles16); 
if (marketvalue_vehicles17 >= 0) then carc = (carc + marketvalue_vehicles17); 
if (mktval_othervehicles >= 0) then carc = (carc + mktval_othervehicles); 

if (mktval_assetpoorcars1 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars2 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars3 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles1 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles2 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles3 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles4 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles5 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles6 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles7 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles8 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles9 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles10 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles11 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles12 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles13 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles14 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles15 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles16 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles17 in(-1, -2, -3)) then carc = -3; 
else if (mktval_othervehicles in(-1, -2, -3)) then carc = -3; 

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (irac   >= 0) then tnfw_trunc = (tnfw_trunc + irac  );
if (a401kc >= 0) then tnfw_trunc = (tnfw_trunc + a401kc);
if (cdsc   >= 0) then tnfw_trunc = (tnfw_trunc + cdsc  );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (irac   in(-1, -2, -3)) then tnfw_trunc = -3;
if (a401kc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdsc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/****************************************/
/* APPLY TOPCODE TO TNFW_TRUNC FOR 2012 */
/****************************************/

if (tnfw_trunc >  2060328) then tnfw_trunc = 3749941;

tnfw_trunc = round(tnfw_trunc);

/***************************************************************/
/* TNFW_TRUNC - adjust for partially missing range estimates   */
/***************************************************************/

if (tnfw_trunc ~= -3 & 
    ((nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 in(-1, -2)) | (nfa_1a_sr000001 in(-1, -2) & nfa_1a_sr000002 >= 0)
  | (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 in(-1, -2)) | (nfa_1b_sr000001 in(-1, -2) & nfa_1b_sr000002 >= 0) 
  | (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 in(-1, -2)) | (nfa_1c_sr000001 in(-1, -2) & nfa_1c_sr000002 >= 0)
  | (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 in(-1, -2)) | (nfa_2a_sr000001 in(-1, -2) & nfa_2a_sr000002 >= 0)
  | (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 in(-1, -2)) | (nfa_2b_sr000001 in(-1, -2) & nfa_2b_sr000002 >= 0) 
  | (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 in(-1, -2)) | (nfa_2c_sr000001 in(-1, -2) & nfa_2c_sr000002 >= 0) 
  | (fa_1a_sr000001 >= 0 & fa_1a_sr000002 in(-1, -2)) | (fa_1a_sr000001 in(-1, -2) & fa_1a_sr000002 >= 0)
  | (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 in(-1, -2)) | (fa_8d_sr000001_01 in(-1, -2) & fa_8d_sr000002_01 >= 0)
  | (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 in(-1, -2)) | (fa_8d_sr000001_02 in(-1, -2) & fa_8d_sr000002_02 >= 0)
  | (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 in(-1, -2)) | (fa_8d_sr000001_03 in(-1, -2) & fa_8d_sr000002_03 >= 0)
  | (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 in(-1, -2)) | (fa_8d_sr000001_04 in(-1, -2) & fa_8d_sr000002_04 >= 0)
  | (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 in(-1, -2)) | (fa_8d_sr000001_05 in(-1, -2) & fa_8d_sr000002_05 >= 0)
  | (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 in(-1, -2)) | (fa_8d_sr000001_06 in(-1, -2) & fa_8d_sr000002_06 >= 0)
  | (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 in(-1, -2)) | (fa_8d_sr000001_07 in(-1, -2) & fa_8d_sr000002_07 >= 0)
  | (fa_6e_sr000001 >= 0 & fa_6e_sr000002 in(-1, -2)) | (fa_6e_sr000001 in(-1, -2) & fa_6e_sr000002 >= 0)
  | (fa_7c_sr000001 >= 0 & fa_7c_sr000002 in(-1, -2)) | (fa_7c_sr000001 in(-1, -2) & fa_7c_sr000002 >= 0)
  | (fa_2a_sr000001 >= 0 & fa_2a_sr000002 in(-1, -2)) | (fa_2a_sr000001 in(-1, -2) & fa_2a_sr000002 >= 0)
  | (fa_3a_sr000001 >= 0 & fa_3a_sr000002 in(-1, -2)) | (fa_3a_sr000001 in(-1, -2) & fa_3a_sr000002 >= 0)
  | (fa_4a_sr000001 >= 0 & fa_4a_sr000002 in(-1, -2)) | (fa_4a_sr000001 in(-1, -2) & fa_4a_sr000002 >= 0)
  | (fa_5a_sr000001 >= 0 & fa_5a_sr000002 in(-1, -2)) | (fa_5a_sr000001 in(-1, -2) & fa_5a_sr000002 >= 0)
  | (fa_9a_sr000001 >= 0 & fa_9a_sr000002 in(-1, -2)) | (fa_9a_sr000001 in(-1, -2) & fa_9a_sr000002 >= 0)
  | (fa_10a_sr000001 >= 0 & fa_10a_sr000002 in(-1, -2)) | (fa_10a_sr000001 in(-1, -2) & fa_10a_sr000002 >= 0)
  | (fa_11a_sr000001 >= 0 & fa_11a_sr000002 in(-1, -2)) | (fa_11a_sr000001 in(-1, -2) & fa_11a_sr000002 >= 0)
  | (q13_131_sr000001 >= 0 & q13_131_sr000002 in(-1, -2)) | (q13_131_sr000001 in(-1, -2) & q13_131_sr000002 >= 0)
  | (q13_132_sr000001 >= 0 & q13_132_sr000002 in(-1, -2)) | (q13_132_sr000001 in(-1, -2) & q13_132_sr000002 >= 0)
  | (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 in(-1, -2)) | (sc_12b_sr000001_01 in(-1, -2) & sc_12b_sr000002_01 >= 0)
  | (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 in(-1, -2)) | (nfa_4f_sr000001_01 in(-1, -2) & nfa_4f_sr000002_01 >= 0)
  | (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 in(-1, -2)) | (nfa_4f_sr000001_02 in(-1, -2) & nfa_4f_sr000002_02 >= 0)
  | (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 in(-1, -2)) | (nfa_4f_sr000001_03 in(-1, -2) & nfa_4f_sr000002_03 >= 0)
  | (nfa_4f_sr000001_06 >= 0 & nfa_4f_sr000002_06 in(-1, -2)) | (nfa_4f_sr000001_06 in(-1, -2) & nfa_4f_sr000002_06 >= 0)
  | (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 in(-1, -2)) | (sc_12a_sr000001_01 in(-1, -2) & sc_12a_sr000002_01 >= 0)
  | (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 in(-1, -2)) | (nfa_4c_sr000001_01 in(-1, -2) & nfa_4c_sr000002_01 >= 0)
  | (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 in(-1, -2)) | (nfa_4c_sr000001_02 in(-1, -2) & nfa_4c_sr000002_02 >= 0)
  | (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 in(-1, -2)) | (nfa_4c_sr000001_03 in(-1, -2) & nfa_4c_sr000002_03 >= 0)
  | (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 in(-1, -2)) | (nfa_4c_sr000001_04 in(-1, -2) & nfa_4c_sr000002_04 >= 0)
  | (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 in(-1, -2)) | (nfa_4c_sr000001_05 in(-1, -2) & nfa_4c_sr000002_05 >= 0)
  | (nfa_4c_sr000001_06 >= 0 & nfa_4c_sr000002_06 in(-1, -2)) | (nfa_4c_sr000001_06 in(-1, -2) & nfa_4c_sr000002_06 >= 0)
  | (nfa_4c_sr000001_07 >= 0 & nfa_4c_sr000002_07 in(-1, -2)) | (nfa_4c_sr000001_07 in(-1, -2) & nfa_4c_sr000002_07 >= 0)
  | (nfa_4c_sr000001_08 >= 0 & nfa_4c_sr000002_08 in(-1, -2)) | (nfa_4c_sr000001_08 in(-1, -2) & nfa_4c_sr000002_08 >= 0)
  | (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 in(-1, -2)) | (nfa_5c_sr000001 in(-1, -2) & nfa_5c_sr000002 >= 0)
  | (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 in(-1, -2)) | (nfa_6e_sr000001 in(-1, -2) & nfa_6e_sr000002 >= 0)))
  then tnfw_trunc = -3;
end;

2016 TNFW_TRUNC variable creation



/***************************************************/
/* Compute dollar amt for dollars & cents vars     */
/***************************************************/

nfa_7d_truncc = nfa_7d_trunc;
if (nfa_7d_trunc > 0) then nfa_7d_truncc = (nfa_7d_trunc/100);

/***************************************************/
/* Compute dynamic QUARTILE VALUES for estimates   */
/***************************************************/

array quartileqs (i) quartile1 quartile2 quartile3 quartile4;

do i = 1 to 4;
 quartileqs = 0;
end;

if (symbol_entry_othhh = 7200) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((7200-5000)/2));
  quartile3 = (7200 + ((30000-7200)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;
else if (symbol_entry_othhh = 13000) then do;
  quartile1 = (5000/2);
  quartile2 = (5000 + ((13000-5000)/2));
  quartile3 = (13000 + ((30000-13000)/2));
  quartile4 = 30000; /* Note: Use median of actual values > 30000 where possible.  Otherwise set to 30000 */
end;

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS    */
/***************************************************/

array assetsc (i)      homec mortc pdebtc cashc irac a401kc cdsc stockc trustc bizc 
                       bdebtc cdebtc carc posesc odebtc tnfw_trunc
                       collections items ccdebt studentloan childstudentloan owebusiness otherdebt
                       solebiz farm_1_value1 farm_2_value1 business_1_value1 business_2_value1
                       business_3_value1 business_4_value1 realestate_1_value1 
                       realestate_2_value1 realestate_3_value1 realestate_4_value1 realestate_5_value1 
                       farm_1_value farm_2_value business_1_value business_2_value
                       business_3_value business_4_value realestate_1_value 
                       realestate_2_value realestate_3_value realestate_4_value realestate_5_value 
                       debtbiz farm_1_debt1 farm_2_debt1 business_1_debt1 business_2_debt1
                       business_3_debt1 business_4_debt1 realestate_1_debt1 
                       realestate_2_debt1 realestate_3_debt1 realestate_4_debt1 realestate_5_debt1 
                       farm_1_debt farm_2_debt business_1_debt business_2_debt
                       business_3_debt business_4_debt realestate_1_debt
                       govbonds mutual lifeinsure shares corpbond moneyowedtor
                       home1 secondhome mort1 secondmort pdebt1 secondpdebt
                       ira1 ira2 ira3 ira4 ira5 ira6 ira7 r_401k sp_401k
                       amtowe_assetpoorcars1 amtowe_assetpoorcars2
                       amountowe_vehicles1 amountowe_vehicles2 amountowe_vehicles3 amountowe_vehicles4
                       amountowe_vehicles5 amountowe_vehicles6 amountowe_vehicles8 amountowe_vehicles9 amtowe_othervehicles
                       mktval_assetpoorcars1 mktval_assetpoorcars2
                       marketvalue_vehicles1 marketvalue_vehicles2 marketvalue_vehicles3 marketvalue_vehicles4
                       marketvalue_vehicles5 marketvalue_vehicles6 marketvalue_vehicles7 marketvalue_vehicles8
                       marketvalue_vehicles9 marketvalue_vehicles10 marketvalue_vehicles11 marketvalue_vehicles12 
                       marketvalue_vehicles13 marketvalue_vehicles14 marketvalue_vehicles15 marketvalue_vehicles16 
                       marketvalue_vehicles17 marketvalue_vehicles18 marketvalue_vehicles19 marketvalue_vehicles20 
                       mktval_othervehicles;
                   
                       
do i = 1 to 120;
 if (sampweight = 0) then assetsc = -5;
  else if (sampweight > 0) then assetsc = 0;
end;

/****************************/
/* Compute POSES            */
/****************************/
/************************************************/
/* POSES Component - collections                */
/************************************************/

if (nfa_6a = 1 & nfa_6e_trunc >= 0) then collections = (collections + nfa_6e_trunc);
 else if (nfa_6a = 1 & nfa_6e_ref_1 = 1 & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0 
 & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = -1;
  else if (nfa_6a = 1 & nfa_6e_trunc in(-1, -2) & nfa_6e_sr000001 < 0 & nfa_6e_sr000002 < 0 
  & nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = nfa_6e_trunc;
    else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 = nfa_6e_sr000001) then 
    collections = (collections + nfa_6e_sr000001);
     else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 > nfa_6e_sr000001) then 
     collections = (collections + (((nfa_6e_sr000002 - nfa_6e_sr000001)/2) + nfa_6e_sr000001));
      else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 >= 0 & nfa_6e_sr000002 < nfa_6e_sr000001) then 
      collections = (collections + (((nfa_6e_sr000001 - nfa_6e_sr000002)/2) + nfa_6e_sr000002));
       else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 0) then collections = (collections + quartile1);
        else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 1) then collections = (collections + quartile2);
         else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 0) then collections = (collections + quartile3);
          else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 1) then collections = (collections + 75000);
           else if (nfa_6e_uab_a in(-1, -2) | nfa_6e_uab_b in(-1, -2) | nfa_6e_uab_c in(-1, -2)) then collections = -3;
          
/************************************************/
/* POSES Component - items                      */
/************************************************/

if (nfa_7 = 1 & nfa_7d_truncc >= 0) then items = (items + nfa_7d_truncc);
 else if (nfa_7 = 1 & nfa_7d_ref_1 = 1 & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = -1;
  else if (nfa_7 = 1 & nfa_7d_truncc in(-1, -2) & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = nfa_7d_truncc;
   else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 0) then items = (items + quartile1);
    else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_b = 1) then items = (items + quartile2);
     else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 0) then items = (items + quartile3);
      else if (nfa_7d_truncc in(-1, -2, -4) & nfa_7d_uab_c = 1) then items = (items + 55500);
       else if (nfa_7d_uab_a in(-1, -2) | nfa_7d_uab_b in(-1, -2) | nfa_7d_uab_c in(-1, -2)) then items = -3;

/*******************************/
/* Add components POSES        */
/*******************************/

if (collections >= 0) then posesc = (posesc + collections); 
if (items >= 0) then posesc = (posesc + items);
if (collections in(-1, -2, -3)) then posesc = -3;
else if (items in(-1, -2, -3)) then posesc = -3;

/****************************/
/* Compute ODEBT            */
/****************************/

/************************************************/
/* ODEBT Component - ccdebt                     */
/************************************************/

if (debt_1 = 1 & debt_1a >= 0) then ccdebt = (ccdebt + debt_1a);
 else if (debt_1 = 1 & debt_1a_ref_1 = 1 & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0 
 & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = -1;
  else if (debt_1 = 1 & debt_1a in(-1, -2) & debt_1a_sr000001 < 0 & debt_1a_sr000002 < 0 
  & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = debt_1a;
    else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 = debt_1a_sr000001) then 
    ccdebt = (ccdebt + debt_1a_sr000001);
     else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 > debt_1a_sr000001) then 
     ccdebt = (ccdebt + (((debt_1a_sr000002 - debt_1a_sr000001)/2) + debt_1a_sr000001));
      else if (debt_1a_sr000001 >= 0 & debt_1a_sr000002 >= 0 & debt_1a_sr000002 < debt_1a_sr000001) then 
      ccdebt = (ccdebt + (((debt_1a_sr000001 - debt_1a_sr000002)/2) + debt_1a_sr000002));
       else if (debt_1a in(-1, -2, -4) & debt_1a_uab_b = 0) then ccdebt = (ccdebt + quartile1);
        else if (debt_1a in(-1, -2, -4) & debt_1a_uab_b = 1) then ccdebt = (ccdebt + quartile2);
         else if (debt_1a in(-1, -2, -4) & debt_1a_uab_c = 0) then ccdebt = (ccdebt + quartile3);
          else if (debt_1a in(-1, -2, -4) & debt_1a_uab_c = 1) then ccdebt = (ccdebt + 41000);
           else if (debt_1a_uab_a in(-1, -2) | debt_1a_uab_b in(-1, -2) | debt_1a_uab_c in(-1, -2)) then ccdebt = -3;

/************************************************/
/* ODEBT Component - studentloan                */
/************************************************/

if (debt_2 = 1 & debt_2a >= 0) then studentloan = (studentloan + debt_2a);
 else if (debt_2 = 1 & debt_2a_ref_1 = 1 & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 
 & debt_2a_uab_c < 0) then studentloan = -1;
  else if (debt_2 = 1 & debt_2a in(-1, -2) & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 
  & debt_2a_uab_c < 0) then studentloan = debt_2a;
   else if (debt_2a in(-1, -2, -4) & debt_2a_uab_b = 0) then studentloan = (studentloan + quartile1);
    else if (debt_2a in(-1, -2, -4) & debt_2a_uab_b = 1) then studentloan = (studentloan + quartile2);
     else if (debt_2a in(-1, -2, -4) & debt_2a_uab_c = 0) then studentloan = (studentloan + quartile3);
      else if (debt_2a in(-1, -2, -4) & debt_2a_uab_c = 1) then studentloan = (studentloan + 60000);
       else if (debt_2a_uab_a in(-1, -2) | debt_2a_uab_b in(-1, -2) | debt_2a_uab_c in(-1, -2)) then studentloan = -3;

/************************************************/
/* ODEBT Component - childstudentloan           */
/************************************************/

if (debt_2c = 1 & debt_2d >= 0) then childstudentloan = (childstudentloan + debt_2d);
 else if (debt_2c = 1 & debt_2d_ref_1 = 1 & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 
 & debt_2d_uab_c < 0) then childstudentloan = -1;
  else if (debt_2c = 1 & debt_2d in(-1, -2) & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 
  & debt_2d_uab_c < 0) then childstudentloan = debt_2d;
   else if (debt_2d in(-1, -2, -4) & debt_2d_uab_b = 0) then childstudentloan = (childstudentloan + quartile1);
    else if (debt_2d in(-1, -2, -4) & debt_2d_uab_b = 1) then childstudentloan = (childstudentloan + quartile2);
     else if (debt_2d in(-1, -2, -4) & debt_2d_uab_c = 0) then childstudentloan = (childstudentloan + quartile3);
      else if (debt_2d in(-1, -2, -4) & debt_2d_uab_c = 1) then childstudentloan = (childstudentloan + 60000);
       else if (debt_2d_uab_a in(-1, -2) | debt_2d_uab_b in(-1, -2) | debt_2d_uab_c in(-1, -2)) then childstudentloan = -3;

/************************************************/
/* ODEBT Component - owebusiness                */
/************************************************/

if (debt_3 = 1 & debt_3a_trunc >= 0) then owebusiness = (owebusiness + debt_3a_trunc);
 else if (debt_3 = 1 & debt_3a_ref_1 = 1 & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 
 & debt_3a_uab_c < 0) then owebusiness = -1;
  else if (debt_3 = 1 & debt_3a_trunc in(-1, -2) & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 
  & debt_3a_uab_c < 0) then owebusiness = debt_3a_trunc;
   else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 0) then owebusiness = (owebusiness + quartile1);
    else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 1) then owebusiness = (owebusiness + quartile2);
     else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 0) then owebusiness = (owebusiness + quartile3);
      else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 1) then owebusiness = (owebusiness + 60000);
       else if (debt_3a_uab_a in(-1, -2) | debt_3a_uab_b in(-1, -2) | debt_3a_uab_c in(-1, -2)) then owebusiness = -3;

/************************************************/
/* ODEBT Component - otherdebt                  */
/************************************************/

if (debt_4 = 1 & debt_4a_trunc >= 0) then otherdebt = (otherdebt + debt_4a_trunc);
 else if (debt_4 = 1 & debt_4a_ref_1 = 1 & debt_4a_uab_a < 0 & debt_4a_uab_b < 0) then otherdebt = -1;
  else if (debt_4 = 1 & debt_4a_trunc in(-1, -2) & debt_4a_uab_a < 0 & debt_4a_uab_b < 0) then otherdebt = debt_4a_trunc;
   else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 0) then otherdebt = (otherdebt + quartile1);
    else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 1) then otherdebt = (otherdebt + quartile2);
      else if (debt_4a_uab_a in(-1, -2) | debt_4a_uab_b in(-1, -2)) then otherdebt = -3;

/*******************************/
/* Add components ODEBT        */
/*******************************/

if (ccdebt >= 0) then odebtc = (odebtc + ccdebt); 
if (studentloan >= 0) then odebtc = (odebtc + studentloan);
if (childstudentloan >= 0) then odebtc = (odebtc + childstudentloan);
if (owebusiness >= 0) then odebtc = (odebtc + owebusiness);
if (otherdebt >= 0) then odebtc = (odebtc + otherdebt);
if (ccdebt in(-1, -2, -3)) then odebtc = -3;
else if (studentloan in(-1, -2, -3)) then odebtc = -3;
else if (childstudentloan in(-1, -2, -3)) then odebtc = -3;
else if (owebusiness in(-1, -2, -3)) then odebtc = -3;
else if (otherdebt in(-1, -2, -3)) then odebtc = -3;

/****************************/
/* Compute BIZ              */
/****************************/

/************************************************/
/* BIZ Component - solebiz                      */
/************************************************/

if (q13_131_trunc >= 0) then solebiz = (solebiz + q13_131_trunc);
 else if (q13_131_trunc = 1 & q13_131_ref_1 = 1 & q13_131_sr000001 < 0 & q13_131_sr000002 < 0 
 & q13_131_uab_a < 0 & q13_131_uab_c < 0) then solebiz = -1;
  else if (q13_131_trunc in(-1, -2) & q13_131_sr000001 < 0 & q13_131_sr000002 < 0 
  & q13_131_uab_a < 0 & q13_131_uab_c < 0) then solebiz = q13_131_trunc;
    else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 = q13_131_sr000001) then 
    solebiz = (solebiz + q13_131_sr000001);
     else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 > q13_131_sr000001) then 
     solebiz = (solebiz + (((q13_131_sr000002 - q13_131_sr000001)/2) + q13_131_sr000001));
      else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 < q13_131_sr000001) then 
      solebiz = (solebiz + (((q13_131_sr000001 - q13_131_sr000002)/2) + q13_131_sr000002));
       else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 0) then solebiz = (solebiz + quartile3);
        else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 1) then solebiz = (solebiz + 350000);
         else if (q13_131_uab_a in(-1, -2) | q13_131_uab_c in(-1, -2)) then solebiz = -3;

/********************************************************************************************************/
/* BIZ Components - farm_#_value, business_#_value, realestate_#_value & percentage ownership           */
/********************************************************************************************************/

if (q13_fjt_11_trunc_01 > -4) then farm_1_value1 = q13_fjt_11_trunc_01;
if (q13_fjt_11_trunc_02 > -4) then farm_2_value1 = q13_fjt_11_trunc_02;
if (q13_bppjt_11_trunc_01 > -4) then business_1_value1 = q13_bppjt_11_trunc_01;
if (q13_bppjt_11_trunc_02 > -4) then business_2_value1 = q13_bppjt_11_trunc_02;
if (q13_bppjt_11_trunc_03 > -4) then business_3_value1 = q13_bppjt_11_trunc_03;
if (q13_bppjt_11_trunc_04 > -4) then business_4_value1 = q13_bppjt_11_trunc_04;
if (q13_rejt_11_trunc_01 > -4) then realestate_1_value1 = q13_rejt_11_trunc_01;
if (q13_rejt_11_trunc_02 > -4) then realestate_2_value1 = q13_rejt_11_trunc_02;
if (q13_rejt_11_trunc_03 > -4) then realestate_3_value1 = q13_rejt_11_trunc_03;
if (q13_rejt_11_trunc_04 > -4) then realestate_4_value1 = q13_rejt_11_trunc_04;
if (q13_rejt_11_trunc_05 > -4) then realestate_5_value1 = q13_rejt_11_trunc_05;

if (q13_fjt_12b_01 > -4) then farm_1_pcntshare = q13_fjt_12b_01;
if (q13_fjt_12b_02 > -4) then farm_2_pcntshare = q13_fjt_12b_02;
if (q13_bppjt_12b_01 > -4) then business_1_pcntshare = q13_bppjt_12b_01;
if (q13_bppjt_12b_02 > -4) then business_2_pcntshare = q13_bppjt_12b_02;
if (q13_bppjt_12b_03 > -4) then business_3_pcntshare = q13_bppjt_12b_03;
if (q13_bppjt_12b_04 > -4) then business_4_pcntshare = q13_bppjt_12b_04;
if (q13_rejt_12b_01 > -4) then realestate_1_pcntshare = q13_rejt_12b_01;
if (q13_rejt_12b_02 > -4) then realestate_2_pcntshare = q13_rejt_12b_02;
if (q13_rejt_12b_03 > -4) then realestate_3_pcntshare = q13_rejt_12b_03;
if (q13_rejt_12b_04 > -4) then realestate_4_pcntshare = q13_rejt_12b_04;
if (q13_rejt_12b_05 > -4) then realestate_5_pcntshare = q13_rejt_12b_05;

if (farm_1_pcntshare > 0) then farm_1_pcntshare = (farm_1_pcntshare / 100);
if (farm_2_pcntshare > 0) then farm_2_pcntshare = (farm_2_pcntshare / 100);
if (business_1_pcntshare > 0) then business_1_pcntshare = (business_1_pcntshare / 100);
if (business_2_pcntshare > 0) then business_2_pcntshare = (business_2_pcntshare / 100);
if (business_3_pcntshare > 0) then business_3_pcntshare = (business_3_pcntshare / 100);
if (business_4_pcntshare > 0) then business_4_pcntshare = (business_4_pcntshare / 100);
if (realestate_1_pcntshare > 0) then realestate_1_pcntshare = (realestate_1_pcntshare / 100);
if (realestate_2_pcntshare > 0) then realestate_2_pcntshare = (realestate_2_pcntshare / 100);
if (realestate_3_pcntshare > 0) then realestate_3_pcntshare = (realestate_3_pcntshare / 100);
if (realestate_4_pcntshare > 0) then realestate_4_pcntshare = (realestate_4_pcntshare / 100);
if (realestate_5_pcntshare > 0) then realestate_5_pcntshare = (realestate_5_pcntshare / 100);

if (farm_1_value1 >= 0 & farm_1_pcntshare >= 0) then farm_1_value = (farm_1_value1 * farm_1_pcntshare);
if (farm_2_value1 >= 0 & farm_2_pcntshare >= 0) then farm_2_value = (farm_2_value1 * farm_2_pcntshare);
if (business_1_value1 >= 0 & business_1_pcntshare >= 0) then business_1_value = (business_1_value1 * business_1_pcntshare);
if (business_2_value1 >= 0 & business_2_pcntshare >= 0) then business_2_value = (business_2_value1 * business_2_pcntshare);
if (business_3_value1 >= 0 & business_3_pcntshare >= 0) then business_3_value = (business_3_value1 * business_3_pcntshare);
if (business_4_value1 >= 0 & business_4_pcntshare >= 0) then business_4_value = (business_4_value1 * business_4_pcntshare);
if (realestate_1_value1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_value = (realestate_1_value1 * realestate_1_pcntshare);
if (realestate_2_value1 >= 0 & realestate_2_pcntshare >= 0) then realestate_2_value = (realestate_2_value1 * realestate_2_pcntshare);
if (realestate_3_value1 >= 0 & realestate_3_pcntshare >= 0) then realestate_3_value = (realestate_3_value1 * realestate_3_pcntshare);
if (realestate_4_value1 >= 0 & realestate_4_pcntshare >= 0) then realestate_4_value = (realestate_4_value1 * realestate_4_pcntshare);
if (realestate_5_value1 >= 0 & realestate_5_pcntshare >= 0) then realestate_5_value = (realestate_5_value1 * realestate_5_pcntshare);

/*******************************/
/* Add components BIZ          */
/*******************************/

if (solebiz >= 0) then bizc = (bizc + solebiz); 
if (farm_1_value >= 0) then bizc = (bizc + farm_1_value);
if (farm_2_value >= 0) then bizc = (bizc + farm_2_value);
if (business_1_value >= 0) then bizc = (bizc + business_1_value);
if (business_2_value >= 0) then bizc = (bizc + business_2_value);
if (business_3_value >= 0) then bizc = (bizc + business_3_value);
if (business_4_value >= 0) then bizc = (bizc + business_4_value);
if (realestate_1_value >= 0) then bizc = (bizc + realestate_1_value);
if (realestate_2_value >= 0) then bizc = (bizc + realestate_2_value);
if (realestate_3_value >= 0) then bizc = (bizc + realestate_3_value);
if (realestate_4_value >= 0) then bizc = (bizc + realestate_4_value);
if (realestate_5_value >= 0) then bizc = (bizc + realestate_5_value);

if (solebiz in(-1, -2, -3)) then bizc = -3;
if (farm_1_value in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_2_value in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_1_value in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_2_value in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_3_value in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_4_value in(-1, -2, -3) | business_4_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_1_value in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_2_value in(-1, -2, -3) | realestate_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_3_value in(-1, -2, -3) | realestate_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_4_value in(-1, -2, -3) | realestate_4_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_5_value in(-1, -2, -3) | realestate_5_pcntshare in(-1, -2, -3)) then bizc = -3;

/****************************/
/* Compute BDEBT            */
/****************************/

/************************************************/
/* BDEBT Component - debtbiz                    */
/************************************************/

if (q13_132_trunc >= 0) then debtbiz = (debtbiz + q13_132_trunc);
 else if (q13_132_trunc = 1 & q13_132_ref_1 = 1 & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
 & q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = -1;
  else if (q13_132_trunc in(-1, -2) & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
  & q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = q13_132_trunc;
    else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 = q13_132_sr000001) then 
    debtbiz = (debtbiz + q13_132_sr000001);
     else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 > q13_132_sr000001) then 
     debtbiz = (debtbiz + (((q13_132_sr000002 - q13_132_sr000001)/2) + q13_132_sr000001));
      else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 < q13_132_sr000001) then 
      debtbiz = (debtbiz + (((q13_132_sr000001 - q13_132_sr000002)/2) + q13_132_sr000002));
       else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 0) then debtbiz = (debtbiz + quartile3);
        else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 1) then debtbiz = (debtbiz + 190000);
         else if (q13_132_uab_a in(-1, -2) | q13_132_uab_c in(-1, -2)) then debtbiz = -3;

/***************************************************************************/
/* BDEBT Components - farm_#_debt, business_#_debt, realestate_#_debt      */
/*       (use ownership percentage computed above for bizc)                */
/***************************************************************************/

if (q13_fjt_12_01 > -4) then farm_1_debt1 = q13_fjt_12_01;
if (q13_fjt_12_02 > -4) then farm_2_debt1 = q13_fjt_12_02;
if (q13_bppjt_12_trunc_01 > -4) then business_1_debt1 = q13_bppjt_12_trunc_01;
if (q13_bppjt_12_trunc_02 > -4) then business_2_debt1 = q13_bppjt_12_trunc_02;
if (q13_bppjt_12_trunc_03 > -4) then business_3_debt1 = q13_bppjt_12_trunc_03;
if (q13_bppjt_12_trunc_04 > -4) then business_4_debt1 = q13_bppjt_12_trunc_04;
if (q13_rejt_12_trunc > -4) then realestate_1_debt1 = q13_rejt_12_trunc;

if (farm_1_debt1 >= 0 & farm_1_pcntshare >= 0) then farm_1_debt = (farm_1_debt1 * farm_1_pcntshare);
if (farm_2_debt1 >= 0 & farm_2_pcntshare >= 0) then farm_2_debt = (farm_2_debt1 * farm_2_pcntshare);
if (business_1_debt1 >= 0 & business_1_pcntshare >= 0) then business_1_debt = (business_1_debt1 * business_1_pcntshare);
if (business_2_debt1 >= 0 & business_2_pcntshare >= 0) then business_2_debt = (business_2_debt1 * business_2_pcntshare);
if (business_3_debt1 >= 0 & business_3_pcntshare >= 0) then business_3_debt = (business_3_debt1 * business_3_pcntshare);
if (business_4_debt1 >= 0 & business_4_pcntshare >= 0) then business_4_debt = (business_4_debt1 * business_4_pcntshare);
if (realestate_1_debt1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_debt = (realestate_1_debt1 * realestate_1_pcntshare);

/*******************************/
/* Add components BDEBT        */
/*******************************/

if (debtbiz >= 0) then bdebtc = (bdebtc + debtbiz); 
if (farm_1_debt >= 0) then bdebtc = (bdebtc + farm_1_debt);
if (farm_2_debt >= 0) then bdebtc = (bdebtc + farm_2_debt);
if (business_1_debt >= 0) then bdebtc = (bdebtc + business_1_debt);
if (business_2_debt >= 0) then bdebtc = (bdebtc + business_2_debt);
if (business_3_debt >= 0) then bdebtc = (bdebtc + business_3_debt);
if (business_4_debt >= 0) then bdebtc = (bdebtc + business_4_debt);
if (realestate_1_debt >= 0) then bdebtc = (bdebtc + realestate_1_debt);

if (debtbiz in(-1, -2, -3)) then bdebtc = -3; 
if (farm_1_debt in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_2_debt in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_1_debt in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_2_debt in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_3_debt in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_4_debt in(-1, -2, -3) | business_4_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (realestate_1_debt in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;

/****************************/
/* Compute CASH             */
/****************************/

/************************************************/
/* CASH Component - cash                        */
/************************************************/

if (fa_1 = 1 & fa_1a_trunc >= 0) then cashc = (cashc + fa_1a_trunc);
 else if (fa_1 = 1 & fa_1_ref_1 = 1 & fa_1a_sr000001 < 0 & fa_1a_sr000002 < 0 
 & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = -1;
  else if (fa_1 = 1 & fa_1a_trunc in(-1, -2) & fa_1a_sr000001 < 0 & fa_1a_sr000002 < 0 
  & fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = fa_1a_trunc;
    else if (fa_1a_sr000001 >= 0 & fa_1a_sr000002 >= 0 & fa_1a_sr000002 = fa_1a_sr000001) then 
    cashc = (cashc + fa_1a_sr000001);
     else if (fa_1a_sr000001 >= 0 & fa_1a_sr000002 >= 0 & fa_1a_sr000002 > fa_1a_sr000001) then 
     cashc = (cashc + (((fa_1a_sr000002 - fa_1a_sr000001)/2) + fa_1a_sr000001));
      else if (fa_1a_sr000001 >= 0 & fa_1a_sr000002 >= 0 & fa_1a_sr000002 < fa_1a_sr000001) then 
      cashc = (cashc + (((fa_1a_sr000001 - fa_1a_sr000002)/2) + fa_1a_sr000002));
       else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 0) then cashc = (cashc + quartile1);
        else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 1) then cashc = (cashc + quartile2);
         else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 0) then cashc = (cashc + quartile3);
          else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 1) then cashc = (cashc + 90000);
           else if (fa_1a_uab_a in(-1, -2) | fa_1a_uab_b in(-1, -2) | fa_1a_uab_c in(-1, -2)) then cashc = -3;

/*************************************************************/
/* No need to add components for CASHC - set -3 missing      */
/*************************************************************/

if (cashc in(-1, -2, -3)) then cashc = -3;

/****************************/
/* Compute CDS              */
/****************************/

/************************************************/
/* CDS Component - cds                          */
/************************************************/

if (fa_2 = 1 & fa_2a_trunc >= 0) then cdsc = (cdsc + fa_2a_trunc);
 else if (fa_2 = 1 & fa_2_ref_1 = 1 & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0 
 & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = -1;
  else if (fa_2 = 1 & fa_2a_trunc in(-1, -2) & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0 
  & fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = fa_2a_trunc;
    else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 = fa_2a_sr000001) then 
    cdsc = (cdsc + fa_2a_sr000001);
     else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 > fa_2a_sr000001) then 
     cdsc = (cdsc + (((fa_2a_sr000002 - fa_2a_sr000001)/2) + fa_2a_sr000001));
      else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 < fa_2a_sr000001) then 
      cdsc = (cdsc + (((fa_2a_sr000001 - fa_2a_sr000002)/2) + fa_2a_sr000002));
       else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 0) then cdsc = (cdsc + quartile1);
        else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 1) then cdsc = (cdsc + quartile2);
         else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 0) then cdsc = (cdsc + quartile3);
          else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 1) then cdsc = (cdsc + 92500);
           else if (fa_2a_uab_a in(-1, -2) | fa_2a_uab_b in(-1, -2) | fa_2a_uab_c in(-1, -2)) then cdsc = -3;

/*************************************************************/
/* No need to add components for CDSC - set -3 missing       */
/*************************************************************/

if (cdsc in(-1, -2, -3)) then cdsc = -3;

/****************************/
/* Compute STOCK            */
/****************************/

/************************************************/
/* STOCK Component - govbonds                   */
/************************************************/

if (fa_3 = 1 & fa_3a_trunc >= 0) then govbonds = (govbonds + fa_3a_trunc);
 else if (fa_3 = 1 & fa_3_ref_1 = 1 & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
 & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = -1;
  else if (fa_3 = 1 & fa_3a_trunc in(-1, -2) & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
  & fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = fa_3a_trunc;
    else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 = fa_3a_sr000001) then 
    govbonds = (govbonds + fa_3a_sr000001);
     else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 > fa_3a_sr000001) then 
     govbonds = (govbonds + (((fa_3a_sr000002 - fa_3a_sr000001)/2) + fa_3a_sr000001));
      else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 < fa_3a_sr000001) then 
      govbonds = (govbonds + (((fa_3a_sr000001 - fa_3a_sr000002)/2) + fa_3a_sr000002));
       else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_b = 0) then govbonds = (govbonds + quartile1);
        else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_b = 1) then govbonds = (govbonds + quartile2);
         else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_c = 0) then govbonds = (govbonds + quartile3);
          else if (fa_3a_trunc in(-1, -2, -4) & fa_3a_uab_c = 1) then govbonds = (govbonds + 60000);
           else if (fa_3a_uab_a in(-1, -2) | fa_3a_uab_b in(-1, -2) | fa_3a_uab_c in(-1, -2)) then govbonds = -3;

/************************************************/
/* STOCK Component - mutual                     */
/************************************************/

if (fa_4 = 1 & fa_4a_trunc >= 0) then mutual = (mutual + fa_4a_trunc);
 else if (fa_4 = 1 & fa_4_ref_1 = 1 & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
 & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = -1;
  else if (fa_4 = 1 & fa_4a_trunc in(-1, -2) & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
  & fa_4a_uab_a < 0 & fa_4a_uab_b < 0 & fa_4a_uab_c < 0) then mutual = fa_4a_trunc;
    else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 = fa_4a_sr000001) then 
    mutual = (mutual + fa_4a_sr000001);
     else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 > fa_4a_sr000001) then 
     mutual = (mutual + (((fa_4a_sr000002 - fa_4a_sr000001)/2) + fa_4a_sr000001));
      else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 < fa_4a_sr000001) then 
      mutual = (mutual + (((fa_4a_sr000001 - fa_4a_sr000002)/2) + fa_4a_sr000002));
       else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 0) then mutual = (mutual + quartile1);
        else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_b = 1) then mutual = (mutual + quartile2);
         else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 0) then mutual = (mutual + quartile3);
          else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 1) then mutual = (mutual + 180000);
           else if (fa_4a_uab_a in(-1, -2) | fa_4a_uab_b in(-1, -2) | fa_4a_uab_c in(-1, -2)) then mutual = -3;

/************************************************/
/* STOCK Component - lifeinsure                 */
/************************************************/

if (fa_5 = 1 & fa_5a_trunc >= 0) then lifeinsure = (lifeinsure + fa_5a_trunc);
 else if (fa_5 = 1 & fa_5_ref_1 = 1 & fa_5a_sr000001 < 0 & fa_5a_sr000002 < 0 
 & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = -1;
  else if (fa_5 = 1 & fa_5a_trunc in(-1, -2) & fa_5a_sr000001 < 0 & fa_5a_sr000002 < 0 
  & fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = fa_5a_trunc;
    else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 = fa_5a_sr000001) then 
    lifeinsure = (lifeinsure + fa_5a_sr000001);
     else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 > fa_5a_sr000001) then 
     lifeinsure = (lifeinsure + (((fa_5a_sr000002 - fa_5a_sr000001)/2) + fa_5a_sr000001));
      else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002 >= 0 & fa_5a_sr000002 < fa_5a_sr000001) then 
      lifeinsure = (lifeinsure + (((fa_5a_sr000001 - fa_5a_sr000002)/2) + fa_5a_sr000002));
       else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 0) then lifeinsure = (lifeinsure + quartile1);
        else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 1) then lifeinsure = (lifeinsure + quartile2);
         else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 0) then lifeinsure = (lifeinsure + quartile3);
          else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 1) then lifeinsure = (lifeinsure + 100000);
           else if (fa_5a_uab_a in(-1, -2) | fa_5a_uab_b in(-1, -2) | fa_5a_uab_c in(-1, -2)) then lifeinsure = -3;

/************************************************/
/* STOCK Component - shares                     */
/************************************************/

if (fa_9 = 1 & fa_9a_trunc >= 0) then shares = (shares + fa_9a_trunc);
 else if (fa_9 = 1 & fa_9_ref_1 = 1 & fa_9a_sr000001_trunc < 0 & fa_9a_sr000002 < 0 
 & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = -1;
  else if (fa_9 = 1 & fa_9a_trunc in(-1, -2) & fa_9a_sr000001_trunc < 0 & fa_9a_sr000002 < 0 
  & fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = fa_9a_trunc;
    else if (fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 = fa_9a_sr000001_trunc) then 
    shares = (shares + fa_9a_sr000001_trunc);
     else if (fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 > fa_9a_sr000001_trunc) then 
     shares = (shares + (((fa_9a_sr000002 - fa_9a_sr000001_trunc)/2) + fa_9a_sr000001_trunc));
      else if (fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 < fa_9a_sr000001_trunc) then 
      shares = (shares + (((fa_9a_sr000001_trunc - fa_9a_sr000002)/2) + fa_9a_sr000002));
       else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 0) then shares = (shares + quartile1);
        else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 1) then shares = (shares + quartile2);
         else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 0) then shares = (shares + quartile3);
          else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 1) then shares = (shares + 150000);
           else if (fa_9a_uab_a in(-1, -2) | fa_9a_uab_b in(-1, -2) | fa_9a_uab_c in(-1, -2)) then shares = -3;

/************************************************/
/* STOCK Component - corpbond                   */
/************************************************/

if (fa_10 = 1 & fa_10a_trunc >= 0) then corpbond = (corpbond + fa_10a_trunc);
 else if (fa_10 = 1 & fa_10_ref_1 = 1 & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0 
 & fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = -1;
  else if (fa_10 = 1 & fa_10a_trunc in(-1, -2) & fa_10a_sr000001 < 0 & fa_10a_sr000002 < 0 
  & fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = fa_10a_trunc;
    else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 = fa_10a_sr000001) then 
    corpbond = (corpbond + fa_10a_sr000001);
     else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 > fa_10a_sr000001) then 
     corpbond = (corpbond + (((fa_10a_sr000002 - fa_10a_sr000001)/2) + fa_10a_sr000001));
      else if (fa_10a_sr000001 >= 0 & fa_10a_sr000002 >= 0 & fa_10a_sr000002 < fa_10a_sr000001) then 
      corpbond = (corpbond + (((fa_10a_sr000001 - fa_10a_sr000002)/2) + fa_10a_sr000002));
       else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 0) then corpbond = (corpbond + quartile1);
        else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 1) then corpbond = (corpbond + quartile2);
         else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 0) then corpbond = (corpbond + quartile3);
          else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 1) then corpbond = (corpbond + 175000);
           else if (fa_10a_uab_a in(-1, -2) | fa_10a_uab_b in(-1, -2) | fa_10a_uab_c in(-1, -2)) then corpbond = -3;

/************************************************/
/* STOCK Component - moneyowedtor               */
/************************************************/

if (fa_11 = 1 & fa_11a >= 0) then moneyowedtor = (moneyowedtor + fa_11a);
 else if (fa_11 = 1 & fa_11_ref_1 = 1 & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0 
 & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = -1;
  else if (fa_11 = 1 & fa_11a in(-1, -2) & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0 
  & fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = fa_11a;
    else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 = fa_11a_sr000001) then 
    moneyowedtor = (moneyowedtor + fa_11a_sr000001);
     else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 > fa_11a_sr000001) then 
     moneyowedtor = (moneyowedtor + (((fa_11a_sr000002 - fa_11a_sr000001)/2) + fa_11a_sr000001));
      else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 < fa_11a_sr000001) then 
      moneyowedtor = (moneyowedtor + (((fa_11a_sr000001 - fa_11a_sr000002)/2) + fa_11a_sr000002));
       else if (fa_11a in(-1, -2, -4) & fa_11a_uab_b = 0) then moneyowedtor = (moneyowedtor + quartile1);
        else if (fa_11a in(-1, -2, -4) & fa_11a_uab_b = 1) then moneyowedtor = (moneyowedtor + quartile2);
         else if (fa_11a in(-1, -2, -4) & fa_11a_uab_c = 0) then moneyowedtor = (moneyowedtor + quartile3);
          else if (fa_11a in(-1, -2, -4) & fa_11a_uab_c = 1) then moneyowedtor = (moneyowedtor + 67000);
           else if (fa_11a_uab_a in(-1, -2) | fa_11a_uab_b in(-1, -2) | fa_11a_uab_c in(-1, -2)) then moneyowedtor = -3;

/*******************************/
/* Add components STOCK        */
/*******************************/

if (govbonds >= 0) then stockc = (stockc + govbonds); 
if (mutual >= 0) then stockc = (stockc + mutual);
if (lifeinsure >= 0) then stockc = (stockc + lifeinsure);
if (shares >= 0) then stockc = (stockc + shares);
if (corpbond >= 0) then stockc = (stockc + corpbond);
if (moneyowedtor >= 0) then stockc = (stockc + moneyowedtor);
if (govbonds in(-1, -2, -3)) then stockc = -3;
else if (mutual in(-1, -2, -3)) then stockc = -3;
else if (lifeinsure in(-1, -2, -3)) then stockc = -3;
else if (shares in(-1, -2, -3)) then stockc = -3;
else if (corpbond in(-1, -2, -3)) then stockc = -3;
else if (moneyowedtor in(-1, -2, -3)) then stockc = -3;

/****************************/
/* Compute HOME             */
/****************************/

/************************************************/
/* HOME Component - home1                       */
/************************************************/

if (nfa_1 = 1 & nfa_1a_trunc >= 0) then home1 = (home1 + nfa_1a_trunc);
 else if (nfa_1 = 1 & nfa_1_ref_1 = 1 & nfa_1a_sr000001_trunc < 0 & nfa_1a_sr000002 < 0 
 & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = -1;
  else if (nfa_1 = 1 & nfa_1a_trunc in(-1, -2) & nfa_1a_sr000001_trunc < 0 & nfa_1a_sr000002 < 0 
  & nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = nfa_1a_trunc;
    else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 = nfa_1a_sr000001_trunc) then 
    home1 = (home1 + nfa_1a_sr000001_trunc);
     else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 > nfa_1a_sr000001_trunc) then 
     home1 = (home1 + (((nfa_1a_sr000002 - nfa_1a_sr000001_trunc)/2) + nfa_1a_sr000001_trunc));
      else if (nfa_1a_sr000001_trunc >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 < nfa_1a_sr000001_trunc) then 
      home1 = (home1 + (((nfa_1a_sr000001_trunc - nfa_1a_sr000002)/2) + nfa_1a_sr000002));
       else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 0) then home1 = (home1 + quartile1);
        else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 1) then home1 = (home1 + quartile2);
         else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 0) then home1 = (home1 + quartile3);
          else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 1) then home1 = (home1 + 200000);
           else if (nfa_1a_uab_a in(-1, -2) | nfa_1a_uab_b in(-1, -2) | nfa_1a_uab_c in(-1, -2)) then home1 = -3;

/************************************************/
/* HOME Component - secondhome                  */
/************************************************/

if (nfa_2 = 1 & nfa_2a_trunc >= 0) then secondhome = (secondhome + nfa_2a_trunc);
 else if (nfa_2 = 1 & nfa_2_ref_1 = 1 & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
 & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = -1;
  else if (nfa_2 = 1 & nfa_2a_trunc in(-1, -2) & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
  & nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = nfa_2a_trunc;
    else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 = nfa_2a_sr000001) then 
    secondhome = (secondhome + nfa_2a_sr000001);
     else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 > nfa_2a_sr000001) then 
     secondhome = (secondhome + (((nfa_2a_sr000002 - nfa_2a_sr000001)/2) + nfa_2a_sr000001));
      else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 < nfa_2a_sr000001) then 
      secondhome = (secondhome + (((nfa_2a_sr000001 - nfa_2a_sr000002)/2) + nfa_2a_sr000002));
       else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 0) then secondhome = (secondhome + quartile1);
        else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 1) then secondhome = (secondhome + quartile2);
         else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 0) then secondhome = (secondhome + quartile3);
          else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 1) then secondhome = (secondhome + 175000);
           else if (nfa_2a_uab_a in(-1, -2) | nfa_2a_uab_b in(-1, -2) | nfa_2a_uab_c in(-1, -2)) then secondhome = -3;
 
/*******************************/
/* Add components HOME         */
/*******************************/

if (home1 >= 0) then homec = (homec + home1); 
if (secondhome >= 0) then homec = (homec + secondhome);
if (home1 in(-1, -2, -3)) then homec = -3;
else if (secondhome in(-1, -2, -3)) then homec = -3;

/****************************/
/* Compute MORT             */
/****************************/

/************************************************/
/* MORT Component - mort1                       */
/************************************************/

if (nfa_1b_trunc >= 0) then mort1 = (mort1 + nfa_1b_trunc);
 else if (nfa_1b_ref_1 = 1 & nfa_1b_sr000001 < 0 & nfa_1b_sr000002 < 0 
 & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = -1;
  else if (nfa_1b_trunc in(-1, -2) & nfa_1b_sr000001 < 0 & nfa_1b_sr000002 < 0 
  & nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = nfa_1b_trunc;
    else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 = nfa_1b_sr000001) then 
    mort1 = (mort1 + nfa_1b_sr000001);
     else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 > nfa_1b_sr000001) then 
     mort1 = (mort1 + (((nfa_1b_sr000002 - nfa_1b_sr000001)/2) + nfa_1b_sr000001));
      else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 < nfa_1b_sr000001) then 
      mort1 = (mort1 + (((nfa_1b_sr000001 - nfa_1b_sr000002)/2) + nfa_1b_sr000002));
       else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 0) then mort1 = (mort1 + quartile1);
        else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 1) then mort1 = (mort1 + quartile2);
         else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 0) then mort1 = (mort1 + quartile3);
          else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 1) then mort1 = (mort1 + 115000);
           else if (nfa_1b_uab_a in(-1, -2) | nfa_1b_uab_b in(-1, -2) | nfa_1b_uab_c in(-1, -2)) then mort1 = -3;

/************************************************/
/* MORT Component - secondmort                  */
/************************************************/

if (nfa_2b_trunc >= 0) then secondmort = (secondmort + nfa_2b_trunc);
 else if (nfa_2b_ref_1 = 1 & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
 & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = -1;
  else if (nfa_2b_trunc in(-1, -2) & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
  & nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = nfa_2b_trunc;
    else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 = nfa_2b_sr000001) then 
    secondmort = (secondmort + nfa_2b_sr000001);
     else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 > nfa_2b_sr000001) then 
     secondmort = (secondmort + (((nfa_2b_sr000002 - nfa_2b_sr000001)/2) + nfa_2b_sr000001));
      else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 < nfa_2b_sr000001) then 
      secondmort = (secondmort + (((nfa_2b_sr000001 - nfa_2b_sr000002)/2) + nfa_2b_sr000002));
       else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 0) then secondmort = (secondmort + quartile1);
        else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 1) then secondmort = (secondmort + quartile2);
         else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 0) then secondmort = (secondmort + quartile3);
          else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 1) then secondmort = (secondmort + 130000);
           else if (nfa_2b_uab_a in(-1, -2) | nfa_2b_uab_b in(-1, -2) | nfa_2b_uab_c in(-1, -2)) then secondmort = -3;

/*******************************/
/* Add components MORT         */
/*******************************/

if (mort1 >= 0) then mortc = (mortc + mort1); 
if (secondmort >= 0) then mortc = (mortc + secondmort);
if (mort1 in(-1, -2, -3)) then mortc = -3;
else if (secondmort in(-1, -2, -3)) then mortc = -3;

/****************************/
/* Compute PDEBT            */
/****************************/

/************************************************/
/* PDEBT Component - pdebt1                     */
/************************************************/

if (nfa_1c >= 0) then pdebt1 = (pdebt1 + nfa_1c);
 else if (nfa_1c_ref_1 = 1 & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
 & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = -1;
  else if (nfa_1c in(-1, -2) & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
  & nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = nfa_1c;
    else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 = nfa_1c_sr000001) then 
    pdebt1 = (pdebt1 + nfa_1c_sr000001);
     else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 > nfa_1c_sr000001) then 
     pdebt1 = (pdebt1 + (((nfa_1c_sr000002 - nfa_1c_sr000001)/2) + nfa_1c_sr000001));
      else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 < nfa_1c_sr000001) then 
      pdebt1 = (pdebt1 + (((nfa_1c_sr000001 - nfa_1c_sr000002)/2) + nfa_1c_sr000002));
       else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 0) then pdebt1 = (pdebt1 + quartile1);
        else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 1) then pdebt1 = (pdebt1 + quartile2);
         else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 0) then pdebt1 = (pdebt1 + quartile3);
          else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 1) then pdebt1 = (pdebt1 + 51000);
           else if (nfa_1c_uab_a in(-1, -2) | nfa_1c_uab_b in(-1, -2) | nfa_1c_uab_c in(-1, -2)) then pdebt1 = -3;

/************************************************/
/* PDEBT Component - secondpdebt                */
/************************************************/

if (nfa_2c >= 0) then secondpdebt = (secondpdebt + nfa_2c);
 else if (nfa_2c_ref_1 = 1 & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 & nfa_2c_uab_a < 0) then secondpdebt = -1;
  else if (nfa_2c in(-1, -2) & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 & nfa_2c_uab_a < 0) then secondpdebt = nfa_2c;
    else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 = nfa_2c_sr000001) then 
    secondpdebt = (secondpdebt + nfa_2c_sr000001);
     else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 > nfa_2c_sr000001) then 
     secondpdebt = (secondpdebt + (((nfa_2c_sr000002 - nfa_2c_sr000001)/2) + nfa_2c_sr000001));
      else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 < nfa_2c_sr000001) then 
      secondpdebt = (secondpdebt + (((nfa_2c_sr000001 - nfa_2c_sr000002)/2) + nfa_2c_sr000002));
       else if (nfa_2c_uab_a in(-1, -2)) then secondpdebt = -3;

/*******************************/
/* Add components PDEBT        */
/*******************************/

if (pdebt1 >= 0) then pdebtc = (pdebtc + pdebt1); 
if (secondpdebt >= 0) then pdebtc = (pdebtc + secondpdebt);
if (pdebt1 in(-1, -2, -3)) then pdebtc = -3;
else if (secondpdebt in(-1, -2, -3)) then pdebtc = -3;

/****************************/
/* Compute IRA              */
/****************************/

/************************************************/
/* IRA Component - ira1                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_01 >= 0) then ira1 = (ira1 + fa_8d_trunc_01);
  else if (fa_8 = 1 & fa_8d_trunc_01 in(-1, -2) & fa_8d_sr000001_01 < 0 & fa_8d_sr000002_trunc_01 < 0 
  & fa_8d_uab_a_01 < 0 & fa_8d_uab_b_01 < 0 & fa_8d_uab_c_01 < 0) then ira1 = fa_8d_trunc_01;
    else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_trunc_01 >= 0 & fa_8d_sr000002_trunc_01 = fa_8d_sr000001_01) then 
    ira1 = (ira1 + fa_8d_sr000001_01);
     else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_trunc_01 >= 0 & fa_8d_sr000002_trunc_01 > fa_8d_sr000001_01) then 
     ira1 = (ira1 + (((fa_8d_sr000002_trunc_01 - fa_8d_sr000001_01)/2) + fa_8d_sr000001_01));
      else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_trunc_01 >= 0 & fa_8d_sr000002_trunc_01 < fa_8d_sr000001_01) then 
      ira1 = (ira1 + (((fa_8d_sr000001_01 - fa_8d_sr000002_trunc_01)/2) + fa_8d_sr000002_trunc_01));
       else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 0) then ira1 = (ira1 + quartile1);
        else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 1) then ira1 = (ira1 + quartile2);
         else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 0) then ira1 = (ira1 + quartile3);
          else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 1) then ira1 = (ira1 + 120000);
           else if (fa_8d_uab_a_01 in(-1, -2) | fa_8d_uab_b_01 in(-1, -2) | fa_8d_uab_c_01 in(-1, -2)) then ira1 = -3;


/************************************************/
/* IRA Component - ira2                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_02 >= 0) then ira2 = (ira2 + fa_8d_trunc_02);
  else if (fa_8 = 1 & fa_8d_trunc_02 in(-1, -2) & fa_8d_sr000001_02 < 0 & fa_8d_sr000002_trunc_02 < 0 
  & fa_8d_uab_a_02 < 0 & fa_8d_uab_c_02 < 0) then ira2 = fa_8d_trunc_02;
    else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_trunc_02 >= 0 & fa_8d_sr000002_trunc_02 = fa_8d_sr000001_02) then 
    ira2 = (ira2 + fa_8d_sr000001_02);
     else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_trunc_02 >= 0 & fa_8d_sr000002_trunc_02 > fa_8d_sr000001_02) then 
     ira2 = (ira2 + (((fa_8d_sr000002_trunc_02 - fa_8d_sr000001_02)/2) + fa_8d_sr000001_02));
      else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_trunc_02 >= 0 & fa_8d_sr000002_trunc_02 < fa_8d_sr000001_02) then 
      ira2 = (ira2 + (((fa_8d_sr000001_02 - fa_8d_sr000002_trunc_02)/2) + fa_8d_sr000002_trunc_02));
       else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 0) then ira2 = (ira2 + quartile3);
        else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 1) then ira2 = (ira2 + 96000);
         else if (fa_8d_uab_a_02 in(-1, -2) | fa_8d_uab_c_02 in(-1, -2)) then ira2 = -3;

/************************************************/
/* IRA Component - ira3                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_03 >= 0) then ira3 = (ira3 + fa_8d_trunc_03);
  else if (fa_8 = 1 & fa_8d_trunc_03 in(-1, -2) & fa_8d_sr000001_03 < 0 & fa_8d_sr000002_trunc_03 < 0 
  & fa_8d_uab_a_03 < 0 & fa_8d_uab_c_03 < 0) then ira3 = fa_8d_trunc_03;
    else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_trunc_03 >= 0 & fa_8d_sr000002_trunc_03 = fa_8d_sr000001_03) then 
    ira3 = (ira3 + fa_8d_sr000001_03);
     else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_trunc_03 >= 0 & fa_8d_sr000002_trunc_03 > fa_8d_sr000001_03) then 
     ira3 = (ira3 + (((fa_8d_sr000002_trunc_03 - fa_8d_sr000001_03)/2) + fa_8d_sr000001_03));
      else if (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_trunc_03 >= 0 & fa_8d_sr000002_trunc_03 < fa_8d_sr000001_03) then 
      ira3 = (ira3 + (((fa_8d_sr000001_03 - fa_8d_sr000002_trunc_03)/2) + fa_8d_sr000002_trunc_03));
       else if (fa_8d_trunc_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 0) then ira3 = (ira3 + quartile3);
        else if (fa_8d_trunc_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 1) then ira3 = (ira3 + 100000);
         else if (fa_8d_uab_a_03 in(-1, -2) | fa_8d_uab_c_03 in(-1, -2)) then ira3 = -3;

/************************************************/
/* IRA Component - ira4                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_04 >= 0) then ira4 = (ira4 + fa_8d_trunc_04);
  else if (fa_8 = 1 & fa_8d_trunc_04 in(-1, -2) & fa_8d_sr000001_04 < 0 & fa_8d_sr000002_trunc_04 < 0 
  & fa_8d_uab_a_04 < 0 & fa_8d_uab_c_04 < 0) then ira4 = fa_8d_trunc_04;
    else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_trunc_04 >= 0 & fa_8d_sr000002_trunc_04 = fa_8d_sr000001_04) then 
    ira4 = (ira4 + fa_8d_sr000001_04);
     else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_trunc_04 >= 0 & fa_8d_sr000002_trunc_04 > fa_8d_sr000001_04) then 
     ira4 = (ira4 + (((fa_8d_sr000002_trunc_04 - fa_8d_sr000001_04)/2) + fa_8d_sr000001_04));
      else if (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_trunc_04 >= 0 & fa_8d_sr000002_trunc_04 < fa_8d_sr000001_04) then 
      ira4 = (ira4 + (((fa_8d_sr000001_04 - fa_8d_sr000002_trunc_04)/2) + fa_8d_sr000002_trunc_04));
       else if (fa_8d_trunc_04 in(-1, -2, -4) & fa_8d_uab_c_04 = 0) then ira4 = (ira4 + quartile3);
        else if (fa_8d_trunc_04 in(-1, -2, -4) & fa_8d_uab_c_04 = 1) then ira4 = (ira4 + 100000);
         else if (fa_8d_uab_a_04 in(-1, -2) | fa_8d_uab_c_04 in(-1, -2)) then ira4 = -3;

/************************************************/
/* IRA Component - ira5                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_05 >= 0) then ira5 = (ira5 + fa_8d_trunc_05);
  else if (fa_8 = 1 & fa_8d_trunc_05 in(-1, -2) & fa_8d_sr000001_05 < 0 & fa_8d_sr000002_trunc_05 < 0 
  & fa_8d_uab_a_05 < 0 & fa_8d_uab_b_05 < 0 & fa_8d_uab_c_05 < 0) then ira5 = fa_8d_trunc_05;
    else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_trunc_05 >= 0 & fa_8d_sr000002_trunc_05 = fa_8d_sr000001_05) then 
    ira5 = (ira5 + fa_8d_sr000001_05);
     else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_trunc_05 >= 0 & fa_8d_sr000002_trunc_05 > fa_8d_sr000001_05) then 
     ira5 = (ira5 + (((fa_8d_sr000002_trunc_05 - fa_8d_sr000001_05)/2) + fa_8d_sr000001_05));
      else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_trunc_05 >= 0 & fa_8d_sr000002_trunc_05 < fa_8d_sr000001_05) then 
      ira5 = (ira5 + (((fa_8d_sr000001_05 - fa_8d_sr000002_trunc_05)/2) + fa_8d_sr000002_trunc_05));
       else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_b_05 = 0) then ira5 = (ira5 + quartile1);
        else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_b_05 = 1) then ira5 = (ira5 + quartile2);
         else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 0) then ira5 = (ira5 + quartile3);
          else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 1) then ira5 = (ira5 + 100000);
           else if (fa_8d_uab_a_05 in(-1, -2) | fa_8d_uab_b_05 in(-1, -2) | fa_8d_uab_c_05 in(-1, -2)) then ira5 = -3;

/************************************************/
/* IRA Component - ira6                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_06 >= 0) then ira6 = (ira6 + fa_8d_trunc_06);
  else if (fa_8 = 1 & fa_8d_trunc_06 in(-1, -2) & fa_8d_sr000001_06 < 0 & fa_8d_sr000002_trunc_06 < 0 
  & fa_8d_uab_a_06 < 0 & fa_8d_uab_c_06 < 0) then ira6 = fa_8d_trunc_06;
    else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_trunc_06 >= 0 & fa_8d_sr000002_trunc_06 = fa_8d_sr000001_06) then 
    ira6 = (ira6 + fa_8d_sr000001_06);
     else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_trunc_06 >= 0 & fa_8d_sr000002_trunc_06 > fa_8d_sr000001_06) then 
     ira6 = (ira6 + (((fa_8d_sr000002_trunc_06 - fa_8d_sr000001_06)/2) + fa_8d_sr000001_06));
      else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_trunc_06 >= 0 & fa_8d_sr000002_trunc_06 < fa_8d_sr000001_06) then 
      ira6 = (ira6 + (((fa_8d_sr000001_06 - fa_8d_sr000002_trunc_06)/2) + fa_8d_sr000002_trunc_06));
       else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 0) then ira6 = (ira6 + quartile3);
        else if (fa_8d_trunc_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 1) then ira6 = (ira6 + 100000);
         else if (fa_8d_uab_a_06 in(-1, -2) | fa_8d_uab_c_06 in(-1, -2)) then ira6 = -3;

/************************************************/
/* IRA Component - ira7                         */
/************************************************/

if (fa_8 = 1 & fa_8d_trunc_07 >= 0) then ira7 = (ira7 + fa_8d_trunc_07);
  else if (fa_8 = 1 & fa_8d_trunc_07 in(-1, -2) & fa_8d_sr000001_07 < 0 & fa_8d_sr000002_trunc_07 < 0 
  & fa_8d_uab_a_07 < 0 & fa_8d_uab_c_07 < 0) then ira7 = fa_8d_trunc_07;
    else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_trunc_07 >= 0 & fa_8d_sr000002_trunc_07 = fa_8d_sr000001_07) then 
    ira7 = (ira7 + fa_8d_sr000001_07);
     else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_trunc_07 >= 0 & fa_8d_sr000002_trunc_07 > fa_8d_sr000001_07) then 
     ira7 = (ira7 + (((fa_8d_sr000002_trunc_07 - fa_8d_sr000001_07)/2) + fa_8d_sr000001_07));
      else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_trunc_07 >= 0 & fa_8d_sr000002_trunc_07 < fa_8d_sr000001_07) then 
      ira7 = (ira7 + (((fa_8d_sr000001_07 - fa_8d_sr000002_trunc_07)/2) + fa_8d_sr000002_trunc_07));
       else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 0) then ira7 = (ira7 + quartile3);
        else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 1) then ira7 = (ira7 + 121000);
         else if (fa_8d_uab_a_07 in(-1, -2) | fa_8d_uab_c_07 in(-1, -2)) then ira7 = -3;

/*******************************/
/* Add components IRA          */
/*******************************/

if (ira1 >= 0) then irac = (irac + ira1); 
if (ira2 >= 0) then irac = (irac + ira2); 
if (ira3 >= 0) then irac = (irac + ira3); 
if (ira4 >= 0) then irac = (irac + ira4); 
if (ira5 >= 0) then irac = (irac + ira5); 
if (ira6 >= 0) then irac = (irac + ira6); 
if (ira7 >= 0) then irac = (irac + ira7); 
if (ira1 in(-1, -2, -3)) then irac = -3;
else if (ira2 in(-1, -2, -3)) then irac = -3;
else if (ira3 in(-1, -2, -3)) then irac = -3;
else if (ira4 in(-1, -2, -3)) then irac = -3;
else if (ira5 in(-1, -2, -3)) then irac = -3;
else if (ira6 in(-1, -2, -3)) then irac = -3;
else if (ira7 in(-1, -2, -3)) then irac = -3;

/****************************/
/* Compute A401K            */
/****************************/

/************************************************/
/* A401K component - r_401k                     */
/************************************************/

if (fa_6b = 1 & fa_6e_trunc >= 0) then r_401k = (r_401k + fa_6e_trunc);
 else if (fa_6b = 1 & fa_6e_ref_1 = 1 & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
 & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = -1;
  else if (fa_6e_trunc in(-1, -2) & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
  & fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = fa_6e_trunc;
   else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 = fa_6e_sr000001) then 
    r_401k = (r_401k + fa_6e_sr000001);
     else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 > fa_6e_sr000001) then 
     r_401k = (r_401k + (((fa_6e_sr000002 - fa_6e_sr000001)/2) + fa_6e_sr000001));
      else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 < fa_6e_sr000001) then 
      r_401k = (r_401k + (((fa_6e_sr000001 - fa_6e_sr000002)/2) + fa_6e_sr000002));
       else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 0) then r_401k = (r_401k + quartile1);
        else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 1) then r_401k = (r_401k + quartile2);
         else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 0) then r_401k = (r_401k + quartile3);
          else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 1) then r_401k = (r_401k + 120000);
           else if (fa_6e_uab_a in(-1, -2) | fa_6e_uab_b in(-1, -2) | fa_6e_uab_c in(-1, -2)) then r_401k = -3;

/************************************************/
/* A401K component - sp_401k                    */
/************************************************/

if (fa_7 = 1 & fa_7c_trunc >= 0) then sp_401k = (sp_401k + fa_7c_trunc);
 else if (fa_7 = 1 & fa_7c_ref_1 = 1 & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0 
 & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = -1;
  else if (fa_7c_trunc in(-1, -2) & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0 
  & fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = fa_7c_trunc;
    else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 = fa_7c_sr000001) then 
    sp_401k = (sp_401k + fa_7c_sr000001);
     else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 > fa_7c_sr000001) then 
     sp_401k = (sp_401k + (((fa_7c_sr000002 - fa_7c_sr000001)/2) + fa_7c_sr000001));
      else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 < fa_7c_sr000001) then 
      sp_401k = (sp_401k + (((fa_7c_sr000001 - fa_7c_sr000002)/2) + fa_7c_sr000002));
       else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 0) then sp_401k = (sp_401k + quartile1);
        else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 1) then sp_401k = (sp_401k + quartile2);
         else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 0) then sp_401k = (sp_401k + quartile3);
          else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 1) then sp_401k = (sp_401k + 150000);
           else if (fa_7c_uab_a in(-1, -2) | fa_7c_uab_b in(-1, -2) | fa_7c_uab_c in(-1, -2)) then sp_401k = -3;

/*******************************/
/* Add components A401K        */
/*******************************/

if (r_401k >= 0) then a401kc = (a401kc + r_401k); 
if (sp_401k >= 0) then a401kc = (a401kc + sp_401k); 
if (r_401k in(-1, -2, -3)) then a401kc = -3;
else if (sp_401k in(-1, -2, -3)) then a401kc = -3;

/****************************/
/* Compute CDEBT            */
/****************************/
/************************************************/
/* CDEBT Component - amtowe_assetpoorcars1      */
/************************************************/

if (sc_12b_01 >= 0) then amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_01);
  else if (sc_12b_01 in(-1, -2) & sc_12b_sr000001_01 < 0 & sc_12b_sr000002_01 < 0 
  & sc_12b_uab_a_01 < 0) then amtowe_assetpoorcars1 = sc_12b_01;
    else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 = sc_12b_sr000001_01) then 
    amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + sc_12b_sr000001_01);
     else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 > sc_12b_sr000001_01) then 
     amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000002_01 - sc_12b_sr000001_01)/2) + sc_12b_sr000001_01));
      else if (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 >= 0 & sc_12b_sr000002_01 < sc_12b_sr000001_01) then 
      amtowe_assetpoorcars1 = (amtowe_assetpoorcars1 + (((sc_12b_sr000001_01 - sc_12b_sr000002_01)/2) + sc_12b_sr000002_01));
       else if (sc_12b_uab_a_01 in(-1, -2)) then amtowe_assetpoorcars1 = -3;

/************************************************/
/* CDEBT Component - amtowe_assetpoorcars2      */
/************************************************/

if (sc_12b_02 >= 0) then amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + sc_12b_02);
  else if (sc_12b_02 in(-1, -2) & sc_12b_sr000001_02 < 0 & sc_12b_sr000002_02 < 0) then amtowe_assetpoorcars2 = sc_12b_02;
   else if (sc_12b_sr000001_02 >= 0 & sc_12b_sr000002_02 >= 0 & sc_12b_sr000002_02 = sc_12b_sr000001_02) then 
   amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + sc_12b_sr000001_02);
    else if (sc_12b_sr000001_02 >= 0 & sc_12b_sr000002_02 >= 0 & sc_12b_sr000002_02 > sc_12b_sr000001_02) then 
    amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + (((sc_12b_sr000002_02 - sc_12b_sr000001_02)/2) + sc_12b_sr000001_02));
     else if (sc_12b_sr000001_02 >= 0 & sc_12b_sr000002_02 >= 0 & sc_12b_sr000002_02 < sc_12b_sr000001_02) then 
     amtowe_assetpoorcars2 = (amtowe_assetpoorcars2 + (((sc_12b_sr000001_02 - sc_12b_sr000002_02)/2) + sc_12b_sr000002_02));

/************************************************/
/* CDEBT Component - amountowe_vehicles1        */
/************************************************/

if (nfa_4f_trunc_01 >= 0) then amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_trunc_01);
 else if (nfa_4f_trunc_01 in(-1, -2) & nfa_4f_sr000001_01 < 0 & nfa_4f_sr000002_trunc_01 < 0 
 & nfa_4f_uab_a_01 < 0 & nfa_4f_uab_b_01 < 0 & nfa_4f_uab_c_01 < 0) then amountowe_vehicles1 = nfa_4f_trunc_01;
   else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 = nfa_4f_sr000001_01) then 
   amountowe_vehicles1 = (amountowe_vehicles1 + nfa_4f_sr000001_01);
    else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 > nfa_4f_sr000001_01) then 
    amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000002_trunc_01 - nfa_4f_sr000001_01)/2) + nfa_4f_sr000001_01));
     else if (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_trunc_01 >= 0 & nfa_4f_sr000002_trunc_01 < nfa_4f_sr000001_01) then 
     amountowe_vehicles1 = (amountowe_vehicles1 + (((nfa_4f_sr000001_01 - nfa_4f_sr000002_trunc_01)/2) + nfa_4f_sr000002_trunc_01));
      else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile1);
       else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_b_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile2);
        else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 0) then amountowe_vehicles1 = (amountowe_vehicles1 + quartile3);
         else if (nfa_4f_trunc_01 in(-1, -2, -4) & nfa_4f_uab_c_01 = 1) then amountowe_vehicles1 = (amountowe_vehicles1 + 38000);
          else if (nfa_4f_uab_a_01 in(-1, -2) | nfa_4f_uab_b_01 in(-1, -2) | nfa_4f_uab_c_01 in(-1, -2)) then amtowe_vehicles1 = -3;

/************************************************/
/* CDEBT Component - amountowe_vehicles2        */
/************************************************/

if (nfa_4f_trunc_02 >= 0) then amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_trunc_02);
 else if (nfa_4f_trunc_02 in(-1, -2) & nfa_4f_sr000001_02 < 0 & nfa_4f_sr000002_trunc_02 < 0 
 & nfa_4f_uab_a_02 < 0 & nfa_4f_uab_b_02 < 0 & nfa_4f_uab_c_02 < 0) then amountowe_vehicles2 = nfa_4f_trunc_02;
   else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 = nfa_4f_sr000001_02) then 
   amountowe_vehicles2 = (amountowe_vehicles2 + nfa_4f_sr000001_02);
    else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 > nfa_4f_sr000001_02) then 
    amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000002_trunc_02 - nfa_4f_sr000001_02)/2) + nfa_4f_sr000001_02));
     else if (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_trunc_02 >= 0 & nfa_4f_sr000002_trunc_02 < nfa_4f_sr000001_02) then 
     amountowe_vehicles2 = (amountowe_vehicles2 + (((nfa_4f_sr000001_02 - nfa_4f_sr000002_trunc_02)/2) + nfa_4f_sr000002_trunc_02));
      else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile1);
       else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_b_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile2);
        else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 0) then amountowe_vehicles2 = (amountowe_vehicles2 + quartile3);
         else if (nfa_4f_trunc_02 in(-1, -2, -4) & nfa_4f_uab_c_02 = 1) then amountowe_vehicles2 = (amountowe_vehicles2 + 40000);
          else if (nfa_4f_uab_a_02 in(-1, -2) | nfa_4f_uab_b_02 in(-1, -2) | nfa_4f_uab_c_02 in(-1, -2)) then amtowe_vehicles2 = -3;

/************************************************/
/* CDEBT Component - amountowe_vehicles3        */
/************************************************/

if (nfa_4f_trunc_03 >= 0) then amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_trunc_03);
 else if (nfa_4f_trunc_03 in(-1, -2) & nfa_4f_sr000001_03 < 0 & nfa_4f_sr000002_trunc_03 < 0 
 & nfa_4f_uab_a_03 < 0 & nfa_4f_uab_c_03 < 0) then amountowe_vehicles3 = nfa_4f_trunc_03;
   else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 = nfa_4f_sr000001_03) then 
   amountowe_vehicles3 = (amountowe_vehicles3 + nfa_4f_sr000001_03);
    else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 > nfa_4f_sr000001_03) then 
    amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000002_trunc_03 - nfa_4f_sr000001_03)/2) + nfa_4f_sr000001_03));
     else if (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_trunc_03 >= 0 & nfa_4f_sr000002_trunc_03 < nfa_4f_sr000001_03) then 
     amountowe_vehicles3 = (amountowe_vehicles3 + (((nfa_4f_sr000001_03 - nfa_4f_sr000002_trunc_03)/2) + nfa_4f_sr000002_trunc_03));
      else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 0) then amountowe_vehicles3 = (amountowe_vehicles3 + quartile3);
       else if (nfa_4f_trunc_03 in(-1, -2, -4) & nfa_4f_uab_c_03 = 1) then amountowe_vehicles3 = (amountowe_vehicles3 + 35000);
        else if (nfa_4f_uab_a_03 in(-1, -2) | nfa_4f_uab_c_03 in(-1, -2)) then amtowe_vehicles3 = -3;

/************************************************/
/* CDEBT Component - amountowe_vehicles4        */
/************************************************/

if (nfa_4f_trunc_04 >= 0) then amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_trunc_04);
 else if (nfa_4f_trunc_04 in(-1, -2) & nfa_4f_sr000001_04 < 0 & nfa_4f_sr000002_trunc_04 < 0 
 & nfa_4f_uab_a_04 < 0 & nfa_4f_uab_c_04 < 0) then amountowe_vehicles4 = nfa_4f_trunc_04;
   else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_trunc_04 >= 0 & nfa_4f_sr000002_trunc_04 = nfa_4f_sr000001_04) then 
   amountowe_vehicles4 = (amountowe_vehicles4 + nfa_4f_sr000001_04);
    else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_trunc_04 >= 0 & nfa_4f_sr000002_trunc_04 > nfa_4f_sr000001_04) then 
    amountowe_vehicles4 = (amountowe_vehicles4 + (((nfa_4f_sr000002_trunc_04 - nfa_4f_sr000001_04)/2) + nfa_4f_sr000001_04));
     else if (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_trunc_04 >= 0 & nfa_4f_sr000002_trunc_04 < nfa_4f_sr000001_04) then 
     amountowe_vehicles4 = (amountowe_vehicles4 + (((nfa_4f_sr000001_04 - nfa_4f_sr000002_trunc_04)/2) + nfa_4f_sr000002_trunc_04));
      else if (nfa_4f_trunc_04 in(-1, -2, -4) & nfa_4f_uab_c_04 = 0) then amountowe_vehicles4 = (amountowe_vehicles4 + quartile3);
       else if (nfa_4f_trunc_04 in(-1, -2, -4) & nfa_4f_uab_c_04 = 1) then amountowe_vehicles4 = (amountowe_vehicles4 + 53500);
        else if (nfa_4f_uab_a_04 in(-1, -2) | nfa_4f_uab_c_04 in(-1, -2)) then amtowe_vehicles4 = -3;

/************************************************/
/* CDEBT Component - amountowe_vehicles5        */
/************************************************/

if (nfa_4f_trunc_05 >= 0) then amountowe_vehicles5 = (amountowe_vehicles5 + nfa_4f_trunc_05);
 else if (nfa_4f_trunc_05 in(-1, -2)) then amountowe_vehicles5 = nfa_4f_trunc_05;

/************************************************/
/* CDEBT Component - amountowe_vehicles6        */
/************************************************/

if (nfa_4f_trunc_06 >= 0) then amountowe_vehicles6 = (amountowe_vehicles6 + nfa_4f_trunc_06);
 else if (nfa_4f_trunc_06 in(-1, -2)) then amountowe_vehicles6 = nfa_4f_trunc_06;

/************************************************/
/* CDEBT Component - amountowe_vehicles8        */
/************************************************/

if (nfa_4f_trunc_08 >= 0) then amountowe_vehicles8 = (amountowe_vehicles8 + nfa_4f_trunc_08);
 else if (nfa_4f_trunc_08 in(-1, -2)) then amountowe_vehicles8 = nfa_4f_trunc_08;

/************************************************/
/* CDEBT Component - amountowe_vehicles9        */
/************************************************/

if (nfa_4f_trunc_09 >= 0) then amountowe_vehicles9 = (amountowe_vehicles9 + nfa_4f_trunc_09);
 else if (nfa_4f_trunc_09 in(-1, -2)) then amountowe_vehicles9 = nfa_4f_trunc_09;

/************************************************/
/* CDEBT Component - amtowe_othervehicles       */
/************************************************/

if (nfa_5 = 1 & nfa_5b_trunc >= 0) then amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_trunc);
 else if (nfa_5 = 1 & nfa_5b_trunc in(-1, -2)) then amtowe_othervehicles = nfa_5b_trunc;

/*******************************/
/* Add components CDEBT        */
/*******************************/

if (amtowe_assetpoorcars1 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars1); 
if (amtowe_assetpoorcars2 >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars2); 
if (amountowe_vehicles1 >= 0) then cdebtc = (cdebtc + amountowe_vehicles1); 
if (amountowe_vehicles2 >= 0) then cdebtc = (cdebtc + amountowe_vehicles2); 
if (amountowe_vehicles3 >= 0) then cdebtc = (cdebtc + amountowe_vehicles3); 
if (amountowe_vehicles4 >= 0) then cdebtc = (cdebtc + amountowe_vehicles4); 
if (amountowe_vehicles5 >= 0) then cdebtc = (cdebtc + amountowe_vehicles5); 
if (amountowe_vehicles6 >= 0) then cdebtc = (cdebtc + amountowe_vehicles6); 
if (amountowe_vehicles8 >= 0) then cdebtc = (cdebtc + amountowe_vehicles8); 
if (amountowe_vehicles9 >= 0) then cdebtc = (cdebtc + amountowe_vehicles9);
if (amtowe_othervehicles >= 0) then cdebtc = (cdebtc + amtowe_othervehicles);

if (amtowe_assetpoorcars1 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_assetpoorcars2 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles1 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles2 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles3 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles4 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles5 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles6 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles8 in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles9 in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_othervehicles in(-1, -2, -3)) then cdebtc = -3;

/****************************/
/* Compute CAR              */
/****************************/
/************************************************/
/* CAR Component - mktval_assetpoorcars1        */
/************************************************/

if (sc_12a_01 >= 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_01);
   else if (sc_12a_01 in(-1, -2) & sc_12a_sr000001_01 < 0 & sc_12a_sr000002_01 < 0 
  & sc_12a_uab_a_01 < 0 & sc_12a_uab_b_01 < 0) then mktval_assetpoorcars1 = sc_12a_01;
    else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 = sc_12a_sr000001_01) then 
    mktval_assetpoorcars1 = (mktval_assetpoorcars1 + sc_12a_sr000001_01);
     else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 > sc_12a_sr000001_01) then 
     mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000002_01 - sc_12a_sr000001_01)/2) + sc_12a_sr000001_01));
      else if (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 >= 0 & sc_12a_sr000002_01 < sc_12a_sr000001_01) then 
      mktval_assetpoorcars1 = (mktval_assetpoorcars1 + (((sc_12a_sr000001_01 - sc_12a_sr000002_01)/2) + sc_12a_sr000002_01));
       else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 0) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile1);
        else if (sc_12a_01 in(-1, -2, -4) & sc_12a_uab_b_01 = 1) then mktval_assetpoorcars1 = (mktval_assetpoorcars1 + quartile2);
           else if (sc_12a_uab_a_01 in(-1, -2) | sc_12a_uab_b_01 in(-1, -2)) then mktval_assetpoorcars1 = -3;

/************************************************/
/* CAR Component - mktval_assetpoorcars2        */
/************************************************/

if (sc_12a_02 >= 0) then mktval_assetpoorcars2 = (mktval_assetpoorcars2 + sc_12a_02);
   else if (sc_12a_02 in(-1, -2)) then mktval_assetpoorcars2 = sc_12a_02;

/************************************************/
/* CAR Component - marketvalue_vehicles1        */
/************************************************/

if (nfa_4c_trunc_01 >= 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_trunc_01);
 else if (nfa_4c_trunc_01 in(-1, -2) & nfa_4c_sr000001_01 < 0 & nfa_4c_sr000002_trunc_01 < 0 
 & nfa_4c_uab_a_01 < 0 & nfa_4c_uab_b_01 < 0 & nfa_4c_uab_c_01 < 0) then marketvalue_vehicles1 = nfa_4c_trunc_01;
   else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 = nfa_4c_sr000001_01) then 
   marketvalue_vehicles1 = (marketvalue_vehicles1 + nfa_4c_sr000001_01);
    else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 > nfa_4c_sr000001_01) then 
    marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000002_trunc_01 - nfa_4c_sr000001_01)/2) + nfa_4c_sr000001_01));
     else if (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_trunc_01 >= 0 & nfa_4c_sr000002_trunc_01 < nfa_4c_sr000001_01) then 
     marketvalue_vehicles1 = (marketvalue_vehicles1 + (((nfa_4c_sr000001_01 - nfa_4c_sr000002_trunc_01)/2) + nfa_4c_sr000002_trunc_01));
      else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile1);
       else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_b_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile2);
        else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 0) then marketvalue_vehicles1 = (marketvalue_vehicles1 + quartile3);
         else if (nfa_4c_trunc_01 in(-1, -2, -4) & nfa_4c_uab_c_01 = 1) then marketvalue_vehicles1 = (marketvalue_vehicles1 + 40000);
          else if (nfa_4c_uab_a_01 in(-1, -2) | nfa_4c_uab_b_01 in(-1, -2) | nfa_4c_uab_c_01 in(-1, -2)) then marketvalue_vehicles1 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles2        */
/************************************************/

if (nfa_4c_trunc_02 >= 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_trunc_02);
 else if (nfa_4c_trunc_02 in(-1, -2) & nfa_4c_sr000001_02 < 0 & nfa_4c_sr000002_trunc_02 < 0 
 & nfa_4c_uab_a_02 < 0 & nfa_4c_uab_b_02 < 0 & nfa_4c_uab_c_02 < 0) then marketvalue_vehicles2 = nfa_4c_trunc_02;
   else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 = nfa_4c_sr000001_02) then 
   marketvalue_vehicles2 = (marketvalue_vehicles2 + nfa_4c_sr000001_02);
    else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 > nfa_4c_sr000001_02) then 
    marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000002_trunc_02 - nfa_4c_sr000001_02)/2) + nfa_4c_sr000001_02));
     else if (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_trunc_02 >= 0 & nfa_4c_sr000002_trunc_02 < nfa_4c_sr000001_02) then 
     marketvalue_vehicles2 = (marketvalue_vehicles2 + (((nfa_4c_sr000001_02 - nfa_4c_sr000002_trunc_02)/2) + nfa_4c_sr000002_trunc_02));
      else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile1);
       else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_b_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile2);
        else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 0) then marketvalue_vehicles2 = (marketvalue_vehicles2 + quartile3);
         else if (nfa_4c_trunc_02 in(-1, -2, -4) & nfa_4c_uab_c_02 = 1) then marketvalue_vehicles2 = (marketvalue_vehicles2 + 40000);
          else if (nfa_4c_uab_a_02 in(-1, -2) | nfa_4c_uab_b_02 in(-1, -2) | nfa_4c_uab_c_02 in(-1, -2)) then marketvalue_vehicles2 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles3        */
/************************************************/

if (nfa_4c_trunc_03 >= 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_trunc_03);
 else if (nfa_4c_trunc_03 in(-1, -2) & nfa_4c_sr000001_03 < 0 & nfa_4c_sr000002_trunc_03 < 0 
 & nfa_4c_uab_a_03 < 0 & nfa_4c_uab_b_03 < 0 & nfa_4c_uab_c_03 < 0) then marketvalue_vehicles3 = nfa_4c_trunc_03;
   else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 = nfa_4c_sr000001_03) then 
   marketvalue_vehicles3 = (marketvalue_vehicles3 + nfa_4c_sr000001_03);
    else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 > nfa_4c_sr000001_03) then 
    marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000002_trunc_03 - nfa_4c_sr000001_03)/2) + nfa_4c_sr000001_03));
     else if (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_trunc_03 >= 0 & nfa_4c_sr000002_trunc_03 < nfa_4c_sr000001_03) then 
     marketvalue_vehicles3 = (marketvalue_vehicles3 + (((nfa_4c_sr000001_03 - nfa_4c_sr000002_trunc_03)/2) + nfa_4c_sr000002_trunc_03));
      else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile1);
       else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_b_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile2);
        else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 0) then marketvalue_vehicles3 = (marketvalue_vehicles3 + quartile3);
         else if (nfa_4c_trunc_03 in(-1, -2, -4) & nfa_4c_uab_c_03 = 1) then marketvalue_vehicles3 = (marketvalue_vehicles3 + 40000);
          else if (nfa_4c_uab_a_03 in(-1, -2) | nfa_4c_uab_b_03 in(-1, -2) | nfa_4c_uab_c_03 in(-1, -2)) then marketvalue_vehicles3 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles4        */
/************************************************/

if (nfa_4c_trunc_04 >= 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_trunc_04);
 else if (nfa_4c_trunc_04 in(-1, -2) & nfa_4c_sr000001_04 < 0 & nfa_4c_sr000002_trunc_04 < 0 
 & nfa_4c_uab_a_04 < 0 & nfa_4c_uab_c_04 < 0) then marketvalue_vehicles4 = nfa_4c_trunc_04;
   else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 = nfa_4c_sr000001_04) then 
   marketvalue_vehicles4 = (marketvalue_vehicles4 + nfa_4c_sr000001_04);
    else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 > nfa_4c_sr000001_04) then 
    marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000002_trunc_04 - nfa_4c_sr000001_04)/2) + nfa_4c_sr000001_04));
     else if (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_trunc_04 >= 0 & nfa_4c_sr000002_trunc_04 < nfa_4c_sr000001_04) then 
     marketvalue_vehicles4 = (marketvalue_vehicles4 + (((nfa_4c_sr000001_04 - nfa_4c_sr000002_trunc_04)/2) + nfa_4c_sr000002_trunc_04));
      else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_c_04 = 0) then marketvalue_vehicles4 = (marketvalue_vehicles4 + quartile3);
       else if (nfa_4c_trunc_04 in(-1, -2, -4) & nfa_4c_uab_c_04 = 1) then marketvalue_vehicles4 = (marketvalue_vehicles4 + 40000);
        else if (nfa_4c_uab_a_04 in(-1, -2) | nfa_4c_uab_c_04 in(-1, -2)) then marketvalue_vehicles4 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles5        */
/************************************************/

if (nfa_4c_trunc_05 >= 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_trunc_05);
 else if (nfa_4c_trunc_05 in(-1, -2) & nfa_4c_sr000001_05 < 0 & nfa_4c_sr000002_trunc_05 < 0 
 & nfa_4c_uab_a_05 < 0 & nfa_4c_uab_c_05 < 0) then marketvalue_vehicles5 = nfa_4c_trunc_05;
   else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 = nfa_4c_sr000001_05) then 
   marketvalue_vehicles5 = (marketvalue_vehicles5 + nfa_4c_sr000001_05);
    else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 > nfa_4c_sr000001_05) then 
    marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000002_trunc_05 - nfa_4c_sr000001_05)/2) + nfa_4c_sr000001_05));
     else if (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_trunc_05 >= 0 & nfa_4c_sr000002_trunc_05 < nfa_4c_sr000001_05) then 
     marketvalue_vehicles5 = (marketvalue_vehicles5 + (((nfa_4c_sr000001_05 - nfa_4c_sr000002_trunc_05)/2) + nfa_4c_sr000002_trunc_05));
        else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_c_05 = 0) then marketvalue_vehicles5 = (marketvalue_vehicles5 + quartile3);
         else if (nfa_4c_trunc_05 in(-1, -2, -4) & nfa_4c_uab_c_05 = 1) then marketvalue_vehicles5 = (marketvalue_vehicles5 + 45000);
          else if (nfa_4c_uab_a_05 in(-1, -2) | nfa_4c_uab_c_05 in(-1, -2)) then marketvalue_vehicles5 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles6        */
/************************************************/

if (nfa_4c_trunc_06 >= 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + nfa_4c_trunc_06);
 else if (nfa_4c_trunc_06 in(-1, -2) & nfa_4c_uab_a_06 < 0 & nfa_4c_uab_c_06 < 0) 
 then marketvalue_vehicles6 = nfa_4c_trunc_06;
  else if (nfa_4c_trunc_06 in(-1, -2, -4) & nfa_4c_uab_c_06 = 0) then marketvalue_vehicles6 = (marketvalue_vehicles6 + quartile3);
   else if (nfa_4c_trunc_06 in(-1, -2, -4) & nfa_4c_uab_c_06 = 1) then marketvalue_vehicles6 = (marketvalue_vehicles6 + 40000);
    else if (nfa_4c_uab_a_06 in(-1, -2) | nfa_4c_uab_c_06 in(-1, -2)) then marketvalue_vehicles6 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles7        */
/************************************************/

if (nfa_4c_trunc_07 >= 0) then marketvalue_vehicles7 = (marketvalue_vehicles7 + nfa_4c_trunc_07);
 else if (nfa_4c_trunc_07 in(-1, -2) & nfa_4c_uab_a_07 < 0) then marketvalue_vehicles7 = nfa_4c_trunc_07;
  else if (nfa_4c_uab_a_07 in(-1, -2)) then marketvalue_vehicles7 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles8        */
/************************************************/

if (nfa_4c_trunc_08 >= 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + nfa_4c_trunc_08);
 else if (nfa_4c_trunc_08 in(-1, -2) & nfa_4c_uab_a_08 < 0 & nfa_4c_uab_c_08 < 0) then marketvalue_vehicles8 = nfa_4c_trunc_08;
  else if (nfa_4c_trunc_08 in(-1, -2, -4) & nfa_4c_uab_c_08 = 0) then marketvalue_vehicles8 = (marketvalue_vehicles8 + quartile3);
   else if (nfa_4c_trunc_08 in(-1, -2, -4) & nfa_4c_uab_c_08 = 1) then marketvalue_vehicles8 = (marketvalue_vehicles8 + 60000);
    else if (nfa_4c_uab_a_08 in(-1, -2) | nfa_4c_uab_c_08 in(-1, -2)) then marketvalue_vehicles8 = -3;


/************************************************/
/* CAR Component - marketvalue_vehicles9        */
/************************************************/

if (nfa_4c_trunc_09 >= 0) then marketvalue_vehicles9 = (marketvalue_vehicles9 + nfa_4c_trunc_09);
 else if (nfa_4c_trunc_09 in(-1, -2) & nfa_4c_uab_a_09 < 0 & nfa_4c_uab_b_09 < 0) then marketvalue_vehicles9 = nfa_4c_trunc_09;
  else if (nfa_4c_trunc_09 in(-1, -2, -4) & nfa_4c_uab_b_09 = 0) then marketvalue_vehicles9 = (marketvalue_vehicles9 + quartile1);
   else if (nfa_4c_trunc_09 in(-1, -2, -4) & nfa_4c_uab_b_09 = 1) then marketvalue_vehicles9 = (marketvalue_vehicles9 + quartile2);
    else if (nfa_4c_uab_a_09 in(-1, -2) | nfa_4c_uab_b_09 in(-1, -2)) then marketvalue_vehicles9 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles10       */
/************************************************/

if (nfa_4c_trunc_10 >= 0) then marketvalue_vehicles10 = (marketvalue_vehicles10 + nfa_4c_trunc_10);
 else if (nfa_4c_trunc_10 in(-1, -2) & nfa_4c_uab_a_10 < 0) then marketvalue_vehicles10 = nfa_4c_trunc_10;
  else if (nfa_4c_uab_a_10 in(-1, -2)) then marketvalue_vehicles10 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles11       */
/************************************************/

if (nfa_4c_trunc_11 >= 0) then marketvalue_vehicles11 = (marketvalue_vehicles11 + nfa_4c_trunc_11);
 else if (nfa_4c_trunc_11 in(-1, -2) & nfa_4c_uab_a_11 < 0) then marketvalue_vehicles11 = nfa_4c_trunc_11;
  else if (nfa_4c_uab_a_11 in(-1, -2)) then marketvalue_vehicles11 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles12       */
/************************************************/

if (nfa_4c_trunc_12 >= 0) then marketvalue_vehicles12 = (marketvalue_vehicles12 + nfa_4c_trunc_12);
 else if (nfa_4c_trunc_12 in(-1, -2) & nfa_4c_uab_a_12 < 0) then marketvalue_vehicles12 = nfa_4c_trunc_12;
  else if (nfa_4c_uab_a_12 in(-1, -2)) then marketvalue_vehicles12 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles13       */
/************************************************/

if (nfa_4c_trunc_13 >= 0) then marketvalue_vehicles13 = (marketvalue_vehicles13 + nfa_4c_trunc_13);
 else if (nfa_4c_trunc_13 in(-1, -2) & nfa_4c_uab_a_13 < 0) then marketvalue_vehicles13 = nfa_4c_trunc_13;
  else if (nfa_4c_uab_a_13 in(-1, -2)) then marketvalue_vehicles13 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles14       */
/************************************************/

if (nfa_4c_trunc_14 >= 0) then marketvalue_vehicles14 = (marketvalue_vehicles14 + nfa_4c_trunc_14);
 else if (nfa_4c_trunc_14 in(-1, -2) & nfa_4c_uab_a_14 < 0) then marketvalue_vehicles14 = nfa_4c_trunc_14;
  else if (nfa_4c_uab_a_14 in(-1, -2)) then marketvalue_vehicles14 = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles15       */
/************************************************/

if (nfa_4c_trunc_15 >= 0) then marketvalue_vehicles15 = (marketvalue_vehicles15 + nfa_4c_trunc_15);
 else if (nfa_4c_trunc_15 in(-1, -2) ) then marketvalue_vehicles15 = nfa_4c_trunc_15;

/************************************************/
/* CAR Component - marketvalue_vehicles16       */
/************************************************/

if (nfa_4c_trunc_16 >= 0) then marketvalue_vehicles16 = (marketvalue_vehicles16 + nfa_4c_trunc_16);
 else if (nfa_4c_trunc_16 in(-1, -2)) then marketvalue_vehicles16 = nfa_4c_trunc_16;

/************************************************/
/* CAR Component - marketvalue_vehicles17       */
/************************************************/

if (nfa_4c_trunc_17 >= 0) then marketvalue_vehicles17 = (marketvalue_vehicles17 + nfa_4c_trunc_17);
 else if (nfa_4c_trunc_17 in(-1, -2)) then marketvalue_vehicles17 = nfa_4c_trunc_17;

/************************************************/
/* CAR Component - marketvalue_vehicles18       */
/************************************************/

if (nfa_4c_trunc_18 >= 0) then marketvalue_vehicles18 = (marketvalue_vehicles18 + nfa_4c_trunc_18);
 else if (nfa_4c_trunc_18 in(-1, -2)) then marketvalue_vehicles18 = nfa_4c_trunc_18;

/************************************************/
/* CAR Component - marketvalue_vehicles19       */
/************************************************/

if (nfa_4c_trunc_19 >= 0) then marketvalue_vehicles19 = (marketvalue_vehicles19 + nfa_4c_trunc_19);
 else if (nfa_4c_trunc_19 in(-1, -2)) then marketvalue_vehicles19 = nfa_4c_trunc_19;

/************************************************/
/* CAR Component - marketvalue_vehicles20       */
/************************************************/

if (nfa_4c_trunc_20 >= 0) then marketvalue_vehicles20 = (marketvalue_vehicles20 + nfa_4c_trunc_20);
 else if (nfa_4c_trunc_20 in(-1, -2)) then marketvalue_vehicles20 = nfa_4c_trunc_20;

/************************************************/
/* CAR Component - mktval_othervehicles         */
/************************************************/

if (nfa_5 = 1 & nfa_5c_trunc >= 0) then mktval_othervehicles = (mktval_othervehicles + nfa_5c_trunc);
 else if (nfa_5 = 1 & nfa_5c_ref_1 = 1 & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
 & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = -1;
  else if (nfa_5 = 1 & nfa_5c_trunc in(-1, -2) & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
  & nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = nfa_5c_trunc;
    else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 = nfa_5c_sr000001) then 
    mktval_othervehicles = (mktval_othervehicles + nfa_5c_sr000001);
     else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 > nfa_5c_sr000001) then 
     mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000002 - nfa_5c_sr000001)/2) + nfa_5c_sr000001));
      else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 < nfa_5c_sr000001) then 
      mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000001 - nfa_5c_sr000002)/2) + nfa_5c_sr000002));
       else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 0) then mktval_othervehicles = (mktval_othervehicles + quartile1);
        else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 1) then mktval_othervehicles = (mktval_othervehicles + quartile2);
         else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 0) then mktval_othervehicles = (mktval_othervehicles + quartile3);
          else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 1) then mktval_othervehicles = (mktval_othervehicles + 50000);
           else if (nfa_5c_uab_a in(-1, -2) | nfa_5c_uab_b in(-1, -2) | nfa_5c_uab_c in(-1, -2)) then mktval_othervehicles = -3;

/*******************************/
/* Add components CAR          */
/*******************************/

if (mktval_assetpoorcars1 >= 0) then carc = (carc + mktval_assetpoorcars1); 
if (mktval_assetpoorcars2 >= 0) then carc = (carc + mktval_assetpoorcars2); 
if (marketvalue_vehicles1 >= 0) then carc = (carc + marketvalue_vehicles1); 
if (marketvalue_vehicles2 >= 0) then carc = (carc + marketvalue_vehicles2); 
if (marketvalue_vehicles3 >= 0) then carc = (carc + marketvalue_vehicles3); 
if (marketvalue_vehicles4 >= 0) then carc = (carc + marketvalue_vehicles4); 
if (marketvalue_vehicles5 >= 0) then carc = (carc + marketvalue_vehicles5); 
if (marketvalue_vehicles6 >= 0) then carc = (carc + marketvalue_vehicles6); 
if (marketvalue_vehicles7 >= 0) then carc = (carc + marketvalue_vehicles7); 
if (marketvalue_vehicles8 >= 0) then carc = (carc + marketvalue_vehicles8); 
if (marketvalue_vehicles9 >= 0) then carc = (carc + marketvalue_vehicles9); 
if (marketvalue_vehicles10 >= 0) then carc = (carc + marketvalue_vehicles10); 
if (marketvalue_vehicles11 >= 0) then carc = (carc + marketvalue_vehicles11); 
if (marketvalue_vehicles12 >= 0) then carc = (carc + marketvalue_vehicles12); 
if (marketvalue_vehicles13 >= 0) then carc = (carc + marketvalue_vehicles13); 
if (marketvalue_vehicles14 >= 0) then carc = (carc + marketvalue_vehicles14); 
if (marketvalue_vehicles15 >= 0) then carc = (carc + marketvalue_vehicles15); 
if (marketvalue_vehicles16 >= 0) then carc = (carc + marketvalue_vehicles16); 
if (marketvalue_vehicles17 >= 0) then carc = (carc + marketvalue_vehicles17); 
if (marketvalue_vehicles18 >= 0) then carc = (carc + marketvalue_vehicles18); 
if (marketvalue_vehicles19 >= 0) then carc = (carc + marketvalue_vehicles19); 
if (marketvalue_vehicles20 >= 0) then carc = (carc + marketvalue_vehicles20); 
if (mktval_othervehicles >= 0) then carc = (carc + mktval_othervehicles); 

if (mktval_assetpoorcars1 in(-1, -2, -3)) then carc = -3; 
else if (mktval_assetpoorcars2 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles1 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles2 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles3 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles4 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles5 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles6 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles7 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles8 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles9 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles10 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles11 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles12 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles13 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles14 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles15 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles16 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles17 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles18 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles19 in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles20 in(-1, -2, -3)) then carc = -3; 
else if (mktval_othervehicles in(-1, -2, -3)) then carc = -3; 

/************************/
/* Compute TNFW_TRUNC   */
/************************/
/*******************************************************/
/* TNFW_TRUNC - add components created in above code   */
/*******************************************************/

if (homec  >= 0) then tnfw_trunc = (tnfw_trunc + homec );
if (mortc  >= 0) then tnfw_trunc = (tnfw_trunc - mortc );
if (pdebtc >= 0) then tnfw_trunc = (tnfw_trunc - pdebtc);
if (cashc  >= 0) then tnfw_trunc = (tnfw_trunc + cashc );
if (irac   >= 0) then tnfw_trunc = (tnfw_trunc + irac  );
if (a401kc >= 0) then tnfw_trunc = (tnfw_trunc + a401kc);
if (cdsc   >= 0) then tnfw_trunc = (tnfw_trunc + cdsc  );
if (stockc >= 0) then tnfw_trunc = (tnfw_trunc + stockc);
if (bizc   >= 0) then tnfw_trunc = (tnfw_trunc + bizc  );
if (bdebtc >= 0) then tnfw_trunc = (tnfw_trunc - bdebtc);
if (cdebtc >= 0) then tnfw_trunc = (tnfw_trunc - cdebtc);
if (carc   >= 0) then tnfw_trunc = (tnfw_trunc + carc  );
if (posesc >= 0) then tnfw_trunc = (tnfw_trunc + posesc);
if (odebtc >= 0) then tnfw_trunc = (tnfw_trunc - odebtc);

if (homec  in(-1, -2, -3)) then tnfw_trunc = -3;
if (mortc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (pdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cashc  in(-1, -2, -3)) then tnfw_trunc = -3;
if (irac   in(-1, -2, -3)) then tnfw_trunc = -3;
if (a401kc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdsc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (stockc in(-1, -2, -3)) then tnfw_trunc = -3;
if (bizc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (bdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (cdebtc in(-1, -2, -3)) then tnfw_trunc = -3;
if (carc   in(-1, -2, -3)) then tnfw_trunc = -3;
if (posesc in(-1, -2, -3)) then tnfw_trunc = -3;
if (odebtc in(-1, -2, -3)) then tnfw_trunc = -3;

/****************************************/
/* APPLY TOPCODE TO TNFW_TRUNC FOR 2016 */
/****************************************/

if (tnfw_trunc_2016 >  3132500) then tnfw_trunc_2016 = 5526252;

tnfw_trunc_2016 = round(tnfw_trunc_2016);

/***************************************************************/
/* TNFW_TRUNC - adjust for partially missing range estimates   */
/***************************************************************/

if    (tnfw_trunc ~= -3 & 
         ((nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 in(-1, -2)) | (nfa_1a_sr000001 in(-1, -2) & nfa_1a_sr000002 >= 0)
       | (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 in(-1, -2)) | (nfa_1b_sr000001 in(-1, -2) & nfa_1b_sr000002 >= 0) 
       | (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 in(-1, -2)) | (nfa_1c_sr000001 in(-1, -2) & nfa_1c_sr000002 >= 0)
       | (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 in(-1, -2)) | (nfa_2a_sr000001 in(-1, -2) & nfa_2a_sr000002 >= 0)
       | (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 in(-1, -2)) | (nfa_2b_sr000001 in(-1, -2) & nfa_2b_sr000002 >= 0) 
       | (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 in(-1, -2)) | (nfa_2c_sr000001 in(-1, -2) & nfa_2c_sr000002 >= 0) 
       | (fa_1a_sr000001 >= 0 & fa_1a_sr000002 in(-1, -2)) | (fa_1a_sr000001 in(-1, -2) & fa_1a_sr000002 >= 0)
       | (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 in(-1, -2)) | (fa_8d_sr000001_01 in(-1, -2) & fa_8d_sr000002_01 >= 0)
       | (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 in(-1, -2)) | (fa_8d_sr000001_02 in(-1, -2) & fa_8d_sr000002_02 >= 0)
       | (fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 in(-1, -2)) | (fa_8d_sr000001_03 in(-1, -2) & fa_8d_sr000002_03 >= 0)
       | (fa_8d_sr000001_04 >= 0 & fa_8d_sr000002_04 in(-1, -2)) | (fa_8d_sr000001_04 in(-1, -2) & fa_8d_sr000002_04 >= 0)
       | (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 in(-1, -2)) | (fa_8d_sr000001_05 in(-1, -2) & fa_8d_sr000002_05 >= 0)
       | (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 in(-1, -2)) | (fa_8d_sr000001_06 in(-1, -2) & fa_8d_sr000002_06 >= 0)
       | (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 in(-1, -2)) | (fa_8d_sr000001_07 in(-1, -2) & fa_8d_sr000002_07 >= 0)
       | (fa_6e_sr000001 >= 0 & fa_6e_sr000002 in(-1, -2)) | (fa_6e_sr000001 in(-1, -2) & fa_6e_sr000002 >= 0)
       | (fa_7c_sr000001 >= 0 & fa_7c_sr000002 in(-1, -2)) | (fa_7c_sr000001 in(-1, -2) & fa_7c_sr000002 >= 0)
       | (fa_2a_sr000001 >= 0 & fa_2a_sr000002 in(-1, -2)) | (fa_2a_sr000001 in(-1, -2) & fa_2a_sr000002 >= 0)
       | (fa_3a_sr000001 >= 0 & fa_3a_sr000002 in(-1, -2)) | (fa_3a_sr000001 in(-1, -2) & fa_3a_sr000002 >= 0)
       | (fa_4a_sr000001 >= 0 & fa_4a_sr000002 in(-1, -2)) | (fa_4a_sr000001 in(-1, -2) & fa_4a_sr000002 >= 0)
       | (fa_5a_sr000001 >= 0 & fa_5a_sr000002 in(-1, -2)) | (fa_5a_sr000001 in(-1, -2) & fa_5a_sr000002 >= 0)
       | (fa_9a_sr000001 >= 0 & fa_9a_sr000002 in(-1, -2)) | (fa_9a_sr000001 in(-1, -2) & fa_9a_sr000002 >= 0)
       | (fa_10a_sr000001 >= 0 & fa_10a_sr000002 in(-1, -2)) | (fa_10a_sr000001 in(-1, -2) & fa_10a_sr000002 >= 0)
       | (fa_11a_sr000001 >= 0 & fa_11a_sr000002 in(-1, -2)) | (fa_11a_sr000001 in(-1, -2) & fa_11a_sr000002 >= 0)
       | (q13_131_sr000001 >= 0 & q13_131_sr000002 in(-1, -2)) | (q13_131_sr000001 in(-1, -2) & q13_131_sr000002 >= 0)
       | (q13_132_sr000001 >= 0 & q13_132_sr000002 in(-1, -2)) | (q13_132_sr000001 in(-1, -2) & q13_132_sr000002 >= 0)
       | (sc_12b_sr000001_01 >= 0 & sc_12b_sr000002_01 in(-1, -2)) | (sc_12b_sr000001_01 in(-1, -2) & sc_12b_sr000002_01 >= 0)
       | (sc_12b_sr000001_02 >= 0 & sc_12b_sr000002_02 in(-1, -2)) | (sc_12b_sr000001_02 in(-1, -2) & sc_12b_sr000002_02 >= 0)
       | (nfa_4f_sr000001_01 >= 0 & nfa_4f_sr000002_01 in(-1, -2)) | (nfa_4f_sr000001_01 in(-1, -2) & nfa_4f_sr000002_01 >= 0)
       | (nfa_4f_sr000001_02 >= 0 & nfa_4f_sr000002_02 in(-1, -2)) | (nfa_4f_sr000001_02 in(-1, -2) & nfa_4f_sr000002_02 >= 0)
       | (nfa_4f_sr000001_03 >= 0 & nfa_4f_sr000002_03 in(-1, -2)) | (nfa_4f_sr000001_03 in(-1, -2) & nfa_4f_sr000002_03 >= 0)
       | (nfa_4f_sr000001_04 >= 0 & nfa_4f_sr000002_04 in(-1, -2)) | (nfa_4f_sr000001_04 in(-1, -2) & nfa_4f_sr000002_04 >= 0)
       | (sc_12a_sr000001_01 >= 0 & sc_12a_sr000002_01 in(-1, -2)) | (sc_12a_sr000001_01 in(-1, -2) & sc_12a_sr000002_01 >= 0)
       | (nfa_4c_sr000001_01 >= 0 & nfa_4c_sr000002_01 in(-1, -2)) | (nfa_4c_sr000001_01 in(-1, -2) & nfa_4c_sr000002_01 >= 0)
       | (nfa_4c_sr000001_02 >= 0 & nfa_4c_sr000002_02 in(-1, -2)) | (nfa_4c_sr000001_02 in(-1, -2) & nfa_4c_sr000002_02 >= 0)
       | (nfa_4c_sr000001_03 >= 0 & nfa_4c_sr000002_03 in(-1, -2)) | (nfa_4c_sr000001_03 in(-1, -2) & nfa_4c_sr000002_03 >= 0)
       | (nfa_4c_sr000001_04 >= 0 & nfa_4c_sr000002_04 in(-1, -2)) | (nfa_4c_sr000001_04 in(-1, -2) & nfa_4c_sr000002_04 >= 0)
       | (nfa_4c_sr000001_05 >= 0 & nfa_4c_sr000002_05 in(-1, -2)) | (nfa_4c_sr000001_05 in(-1, -2) & nfa_4c_sr000002_05 >= 0)
       | (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 in(-1, -2)) | (nfa_5c_sr000001 in(-1, -2) & nfa_5c_sr000002 >= 0)
       | (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002 in(-1, -2)) | (nfa_6e_sr000001 in(-1, -2) & nfa_6e_sr000002 >= 0)))
       then tnfw_trunc = -3;
end;
;

2020 TNFW_TRUNC variable creation

/***************************************************/
/* Compute dollar amt for dollars & cents vars */
/***************************************************/

nfa_7d_dc = nfa_7d_trunc;
if (nfa_7d_trunc > 0) then nfa_7d_dc = (nfa_7d_trunc/100);

/***************************************************/
/* Compute dynamic QUARTILE VALUES where necessary */
/* -- quartile4 defaults to 30000 if no specific */
/* value determined from frequencies */
/***************************************************/

array quartileqs (i) quartile1 quartile2 quartile3 quartile4;

do i = 1 to 4;
quartileqs = 0;
end;

if (symbol_entry_othhh = 7200) then do;
quartile1 = (5000/2);
quartile2 = (5000 + ((7200-5000)/2));
quartile3 = (7200 + ((30000-7200)/2));
quartile4 = 30000;
end;
else if (symbol_entry_othhh = 13000) then do;
quartile1 = (5000/2);
quartile2 = (5000 + ((13000-5000)/2));
quartile3 = (13000 + ((30000-13000)/2));
quartile4 = 30000;
end;

/***************************************************/
/* BEGIN COMPUTATIONS FOR NET WEALTH COMPONENTS */
/***************************************************/

array assetsc (i) homec mortc pdebtc cashc irac a401kc cdsc stockc trustc bizc 
bdebtc cdebtc carc posesc odebtc tnfw
collections items ccdebt studentloan childstudentloan owebusiness otherdebt
solebiz farm_1_value1 farm_2_value1 business_1_value1 business_2_value1
business_3_value1 business_4_value1 realestate_1_value1 
realestate_2_value1 realestate_3_value1 realestate_4_value1 realestate_5_value1 
farm_1_value farm_2_value business_1_value business_2_value
business_3_value business_4_value realestate_1_value 
realestate_2_value realestate_3_value realestate_4_value realestate_5_value 
debtbiz farm_1_debt1 farm_2_debt1 business_1_debt1 business_2_debt1
business_3_debt1 business_4_debt1 realestate_1_debt1 
realestate_2_debt1 realestate_3_debt1 realestate_4_debt1 realestate_5_debt1 
farm_1_debt farm_2_debt business_1_debt business_2_debt
business_3_debt business_4_debt realestate_1_debt
govbonds mutual lifeinsure shares corpbond moneyowedtor
home1 secondhome mort1 secondmort pdebt1 secondpdebt
ira1 ira2 ira3 ira4 ira5 ira6 ira7 r_401k sp_401k
amtowe_assetpoorcars
amountowe_vehicles amtowe_othervehicles
mktval_assetpoorcars
marketvalue_vehicles mktval_othervehicles;

do i = 1 to 92;
if (sampweight = 0) then assetsc = -5;
else if (sampweight > 0) then assetsc = 0;
end;


/****************************/
/* Compute POSES */
/****************************/
/*****************************************/
/* POSES Component - collections: */
/*****************************************/

if (nfa_6a = 1 & nfa_6e_trunc >= 0) then collections = (collections + nfa_6e_trunc);
else if (nfa_6a = 1 & nfa_6e_ref_1 = 1 & nfa_6e_sr000001 < 0 & nfa_6e_sr000002_trunc < 0 
& nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = -1;
else if (nfa_6a = 1 & nfa_6e_trunc in(-1, -2) & (nfa_6e_sr000001 < 0 | nfa_6e_sr000002_trunc < 0) 
& nfa_6e_uab_a < 0 & nfa_6e_uab_b < 0 & nfa_6e_uab_c < 0) then collections = nfa_6e_trunc;
else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002_trunc >= 0 & nfa_6e_sr000002_trunc = nfa_6e_sr000001) then 
collections = (collections + nfa_6e_sr000001);
else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002_trunc >= 0 & nfa_6e_sr000002_trunc > nfa_6e_sr000001) then 
collections = (collections + (((nfa_6e_sr000002_trunc - nfa_6e_sr000001)/2) + nfa_6e_sr000001));
else if (nfa_6e_sr000001 >= 0 & nfa_6e_sr000002_trunc >= 0 & nfa_6e_sr000002_trunc < nfa_6e_sr000001) then 
collections = (collections + (((nfa_6e_sr000001 - nfa_6e_sr000002_trunc)/2) + nfa_6e_sr000002_trunc));
else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 0) then collections = (collections + quartile1);
else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_b = 1) then collections = (collections + quartile2);
else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 0) then collections = (collections + quartile3);
else if (nfa_6e_trunc in(-1, -2, -4) & nfa_6e_uab_c = 1) then collections = (collections + 75000);
else if (nfa_6e_uab_a in(-1, -2) | nfa_6e_uab_b in(-1, -2) | nfa_6e_uab_c in(-1, -2)) then collections = -3;


/**********************************/
/* POSES Component - items: */
/**********************************/

if (nfa_7 = 1 & nfa_7d_dc >= 0) then items = (items + nfa_7d_dc);
else if (nfa_7 = 1 & nfa_7d_ref_1 = 1 & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = -1;
else if (nfa_7 = 1 & nfa_7d_dc in(-1, -2) & nfa_7d_uab_a < 0 & nfa_7d_uab_b < 0 & nfa_7d_uab_c < 0) then items = nfa_7d_dc;
else if (nfa_7d_dc in(-1, -2, -4) & nfa_7d_uab_b = 0) then items = (items + quartile1);
else if (nfa_7d_dc in(-1, -2, -4) & nfa_7d_uab_b = 1) then items = (items + quartile2);
else if (nfa_7d_dc in(-1, -2, -4) & nfa_7d_uab_c = 0) then items = (items + quartile3);
else if (nfa_7d_dc in(-1, -2, -4) & nfa_7d_uab_c = 1) then items = (items + 50000);
else if (nfa_7d_uab_a in(-1, -2) | nfa_7d_uab_b in(-1, -2) | nfa_7d_uab_c in(-1, -2)) then items = -3;


/*******************************/
/* Add components POSES */
/*******************************/

if (collections >= 0) then posesc = (posesc + collections); 
if (items >= 0) then posesc = (posesc + items);
if (collections in(-1, -2, -3)) then posesc = -3;
else if (items in(-1, -2, -3)) then posesc = -3;


/****************************/
/* Compute ODEBT */
/****************************/

/************************************/
/* ODEBT Component - ccdebt: */
/************************************/

if (debt_1 = 1 & debt_1a_trunc >= 0) then ccdebt = (ccdebt + debt_1a_trunc);
else if (debt_1 = 1 & debt_1a_ref_1 = 1 & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = -1;
else if (debt_1 = 1 & debt_1a_trunc in(-1, -2) & debt_1a_uab_a < 0 & debt_1a_uab_b < 0 & debt_1a_uab_c < 0) then ccdebt = debt_1a_trunc;
else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_b = 0) then ccdebt = (ccdebt + quartile1);
else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_b = 1) then ccdebt = (ccdebt + quartile2);
else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_c = 0) then ccdebt = (ccdebt + quartile3);
else if (debt_1a_trunc in(-1, -2, -4) & debt_1a_uab_c = 1) then ccdebt = (ccdebt + 45000);
else if (debt_1a_uab_a in(-1, -2) | debt_1a_uab_b in(-1, -2) | debt_1a_uab_c in(-1, -2)) then ccdebt = -3;

/*****************************************/
/* ODEBT Component - studentloan */
/*****************************************/

if (debt_2 = 1 & debt_2a_trunc >= 0) then studentloan = (studentloan + debt_2a_trunc);
else if (debt_2 = 1 & debt_2a_ref_1 = 1 & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 & debt_2a_uab_c < 0) then studentloan = -1;
else if (debt_2 = 1 & debt_2a_trunc in(-1, -2) & debt_2a_uab_a < 0 & debt_2a_uab_b < 0 & debt_2a_uab_c < 0) then studentloan = debt_2a_trunc;
else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_b = 0) then studentloan = (studentloan + quartile1);
else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_b = 1) then studentloan = (studentloan + quartile2);
else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_c = 0) then studentloan = (studentloan + quartile3);
else if (debt_2a_trunc in(-1, -2, -4) & debt_2a_uab_c = 1) then studentloan = (studentloan + 70000);
else if (debt_2a_uab_a in(-1, -2) | debt_2a_uab_b in(-1, -2) | debt_2a_uab_c in(-1, -2)) then studentloan = -3;


/*********************************************/
/* ODEBT Component - childstudentloan */
/*********************************************/

if (debt_2c = 1 & debt_2d_trunc >= 0) then childstudentloan = (childstudentloan + debt_2d_trunc);
else if (debt_2c = 1 & debt_2d_ref_1 = 1 & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 & debt_2d_uab_c < 0) then childstudentloan = -1;
else if (debt_2c = 1 & debt_2d_trunc in(-1, -2) & debt_2d_uab_a < 0 & debt_2d_uab_b < 0 & debt_2d_uab_c < 0) then childstudentloan = debt_2d_trunc;
else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_b = 0) then childstudentloan = (childstudentloan + quartile1);
else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_b = 1) then childstudentloan = (childstudentloan + quartile2);
else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_c = 0) then childstudentloan = (childstudentloan + quartile3);
else if (debt_2d_trunc in(-1, -2, -4) & debt_2d_uab_c = 1) then childstudentloan = (childstudentloan + 67500);
else if (debt_2d_uab_a in(-1, -2) | debt_2d_uab_b in(-1, -2) | debt_2d_uab_c in(-1, -2)) then childstudentloan = -3;


/****************************************/
/* ODEBT Component - owebusiness */
/****************************************/

if (debt_3 = 1 & debt_3a_trunc >= 0) then owebusiness = (owebusiness + debt_3a_trunc);
else if (debt_3 = 1 & debt_3a_ref_1 = 1 & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 & debt_3a_uab_c < 0) then owebusiness = -1;
else if (debt_3 = 1 & debt_3a_trunc in(-1, -2) & debt_3a_uab_a < 0 & debt_3a_uab_b < 0 & debt_3a_uab_c < 0) then owebusiness = debt_3a_trunc;
else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 0) then owebusiness = (owebusiness + quartile1);
else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_b = 1) then owebusiness = (owebusiness + quartile2);
else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 0) then owebusiness = (owebusiness + quartile3);
else if (debt_3a_trunc in(-1, -2, -4) & debt_3a_uab_c = 1) then owebusiness = (owebusiness + 60000);
else if (debt_3a_uab_a in(-1, -2) | debt_3a_uab_b in(-1, -2) | debt_3a_uab_c in(-1, -2)) then owebusiness = -3;


/*****************************************/
/* ODEBT Component - otherdebt */
/*****************************************/

if (debt_4 = 1 & debt_4a_trunc >= 0) then otherdebt = (otherdebt + debt_4a_trunc);
else if (debt_4 = 1 & debt_4a_ref_1 = 1 
& debt_4a_uab_a < 0 & debt_4a_uab_b < 0 & debt_4a_uab_c < 0) then otherdebt = -1;
else if (debt_4 = 1 & debt_4a_trunc in(-1, -2) & debt_4a_uab_a < 0 & debt_4a_uab_b < 0 & debt_4a_uab_c < 0) then otherdebt = debt_4a_trunc;
else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 0) then otherdebt = (otherdebt + quartile1);
else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_b = 1) then otherdebt = (otherdebt + quartile2);
else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_c = 0) then otherdebt = (otherdebt + quartile3);
else if (debt_4a_trunc in(-1, -2, -4) & debt_4a_uab_c = 1) then otherdebt = (otherdebt + 50000);
else if (debt_4a_uab_a in(-1, -2) | debt_4a_uab_b in(-1, -2) | debt_4a_uab_c in(-1, -2)) then otherdebt = -3;


/*******************************/
/* Add components ODEBT */
/*******************************/

if (ccdebt >= 0) then odebtc = (odebtc + ccdebt); 
if (studentloan >= 0) then odebtc = (odebtc + studentloan);
if (childstudentloan >= 0) then odebtc = (odebtc + childstudentloan);
if (owebusiness >= 0) then odebtc = (odebtc + owebusiness);
if (otherdebt >= 0) then odebtc = (odebtc + otherdebt);
if (ccdebt in(-1, -2, -3)) then odebtc = -3;
else if (studentloan in(-1, -2, -3)) then odebtc = -3;
else if (childstudentloan in(-1, -2, -3)) then odebtc = -3;
else if (owebusiness in(-1, -2, -3)) then odebtc = -3;
else if (otherdebt in(-1, -2, -3)) then odebtc = -3;


/********************/
/* Compute BIZ */
/********************/

/************************************/
/* BIZ Component - solebiz: */
/************************************/

if (q13_131_trunc >= 0) then solebiz = (solebiz + q13_131_trunc);
else if (q13_131_trunc = 1 & q13_131_ref_1 = 1 & q13_131_sr000001 < 0 & q13_131_sr000002 < 0 
& q13_131_uab_a < 0 & q13_131_uab_c < 0) then solebiz = -1;
else if (q13_131_trunc in(-1, -2) & (q13_131_sr000001 < 0 | q13_131_sr000002 < 0) 
& q13_131_uab_a < 0 & q13_131_uab_c < 0) then solebiz = q13_131_trunc;
else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 = q13_131_sr000001) then 
solebiz = (solebiz + q13_131_sr000001);
else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 > q13_131_sr000001) then 
solebiz = (solebiz + (((q13_131_sr000002 - q13_131_sr000001)/2) + q13_131_sr000001));
else if (q13_131_sr000001 >= 0 & q13_131_sr000002 >= 0 & q13_131_sr000002 < q13_131_sr000001) then 
solebiz = (solebiz + (((q13_131_sr000001 - q13_131_sr000002)/2) + q13_131_sr000002));
else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 0) then solebiz = (solebiz + quartile3);
else if (q13_131_trunc in(-1, -2, -4) & q13_131_uab_c = 1) then solebiz = (solebiz + 310000);
else if (q13_131_uab_a in(-1, -2) | q13_131_uab_c in(-1, -2)) then solebiz = -3;


/********************************************************************************************************/
/* BIZ Components - farm_#_value, business_#_value, realestate_#_value & percentage ownership */
/********************************************************************************************************/

if (q13_fjt_11_trunc_01 > -4) then farm_1_value1 = q13_fjt_11_trunc_01;
if (q13_fjt_11_trunc_02 > -4) then farm_2_value1 = q13_fjt_11_trunc_02;
if (q13_bppjt_11_trunc_01 > -4) then business_1_value1 = q13_bppjt_11_trunc_01;
if (q13_bppjt_11_trunc_02 > -4) then business_2_value1 = q13_bppjt_11_trunc_02;
if (q13_bppjt_11_trunc_03 > -4) then business_3_value1 = q13_bppjt_11_trunc_03;
if (q13_bppjt_11_trunc_04 > -4) then business_4_value1 = q13_bppjt_11_trunc_04;
if (q13_bppjt_11_trunc_05 > -4) then business_5_value1 = q13_bppjt_11_trunc_05;
if (q13_rejt_11_trunc_01 > -4) then realestate_1_value1 = q13_rejt_11_trunc_01;
if (q13_rejt_11_trunc_02 > -4) then realestate_2_value1 = q13_rejt_11_trunc_02;
if (q13_rejt_11_03 > -4) then realestate_3_value1 = q13_rejt_11_03;
if (q13_rejt_11_04 > -4) then realestate_4_value1 = q13_rejt_11_04;

if (q13_fjt_12b_01 > -4) then farm_1_pcntshare = q13_fjt_12b_01;
if (q13_fjt_12b_02 > -4) then farm_2_pcntshare = q13_fjt_12b_02;
if (q13_bppjt_12b_01 > -4) then business_1_pcntshare = q13_bppjt_12b_01;
if (q13_bppjt_12b_02 > -4) then business_2_pcntshare = q13_bppjt_12b_02;
if (q13_bppjt_12b_03 > -4) then business_3_pcntshare = q13_bppjt_12b_03;
if (q13_bppjt_12b_04 > -4) then business_4_pcntshare = q13_bppjt_12b_04;
if (q13_bppjt_12b_05 > -4) then business_5_pcntshare = q13_bppjt_12b_05;
if (q13_rejt_12b_01 > -4) then realestate_1_pcntshare = q13_rejt_12b_01;
if (q13_rejt_12b_02 > -4) then realestate_2_pcntshare = q13_rejt_12b_02;
if (q13_rejt_12b_03 > -4) then realestate_3_pcntshare = q13_rejt_12b_03;
if (q13_rejt_12b_04 > -4) then realestate_4_pcntshare = q13_rejt_12b_04;

if (farm_1_pcntshare > 0) then farm_1_pcntshare = (farm_1_pcntshare / 100);
if (farm_2_pcntshare > 0) then farm_2_pcntshare = (farm_2_pcntshare / 100);
if (business_1_pcntshare > 0) then business_1_pcntshare = (business_1_pcntshare / 100);
if (business_2_pcntshare > 0) then business_2_pcntshare = (business_2_pcntshare / 100);
if (business_3_pcntshare > 0) then business_3_pcntshare = (business_3_pcntshare / 100);
if (business_4_pcntshare > 0) then business_4_pcntshare = (business_4_pcntshare / 100);
if (business_5_pcntshare > 0) then business_5_pcntshare = (business_5_pcntshare / 100);
if (realestate_1_pcntshare > 0) then realestate_1_pcntshare = (realestate_1_pcntshare / 100);
if (realestate_2_pcntshare > 0) then realestate_2_pcntshare = (realestate_2_pcntshare / 100);
if (realestate_3_pcntshare > 0) then realestate_3_pcntshare = (realestate_3_pcntshare / 100);
if (realestate_4_pcntshare > 0) then realestate_4_pcntshare = (realestate_4_pcntshare / 100);

if (farm_1_value1 >= 0 & farm_1_pcntshare >= 0) then farm_1_value = (farm_1_value1 * farm_1_pcntshare);
if (farm_2_value1 >= 0 & farm_2_pcntshare >= 0) then farm_2_value = (farm_2_value1 * farm_2_pcntshare);
if (business_1_value1 >= 0 & business_1_pcntshare >= 0) then business_1_value = (business_1_value1 * business_1_pcntshare);
if (business_2_value1 >= 0 & business_2_pcntshare >= 0) then business_2_value = (business_2_value1 * business_2_pcntshare);
if (business_3_value1 >= 0 & business_3_pcntshare >= 0) then business_3_value = (business_3_value1 * business_3_pcntshare);
if (business_4_value1 >= 0 & business_4_pcntshare >= 0) then business_4_value = (business_4_value1 * business_4_pcntshare);
if (business_5_value1 >= 0 & business_5_pcntshare >= 0) then business_5_value = (business_5_value1 * business_5_pcntshare);
if (realestate_1_value1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_value = (realestate_1_value1 * realestate_1_pcntshare);
if (realestate_2_value1 >= 0 & realestate_2_pcntshare >= 0) then realestate_2_value = (realestate_2_value1 * realestate_2_pcntshare);
if (realestate_3_value1 >= 0 & realestate_3_pcntshare >= 0) then realestate_3_value = (realestate_3_value1 * realestate_3_pcntshare);
if (realestate_4_value1 >= 0 & realestate_4_pcntshare >= 0) then realestate_4_value = (realestate_4_value1 * realestate_4_pcntshare);


/*******************************/
/* Add components BIZ */
/*******************************/

if (solebiz >= 0) then bizc = (bizc + solebiz); 
if (farm_1_value >= 0) then bizc = (bizc + farm_1_value);
if (farm_2_value >= 0) then bizc = (bizc + farm_2_value);
if (business_1_value >= 0) then bizc = (bizc + business_1_value);
if (business_2_value >= 0) then bizc = (bizc + business_2_value);
if (business_3_value >= 0) then bizc = (bizc + business_3_value);
if (business_4_value >= 0) then bizc = (bizc + business_4_value);
if (business_5_value >= 0) then bizc = (bizc + business_5_value);
if (realestate_1_value >= 0) then bizc = (bizc + realestate_1_value);
if (realestate_2_value >= 0) then bizc = (bizc + realestate_2_value);
if (realestate_3_value >= 0) then bizc = (bizc + realestate_3_value);
if (realestate_4_value >= 0) then bizc = (bizc + realestate_4_value);

if (solebiz in(-1, -2, -3)) then bizc = -3;
if (farm_1_value1 in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (farm_2_value1 in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_1_value1 in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_2_value1 in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_3_value1 in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_4_value1 in(-1, -2, -3) | business_4_pcntshare in(-1, -2, -3)) then bizc = -3;
if (business_5_value1 in(-1, -2, -3) | business_5_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_1_value1 in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_2_value1 in(-1, -2, -3) | realestate_2_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_3_value1 in(-1, -2, -3) | realestate_3_pcntshare in(-1, -2, -3)) then bizc = -3;
if (realestate_4_value1 in(-1, -2, -3) | realestate_4_pcntshare in(-1, -2, -3)) then bizc = -3;


/****************************/
/* Compute BDEBT */
/****************************/

/**************************************/
/* BDEBT Component - debtbiz: */
/**************************************/

if (q13_132_trunc >= 0) then debtbiz = (debtbiz + q13_132_trunc);
else if (q13_132_trunc = 1 & q13_132_ref_1 = 1 & q13_132_sr000001 < 0 & q13_132_sr000002 < 0 
& q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = -1;
else if (q13_132_trunc in(-1, -2) & (q13_132_sr000001 < 0 | q13_132_sr000002 < 0) 
& q13_132_uab_a < 0 & q13_132_uab_c < 0) then debtbiz = q13_132_trunc;
else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 = q13_132_sr000001) then 
debtbiz = (debtbiz + q13_132_sr000001);
else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 > q13_132_sr000001) then 
debtbiz = (debtbiz + (((q13_132_sr000002 - q13_132_sr000001)/2) + q13_132_sr000001));
else if (q13_132_sr000001 >= 0 & q13_132_sr000002 >= 0 & q13_132_sr000002 < q13_132_sr000001) then 
debtbiz = (debtbiz + (((q13_132_sr000001 - q13_132_sr000002)/2) + q13_132_sr000002));
else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 0) then debtbiz = (debtbiz + quartile3);
else if (q13_132_trunc in(-1, -2, -4) & q13_132_uab_c = 1) then debtbiz = (debtbiz + 187000);
else if (q13_132_uab_a in(-1, -2) | q13_132_uab_c in(-1, -2)) then debtbiz = -3;

/*********************************************************************************/
/* BDEBT Components - farm_#_debt, business_#_debt, realestate_#_debt */
/*********************************************************************************/

if (q13_fjt_12_01 > -4) then farm_1_debt1 = q13_fjt_12_01;
if (q13_fjt_12_02 > -4) then farm_2_debt1 = q13_fjt_12_02;
if (q13_bppjt_12_trunc_01 > -4) then business_1_debt1 = q13_bppjt_12_trunc_01;
if (q13_bppjt_12_trunc_02 > -4) then business_2_debt1 = q13_bppjt_12_trunc_02;
if (q13_bppjt_12_trunc_03 > -4) then business_3_debt1 = q13_bppjt_12_trunc_03;
if (q13_bppjt_12_04 > -4) then business_4_debt1 = q13_bppjt_12_04;
if (q13_bppjt_12_05 > -4) then business_5_debt1 = q13_bppjt_12_05;
if (q13_rejt_12_trunc > -4) then realestate_1_debt1 = q13_rejt_12_trunc;

if (farm_1_debt1 >= 0 & farm_1_pcntshare >= 0) then farm_1_debt = (farm_1_debt1 * farm_1_pcntshare);
if (farm_2_debt1 >= 0 & farm_2_pcntshare >= 0) then farm_2_debt = (farm_2_debt1 * farm_2_pcntshare);
if (business_1_debt1 >= 0 & business_1_pcntshare >= 0) then business_1_debt = (business_1_debt1 * business_1_pcntshare);
if (business_2_debt1 >= 0 & business_2_pcntshare >= 0) then business_2_debt = (business_2_debt1 * business_2_pcntshare);
if (business_3_debt1 >= 0 & business_3_pcntshare >= 0) then business_3_debt = (business_3_debt1 * business_3_pcntshare);
if (business_4_debt1 >= 0 & business_4_pcntshare >= 0) then business_4_debt = (business_4_debt1 * business_4_pcntshare);
if (business_5_debt1 >= 0 & business_5_pcntshare >= 0) then business_5_debt = (business_5_debt1 * business_5_pcntshare);
if (realestate_1_debt1 >= 0 & realestate_1_pcntshare >= 0) then realestate_1_debt = (realestate_1_debt1 * realestate_1_pcntshare);


/*******************************/
/* Add components BDEBT */
/*******************************/

if (debtbiz >= 0) then bdebtc = (bdebtc + debtbiz); 
if (farm_1_debt >= 0) then bdebtc = (bdebtc + farm_1_debt);
if (farm_2_debt >= 0) then bdebtc = (bdebtc + farm_2_debt);
if (business_1_debt >= 0) then bdebtc = (bdebtc + business_1_debt);
if (business_2_debt >= 0) then bdebtc = (bdebtc + business_2_debt);
if (business_3_debt >= 0) then bdebtc = (bdebtc + business_3_debt);
if (business_4_debt >= 0) then bdebtc = (bdebtc + business_4_debt);
if (business_5_debt >= 0) then bdebtc = (bdebtc + business_5_debt);
if (realestate_1_debt >= 0) then bdebtc = (bdebtc + realestate_1_debt);

if (debtbiz in(-1, -2, -3)) then bdebtc = -3; 
if (farm_1_debt1 in(-1, -2, -3) | farm_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (farm_2_debt1 in(-1, -2, -3) | farm_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_1_debt1 in(-1, -2, -3) | business_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_2_debt1 in(-1, -2, -3) | business_2_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_3_debt1 in(-1, -2, -3) | business_3_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_4_debt1 in(-1, -2, -3) | business_4_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (business_5_debt1 in(-1, -2, -3) | business_5_pcntshare in(-1, -2, -3)) then bdebtc = -3;
if (realestate_1_debt1 in(-1, -2, -3) | realestate_1_pcntshare in(-1, -2, -3)) then bdebtc = -3;


/****************************/
/* Compute CASH */
/****************************/

/**********************************/
/* CASH Component - cash: */
/**********************************/

if (fa_1 = 1 & fa_1a_trunc >= 0) then cashc = (cashc + fa_1a_trunc);
else if (fa_1 = 1 & fa_1_ref_1 = 1 & fa_1a_sr000001 < 0 & fa_1a_sr000002 < 0 
& fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = -1;
else if (fa_1 = 1 & fa_1a_trunc in(-1, -2) & (fa_1a_sr000001 < 0 | fa_1a_sr000002 < 0) 
& fa_1a_uab_a < 0 & fa_1a_uab_b < 0 & fa_1a_uab_c < 0) then cashc = fa_1a_trunc;
else if (fa_1a_sr000001 >= 0 & fa_1a_sr000002 >= 0 & fa_1a_sr000002 = fa_1a_sr000001) then 
cashc = (cashc + fa_1a_sr000001);
else if (fa_1a_sr000001 >= 0 & fa_1a_sr000002 >= 0 & fa_1a_sr000002 > fa_1a_sr000001) then 
cashc = (cashc + (((fa_1a_sr000002 - fa_1a_sr000001)/2) + fa_1a_sr000001));
else if (fa_1a_sr000001 >= 0 & fa_1a_sr000002 >= 0 & fa_1a_sr000002 < fa_1a_sr000001) then 
cashc = (cashc + (((fa_1a_sr000001 - fa_1a_sr000002)/2) + fa_1a_sr000002));
else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 0) then cashc = (cashc + quartile1);
else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_b = 1) then cashc = (cashc + quartile2);
else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 0) then cashc = (cashc + quartile3);
else if (fa_1a_trunc in(-1, -2, -4) & fa_1a_uab_c = 1) then cashc = (cashc + 90000);
else if (fa_1a_uab_a in(-1, -2) | fa_1a_uab_b in(-1, -2) | fa_1a_uab_c in(-1, -2)) then cashc = -3;


/*************************************************************/
/* No need to add components for CASHC - set -3 missing */
/*************************************************************/

if (cashc in(-1, -2, -3)) then cashc = -3;


/****************************/
/* Compute CDS */
/****************************/

/**********************************/
/* CDS Component - cds: */
/**********************************/

if (fa_2 = 1 & fa_2a_trunc >= 0) then cdsc = (cdsc + fa_2a_trunc);
else if (fa_2 = 1 & fa_2_ref_1 = 1 & fa_2a_sr000001 < 0 & fa_2a_sr000002 < 0 
& fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = -1;
else if (fa_2 = 1 & fa_2a_trunc in(-1, -2) & (fa_2a_sr000001 < 0 | fa_2a_sr000002 < 0) 
& fa_2a_uab_a < 0 & fa_2a_uab_b < 0 & fa_2a_uab_c < 0) then cdsc = fa_2a_trunc;
else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 = fa_2a_sr000001) then 
cdsc = (cdsc + fa_2a_sr000001);
else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 > fa_2a_sr000001) then 
cdsc = (cdsc + (((fa_2a_sr000002 - fa_2a_sr000001)/2) + fa_2a_sr000001));
else if (fa_2a_sr000001 >= 0 & fa_2a_sr000002 >= 0 & fa_2a_sr000002 < fa_2a_sr000001) then 
cdsc = (cdsc + (((fa_2a_sr000001 - fa_2a_sr000002)/2) + fa_2a_sr000002));
else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 0) then cdsc = (cdsc + quartile1);
else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_b = 1) then cdsc = (cdsc + quartile2);
else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 0) then cdsc = (cdsc + quartile3);
else if (fa_2a_trunc in(-1, -2, -4) & fa_2a_uab_c = 1) then cdsc = (cdsc + 100000);
else if (fa_2a_uab_a in(-1, -2) | fa_2a_uab_b in(-1, -2) | fa_2a_uab_c in(-1, -2)) then cdsc = -3;

/*************************************************************/
/* No need to add components for CDSC - set -3 missing */
/*************************************************************/

if (cdsc in(-1, -2, -3)) then cdsc = -3;


/****************************/
/* Compute STOCK */
/****************************/

/***************************************/
/* STOCK Component - govbonds: */
/***************************************/

if (fa_3 = 1 & fa_3a >= 0) then govbonds = (govbonds + fa_3a);
else if (fa_3 = 1 & fa_3_ref_1 = 1 & fa_3a_sr000001 < 0 & fa_3a_sr000002 < 0 
& fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = -1;
else if (fa_3 = 1 & fa_3a in(-1, -2) & (fa_3a_sr000001 < 0 | fa_3a_sr000002 < 0) 
& fa_3a_uab_a < 0 & fa_3a_uab_b < 0 & fa_3a_uab_c < 0) then govbonds = fa_3a;
else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 = fa_3a_sr000001) then 
govbonds = (govbonds + fa_3a_sr000001);
else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 > fa_3a_sr000001) then 
govbonds = (govbonds + (((fa_3a_sr000002 - fa_3a_sr000001)/2) + fa_3a_sr000001));
else if (fa_3a_sr000001 >= 0 & fa_3a_sr000002 >= 0 & fa_3a_sr000002 < fa_3a_sr000001) then 
govbonds = (govbonds + (((fa_3a_sr000001 - fa_3a_sr000002)/2) + fa_3a_sr000002));
else if (fa_3a in(-1, -2, -4) & fa_3a_uab_b = 0) then govbonds = (govbonds + quartile1);
else if (fa_3a in(-1, -2, -4) & fa_3a_uab_b = 1) then govbonds = (govbonds + quartile2);
else if (fa_3a in(-1, -2, -4) & fa_3a_uab_c = 0) then govbonds = (govbonds + quartile3);
else if (fa_3a in(-1, -2, -4) & fa_3a_uab_c = 1) then govbonds = (govbonds + 85000);
else if (fa_3a_uab_a in(-1, -2) | fa_3a_uab_b in(-1, -2) | fa_3a_uab_c in(-1, -2)) then govbonds = -3;

/***************************************/
/* STOCK Component - mutual: */
/***************************************/

if (fa_4 = 1 & fa_4a_trunc >= 0) then mutual = (mutual + fa_4a_trunc);
else if (fa_4 = 1 & fa_4_ref_1 = 1 & fa_4a_sr000001 < 0 & fa_4a_sr000002 < 0 
& fa_4a_uab_a < 0 & fa_4a_uab_c < 0) then mutual = -1;
else if (fa_4 = 1 & fa_4a_trunc in(-1, -2) & (fa_4a_sr000001 < 0 | fa_4a_sr000002 < 0) 
& fa_4a_uab_a < 0 & fa_4a_uab_c < 0) then mutual = fa_4a_trunc;
else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 = fa_4a_sr000001) then 
mutual = (mutual + fa_4a_sr000001);
else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 > fa_4a_sr000001) then 
mutual = (mutual + (((fa_4a_sr000002 - fa_4a_sr000001)/2) + fa_4a_sr000001));
else if (fa_4a_sr000001 >= 0 & fa_4a_sr000002 >= 0 & fa_4a_sr000002 < fa_4a_sr000001) then 
mutual = (mutual + (((fa_4a_sr000001 - fa_4a_sr000002)/2) + fa_4a_sr000002));
else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 0) then mutual = (mutual + quartile3);
else if (fa_4a_trunc in(-1, -2, -4) & fa_4a_uab_c = 1) then mutual = (mutual + 250000);
else if (fa_4a_uab_a in(-1, -2) | fa_4a_uab_c in(-1, -2)) then mutual = -3;

/*******************************************/
/* STOCK Component - lifeinsure: */
/*******************************************/

if (fa_5 = 1 & fa_5a_trunc >= 0) then lifeinsure = (lifeinsure + fa_5a_trunc);
else if (fa_5 = 1 & fa_5_ref_1 = 1 & fa_5a_sr000001 < 0 & fa_5a_sr000002_trunc < 0 
& fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = -1;
else if (fa_5 = 1 & fa_5a_trunc in(-1, -2) & (fa_5a_sr000001 < 0 | fa_5a_sr000002_trunc < 0) 
& fa_5a_uab_a < 0 & fa_5a_uab_b < 0 & fa_5a_uab_c < 0) then lifeinsure = fa_5a_trunc;
else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc >= 0 & fa_5a_sr000002_trunc = fa_5a_sr000001) then 
lifeinsure = (lifeinsure + fa_5a_sr000001);
else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc >= 0 & fa_5a_sr000002_trunc > fa_5a_sr000001) then 
lifeinsure = (lifeinsure + (((fa_5a_sr000002_trunc - fa_5a_sr000001)/2) + fa_5a_sr000001));
else if (fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc >= 0 & fa_5a_sr000002_trunc < fa_5a_sr000001) then 
lifeinsure = (lifeinsure + (((fa_5a_sr000001 - fa_5a_sr000002_trunc)/2) + fa_5a_sr000002_trunc));
else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 0) then lifeinsure = (lifeinsure + quartile1);
else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_b = 1) then lifeinsure = (lifeinsure + quartile2);
else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 0) then lifeinsure = (lifeinsure + quartile3);
else if (fa_5a_trunc in(-1, -2, -4) & fa_5a_uab_c = 1) then lifeinsure = (lifeinsure + 100000);
else if (fa_5a_uab_a in(-1, -2) | fa_5a_uab_b in(-1, -2) | fa_5a_uab_c in(-1, -2)) then lifeinsure = -3;

/***************************************/
/* STOCK Component - shares: */
/***************************************/

if (fa_9 = 1 & fa_9a_trunc >= 0) then shares = (shares + fa_9a_trunc);
else if (fa_9 = 1 & fa_9_ref_1 = 1 & fa_9a_sr000001_trunc < 0 & fa_9a_sr000002 < 0 
& fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = -1;
else if (fa_9 = 1 & fa_9a_trunc in(-1, -2) & (fa_9a_sr000001_trunc < 0 | fa_9a_sr000002 < 0) 
& fa_9a_uab_a < 0 & fa_9a_uab_b < 0 & fa_9a_uab_c < 0) then shares = fa_9a_trunc;
else if (fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 = fa_9a_sr000001_trunc) then 
shares = (shares + fa_9a_sr000001_trunc);
else if (fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 > fa_9a_sr000001_trunc) then 
shares = (shares + (((fa_9a_sr000002 - fa_9a_sr000001_trunc)/2) + fa_9a_sr000001_trunc));
else if (fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 >= 0 & fa_9a_sr000002 < fa_9a_sr000001_trunc) then 
shares = (shares + (((fa_9a_sr000001_trunc - fa_9a_sr000002)/2) + fa_9a_sr000002));
else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 0) then shares = (shares + quartile1);
else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_b = 1) then shares = (shares + quartile2);
else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 0) then shares = (shares + quartile3);
else if (fa_9a_trunc in(-1, -2, -4) & fa_9a_uab_c = 1) then shares = (shares + 200000);
else if (fa_9a_uab_a in(-1, -2) | fa_9a_uab_b in(-1, -2) | fa_9a_uab_c in(-1, -2)) then shares = -3;

/****************************************/
/* STOCK Component - corpbond: */
/****************************************/

if (fa_10 = 1 & fa_10a_trunc >= 0) then corpbond = (corpbond + fa_10a_trunc);
else if (fa_10 = 1 & fa_10_ref_1 = 1 & fa_10a_sr000001_trunc < 0 & fa_10a_sr000002_trunc < 0
& fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = -1;
else if (fa_10 = 1 & fa_10a_trunc in(-1, -2) & (fa_10a_sr000001_trunc < 0 | fa_10a_sr000002_trunc < 0) 
& fa_10a_uab_a < 0 & fa_10a_uab_b < 0 & fa_10a_uab_c < 0) then corpbond = fa_10a_trunc;
else if (fa_10a_sr000001_trunc >= 0 & fa_10a_sr000002_trunc >= 0 & fa_10a_sr000002_trunc = fa_10a_sr000001_trunc) then 
corpbond = (corpbond + fa_10a_sr000001_trunc);
else if (fa_10a_sr000001_trunc >= 0 & fa_10a_sr000002_trunc >= 0 & fa_10a_sr000002_trunc > fa_10a_sr000001_trunc) then 
corpbond = (corpbond + (((fa_10a_sr000002_trunc - fa_10a_sr000001_trunc)/2) + fa_10a_sr000001_trunc));
else if (fa_10a_sr000001_trunc >= 0 & fa_10a_sr000002_trunc >= 0 & fa_10a_sr000002_trunc < fa_10a_sr000001_trunc) then 
corpbond = (corpbond + (((fa_10a_sr000001_trunc - fa_10a_sr000002_trunc)/2) + fa_10a_sr000002_trunc));
else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 0) then corpbond = (corpbond + quartile1);
else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_b = 1) then corpbond = (corpbond + quartile2);
else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 0) then corpbond = (corpbond + quartile3);
else if (fa_10a_trunc in(-1, -2, -4) & fa_10a_uab_c = 1) then corpbond = (corpbond + 200000);
else if (fa_10a_uab_a in(-1, -2) | fa_10a_uab_b in(-1, -2) | fa_10a_uab_c in(-1, -2)) then corpbond = -3;

/******************************************/
/* STOCK Component - moneyowedtor: */
/******************************************/

if (fa_11 = 1 & fa_11a >= 0) then moneyowedtor = (moneyowedtor + fa_11a);
else if (fa_11 = 1 & fa_11_ref_1 = 1 & fa_11a_sr000001 < 0 & fa_11a_sr000002 < 0 
& fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = -1;
else if (fa_11 = 1 & fa_11a in(-1, -2) & (fa_11a_sr000001 < 0 | fa_11a_sr000002 < 0) 
& fa_11a_uab_a < 0 & fa_11a_uab_b < 0 & fa_11a_uab_c < 0) then moneyowedtor = fa_11a;
else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 = fa_11a_sr000001) then 
moneyowedtor = (moneyowedtor + fa_11a_sr000001);
else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 > fa_11a_sr000001) then 
moneyowedtor = (moneyowedtor + (((fa_11a_sr000002 - fa_11a_sr000001)/2) + fa_11a_sr000001));
else if (fa_11a_sr000001 >= 0 & fa_11a_sr000002 >= 0 & fa_11a_sr000002 < fa_11a_sr000001) then 
moneyowedtor = (moneyowedtor + (((fa_11a_sr000001 - fa_11a_sr000002)/2) + fa_11a_sr000002));
else if (fa_11a in(-1, -2, -4) & fa_11a_uab_b = 0) then moneyowedtor = (moneyowedtor + quartile1);
else if (fa_11a in(-1, -2, -4) & fa_11a_uab_b = 1) then moneyowedtor = (moneyowedtor + quartile2);
else if (fa_11a in(-1, -2, -4) & fa_11a_uab_c = 0) then moneyowedtor = (moneyowedtor + quartile3);
else if (fa_11a in(-1, -2, -4) & fa_11a_uab_c = 1) then moneyowedtor = (moneyowedtor + 90000);
else if (fa_11a_uab_a in(-1, -2) | fa_11a_uab_b in(-1, -2) | fa_11a_uab_c in(-1, -2)) then moneyowedtor = -3;

/*******************************/
/* Add components STOCK */
/*******************************/

if (govbonds >= 0) then stockc = (stockc + govbonds); 
if (mutual >= 0) then stockc = (stockc + mutual);
if (lifeinsure >= 0) then stockc = (stockc + lifeinsure);
if (shares >= 0) then stockc = (stockc + shares);
if (corpbond >= 0) then stockc = (stockc + corpbond);
if (moneyowedtor >= 0) then stockc = (stockc + moneyowedtor);
if (govbonds in(-1, -2, -3)) then stockc = -3;
else if (mutual in(-1, -2, -3)) then stockc = -3;
else if (lifeinsure in(-1, -2, -3)) then stockc = -3;
else if (shares in(-1, -2, -3)) then stockc = -3;
else if (corpbond in(-1, -2, -3)) then stockc = -3;
else if (moneyowedtor in(-1, -2, -3)) then stockc = -3;


/****************************/
/* Compute HOME */
/****************************/

/**********************************/
/* HOME Component - home1: */
/**********************************/

if (nfa_1 = 1 & nfa_1a_trunc >= 0) then home1 = (home1 + nfa_1a_trunc);
else if (nfa_1 = 1 & nfa_1_ref_1 = 1 & nfa_1a_sr000001 < 0 & nfa_1a_sr000002 < 0 
& nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = -1;
else if (nfa_1 = 1 & nfa_1a_trunc in(-1, -2) & (nfa_1a_sr000001 < 0 | nfa_1a_sr000002 < 0) 
& nfa_1a_uab_a < 0 & nfa_1a_uab_b < 0 & nfa_1a_uab_c < 0) then home1 = nfa_1a_trunc;
else if (nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 = nfa_1a_sr000001) then 
home1 = (home1 + nfa_1a_sr000001);
else if (nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 > nfa_1a_sr000001) then 
home1 = (home1 + (((nfa_1a_sr000002 - nfa_1a_sr000001)/2) + nfa_1a_sr000001));
else if (nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 >= 0 & nfa_1a_sr000002 < nfa_1a_sr000001) then 
home1 = (home1 + (((nfa_1a_sr000001 - nfa_1a_sr000002)/2) + nfa_1a_sr000002));
else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 0) then home1 = (home1 + quartile1);
else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_b = 1) then home1 = (home1 + quartile2);
else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 0) then home1 = (home1 + quartile3);
else if (nfa_1a_trunc in(-1, -2, -4) & nfa_1a_uab_c = 1) then home1 = (home1 + 250000);
else if (nfa_1a_uab_a in(-1, -2) | nfa_1a_uab_b in(-1, -2) | nfa_1a_uab_c in(-1, -2)) then home1 = -3;

/************************************/
/* HOME Component - secondhome: */
/************************************/

if (nfa_2 = 1 & nfa_2a_trunc >= 0) then secondhome = (secondhome + nfa_2a_trunc);
else if (nfa_2 = 1 & nfa_2_ref_1 = 1 & nfa_2a_sr000001 < 0 & nfa_2a_sr000002 < 0 
& nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = -1;
else if (nfa_2 = 1 & nfa_2a_trunc in(-1, -2) & (nfa_2a_sr000001 < 0 | nfa_2a_sr000002 < 0) 
& nfa_2a_uab_a < 0 & nfa_2a_uab_b < 0 & nfa_2a_uab_c < 0) then secondhome = nfa_2a_trunc;
else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 = nfa_2a_sr000001) then 
secondhome = (secondhome + nfa_2a_sr000001);
else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 > nfa_2a_sr000001) then 
secondhome = (secondhome + (((nfa_2a_sr000002 - nfa_2a_sr000001)/2) + nfa_2a_sr000001));
else if (nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 >= 0 & nfa_2a_sr000002 < nfa_2a_sr000001) then 
secondhome = (secondhome + (((nfa_2a_sr000001 - nfa_2a_sr000002)/2) + nfa_2a_sr000002));
else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 0) then secondhome = (secondhome + quartile1);
else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_b = 1) then secondhome = (secondhome + quartile2);
else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 0) then secondhome = (secondhome + quartile3);
else if (nfa_2a_trunc in(-1, -2, -4) & nfa_2a_uab_c = 1) then secondhome = (secondhome + 200000);
else if (nfa_2a_uab_a in(-1, -2) | nfa_2a_uab_b in(-1, -2) | nfa_2a_uab_c in(-1, -2)) then secondhome = -3;

/*******************************/
/* Add components HOME */
/*******************************/

if (home1 >= 0) then homec = (homec + home1); 
if (secondhome >= 0) then homec = (homec + secondhome);
if (home1 in(-1, -2, -3)) then homec = -3;
else if (secondhome in(-1, -2, -3)) then homec = -3;


/****************************/
/* Compute MORT */
/****************************/

/*************************************/
/* MORT Component - mort1: */
/*************************************/

if (nfa_1b_trunc >= 0) then mort1 = (mort1 + nfa_1b_trunc);
else if (nfa_1b_ref_1 = 1 & nfa_1b_sr000001 < 0 & nfa_1b_sr000002 < 0 
& nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = -1;
else if (nfa_1b_trunc in(-1, -2) & (nfa_1b_sr000001 < 0 | nfa_1b_sr000002 < 0) 
& nfa_1b_uab_a < 0 & nfa_1b_uab_b < 0 & nfa_1b_uab_c < 0) then mort1 = nfa_1b_trunc;
else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 = nfa_1b_sr000001) then 
mort1 = (mort1 + nfa_1b_sr000001);
else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 > nfa_1b_sr000001) then 
mort1 = (mort1 + (((nfa_1b_sr000002 - nfa_1b_sr000001)/2) + nfa_1b_sr000001));
else if (nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 >= 0 & nfa_1b_sr000002 < nfa_1b_sr000001) then 
mort1 = (mort1 + (((nfa_1b_sr000001 - nfa_1b_sr000002)/2) + nfa_1b_sr000002));
else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 0) then mort1 = (mort1 + quartile1);
else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_b = 1) then mort1 = (mort1 + quartile2);
else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 0) then mort1 = (mort1 + quartile3);
else if (nfa_1b_trunc in(-1, -2, -4) & nfa_1b_uab_c = 1) then mort1 = (mort1 + 125000);
else if (nfa_1b_uab_a in(-1, -2) | nfa_1b_uab_b in(-1, -2) | nfa_1b_uab_c in(-1, -2)) then mort1 = -3;


/*****************************************/
/* MORT Component - secondmort: */
/*****************************************/

if (nfa_2b_trunc >= 0) then secondmort = (secondmort + nfa_2b_trunc);
else if (nfa_2b_ref_1 = 1 & nfa_2b_sr000001 < 0 & nfa_2b_sr000002 < 0 
& nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = -1;
else if (nfa_2b_trunc in(-1, -2) & (nfa_2b_sr000001 < 0 | nfa_2b_sr000002 < 0) 
& nfa_2b_uab_a < 0 & nfa_2b_uab_b < 0 & nfa_2b_uab_c < 0) then secondmort = nfa_2b_trunc;
else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 = nfa_2b_sr000001) then 
secondmort = (secondmort + nfa_2b_sr000001);
else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 > nfa_2b_sr000001) then 
secondmort = (secondmort + (((nfa_2b_sr000002 - nfa_2b_sr000001)/2) + nfa_2b_sr000001));
else if (nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 >= 0 & nfa_2b_sr000002 < nfa_2b_sr000001) then 
secondmort = (secondmort + (((nfa_2b_sr000001 - nfa_2b_sr000002)/2) + nfa_2b_sr000002));
else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 0) then secondmort = (secondmort + quartile1);
else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_b = 1) then secondmort = (secondmort + quartile2);
else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 0) then secondmort = (secondmort + quartile3);
else if (nfa_2b_trunc in(-1, -2, -4) & nfa_2b_uab_c = 1) then secondmort = (secondmort + 135000);
else if (nfa_2b_uab_a in(-1, -2) | nfa_2b_uab_b in(-1, -2) | nfa_2b_uab_c in(-1, -2)) then secondmort = -3;

/*******************************/
/* Add components MORT */
/*******************************/

if (mort1 >= 0) then mortc = (mortc + mort1); 
if (secondmort >= 0) then mortc = (mortc + secondmort);
if (mort1 in(-1, -2, -3)) then mortc = -3;
else if (secondmort in(-1, -2, -3)) then mortc = -3;


/****************************/
/* Compute PDEBT */
/****************************/

/**************************************/
/* PDEBT Component - pdebt1: */
/**************************************/

if (nfa_1c >= 0) then pdebt1 = (pdebt1 + nfa_1c);
else if (nfa_1c_ref_1 = 1 & nfa_1c_sr000001 < 0 & nfa_1c_sr000002 < 0 
& nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = -1;
else if (nfa_1c in(-1, -2) & (nfa_1c_sr000001 < 0 | nfa_1c_sr000002 < 0) 
& nfa_1c_uab_a < 0 & nfa_1c_uab_b < 0 & nfa_1c_uab_c < 0) then pdebt1 = nfa_1c;
else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 = nfa_1c_sr000001) then 
pdebt1 = (pdebt1 + nfa_1c_sr000001);
else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 > nfa_1c_sr000001) then 
pdebt1 = (pdebt1 + (((nfa_1c_sr000002 - nfa_1c_sr000001)/2) + nfa_1c_sr000001));
else if (nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 >= 0 & nfa_1c_sr000002 < nfa_1c_sr000001) then 
pdebt1 = (pdebt1 + (((nfa_1c_sr000001 - nfa_1c_sr000002)/2) + nfa_1c_sr000002));
else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 0) then pdebt1 = (pdebt1 + quartile1);
else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_b = 1) then pdebt1 = (pdebt1 + quartile2);
else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 0) then pdebt1 = (pdebt1 + quartile3);
else if (nfa_1c in(-1, -2, -4) & nfa_1c_uab_c = 1) then pdebt1 = (pdebt1 + 55000);
else if (nfa_1c_uab_a in(-1, -2) | nfa_1c_uab_b in(-1, -2) | nfa_1c_uab_c in(-1, -2)) then pdebt1 = -3;

/*******************************************/
/* PDEBT Component - secondpdebt: */
/*******************************************/

if (nfa_2c >= 0) then secondpdebt = (secondpdebt + nfa_2c);
else if (nfa_2c_ref_1 = 1 & nfa_2c_sr000001 < 0 & nfa_2c_sr000002 < 0 
& nfa_2c_uab_a < 0 & nfa_2c_uab_b < 0 & nfa_2c_uab_c < 0) then secondpdebt = -1;
else if (nfa_2c in(-1, -2) & (nfa_2c_sr000001 < 0 | nfa_2c_sr000002 < 0) 
& nfa_2c_uab_a < 0 & nfa_2c_uab_b < 0 & nfa_2c_uab_c < 0) then secondpdebt = nfa_2c;
else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 = nfa_2c_sr000001) then 
secondpdebt = (secondpdebt + nfa_2c_sr000001);
else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 > nfa_2c_sr000001) then 
secondpdebt = (secondpdebt + (((nfa_2c_sr000002 - nfa_2c_sr000001)/2) + nfa_2c_sr000001));
else if (nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 >= 0 & nfa_2c_sr000002 < nfa_2c_sr000001) then 
secondpdebt = (secondpdebt + (((nfa_2c_sr000001 - nfa_2c_sr000002)/2) + nfa_2c_sr000002));
else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_b = 0) then secondpdebt = (secondpdebt + quartile1);
else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_b = 1) then secondpdebt = (secondpdebt + quartile2);
else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_c = 0) then secondpdebt = (secondpdebt + quartile3);
else if (nfa_2c in(-1, -2, -4) & nfa_2c_uab_c = 1) then secondpdebt = (secondpdebt + 47500);
else if (nfa_2c_uab_a in(-1, -2) | nfa_2c_uab_b in(-1, -2) | nfa_2c_uab_c in(-1, -2)) then secondpdebt = -3;

/*******************************/
/* Add components PDEBT */
/*******************************/

if (pdebt1 >= 0) then pdebtc = (pdebtc + pdebt1); 
if (secondpdebt >= 0) then pdebtc = (pdebtc + secondpdebt);
if (pdebt1 in(-1, -2, -3)) then pdebtc = -3;
else if (secondpdebt in(-1, -2, -3)) then pdebtc = -3;


/****************************/
/* Compute IRA */
/****************************/

/**********************************/
/* IRA Component - ira1: */
/**********************************/

if (fa_8 = 1 & fa_8d_trunc_01 >= 0) then ira1 = (ira1 + fa_8d_trunc_01);
else if (fa_8 = 1 & fa_8d_trunc_01 in(-1, -2) & (fa_8d_sr000001_01 < 0 | fa_8d_sr000002_01 < 0) 
& fa_8d_uab_a_01 < 0 & fa_8d_uab_b_01 < 0 & fa_8d_uab_c_01 < 0) then ira1 = fa_8d_trunc_01;
else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 = fa_8d_sr000001_01) then 
ira1 = (ira1 + fa_8d_sr000001_01);
else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 > fa_8d_sr000001_01) then 
ira1 = (ira1 + (((fa_8d_sr000002_01 - fa_8d_sr000001_01)/2) + fa_8d_sr000001_01));
else if (fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 >= 0 & fa_8d_sr000002_01 < fa_8d_sr000001_01) then 
ira1 = (ira1 + (((fa_8d_sr000001_01 - fa_8d_sr000002_01)/2) + fa_8d_sr000002_01));
else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 0) then ira1 = (ira1 + quartile1);
else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_b_01 = 1) then ira1 = (ira1 + quartile2);
else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 0) then ira1 = (ira1 + quartile3);
else if (fa_8d_trunc_01 in(-1, -2, -4) & fa_8d_uab_c_01 = 1) then ira1 = (ira1 + 200000);
else if (fa_8d_uab_a_01 in(-1, -2) | fa_8d_uab_b_01 in(-1, -2) | fa_8d_uab_c_01 in(-1, -2)) then ira1 = -3;

/*********************************/
/* IRA Component - ira2: */
/*********************************/

if (fa_8 = 1 & fa_8d_trunc_02 >= 0) then ira2 = (ira2 + fa_8d_trunc_02);
else if (fa_8 = 1 & fa_8d_trunc_02 in(-1, -2) & (fa_8d_sr000001_02 < 0 | fa_8d_sr000002_02 < 0) 
& fa_8d_uab_a_02 < 0 & fa_8d_uab_b_02 < 0 & fa_8d_uab_c_02 < 0) then ira2 = fa_8d_trunc_02;
else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 = fa_8d_sr000001_02) then 
ira2 = (ira2 + fa_8d_sr000001_02);
else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 > fa_8d_sr000001_02) then 
ira2 = (ira2 + (((fa_8d_sr000002_02 - fa_8d_sr000001_02)/2) + fa_8d_sr000001_02));
else if (fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 >= 0 & fa_8d_sr000002_02 < fa_8d_sr000001_02) then 
ira2 = (ira2 + (((fa_8d_sr000001_02 - fa_8d_sr000002_02)/2) + fa_8d_sr000002_02));
else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 0) then ira2 = (ira2 + quartile1);
else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_b_02 = 1) then ira2 = (ira2 + quartile2);
else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 0) then ira2 = (ira2 + quartile3);
else if (fa_8d_trunc_02 in(-1, -2, -4) & fa_8d_uab_c_02 = 1) then ira2 = (ira2 + 100000);
else if (fa_8d_uab_a_02 in(-1, -2) | fa_8d_uab_b_02 in(-1, -2) | fa_8d_uab_c_02 in(-1, -2)) then ira2 = -3;


/*********************************/
/* IRA Component - ira3: */
/*********************************/

if (fa_8 = 1 & fa_8d_03 >= 0) then ira3 = (ira3 + fa_8d_03);
else if (fa_8 = 1 & fa_8d_03 in(-1, -2) & fa_8d_uab_a_03 < 0 & fa_8d_uab_c_03 < 0) then ira3 = fa_8d_03;
else if (fa_8d_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 0) then ira3 = (ira3 + quartile3);
else if (fa_8d_03 in(-1, -2, -4) & fa_8d_uab_c_03 = 1) then ira3 = (ira3 + 266000);
else if (fa_8d_uab_a_03 in(-1, -2) | fa_8d_uab_c_03 in(-1, -2)) then ira3 = -3;

/*********************************/
/* IRA Component - ira4: */
/*********************************/

if (fa_8 = 1 & fa_8d_trunc_04 >= 0) then ira4 = (ira4 + fa_8d_trunc_04);
else if (fa_8 = 1 & fa_8d_trunc_04 in(-1, -2) & fa_8d_uab_a_04 < 0) then ira4 = fa_8d_trunc_04;
else if (fa_8d_uab_a_04 in(-1, -2)) then ira4 = -3;

/*******************************/
/* IRA Component - ira5: */
/*******************************/

if (fa_8 = 1 & fa_8d_trunc_05 >= 0) then ira5 = (ira5 + fa_8d_trunc_05);
else if (fa_8 = 1 & fa_8d_trunc_05 in(-1, -2) & (fa_8d_sr000001_05 < 0 | fa_8d_sr000002_05 < 0) 
& fa_8d_uab_a_05 < 0 & fa_8d_uab_c_05 < 0) then ira5 = fa_8d_trunc_05;
else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 = fa_8d_sr000001_05) then 
ira5 = (ira5 + fa_8d_sr000001_05);
else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 > fa_8d_sr000001_05) then 
ira5 = (ira5 + (((fa_8d_sr000002_05 - fa_8d_sr000001_05)/2) + fa_8d_sr000001_05));
else if (fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 >= 0 & fa_8d_sr000002_05 < fa_8d_sr000001_05) then 
ira5 = (ira5 + (((fa_8d_sr000001_05 - fa_8d_sr000002_05)/2) + fa_8d_sr000002_05));
else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 0) then ira5 = (ira5 + quartile3);
else if (fa_8d_trunc_05 in(-1, -2, -4) & fa_8d_uab_c_05 = 1) then ira5 = (ira5 + 137000);
else if (fa_8d_uab_a_05 in(-1, -2) | fa_8d_uab_c_05 in(-1, -2)) then ira5 = -3;

/*********************************/
/* IRA Component - ira6: */
/*********************************/

if (fa_8 = 1 & fa_8d_06 >= 0) then ira6 = (ira6 + fa_8d_06);
else if (fa_8 = 1 & fa_8d_06 in(-1, -2) & (fa_8d_sr000001_06 < 0 | fa_8d_sr000002_06 < 0) 
& fa_8d_uab_a_06 < 0 & fa_8d_uab_b_06 < 0 & fa_8d_uab_c_06 < 0) then ira6 = fa_8d_06;
else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 = fa_8d_sr000001_06) then 
ira6 = (ira6 + fa_8d_sr000001_06);
else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 > fa_8d_sr000001_06) then 
ira6 = (ira6 + (((fa_8d_sr000002_06 - fa_8d_sr000001_06)/2) + fa_8d_sr000001_06));
else if (fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 >= 0 & fa_8d_sr000002_06 < fa_8d_sr000001_06) then 
ira6 = (ira6 + (((fa_8d_sr000001_06 - fa_8d_sr000002_06)/2) + fa_8d_sr000002_06));
else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 0) then ira6 = (ira6 + quartile1);
else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_b_06 = 1) then ira6 = (ira6 + quartile2);
else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 0) then ira6 = (ira6 + quartile3);
else if (fa_8d_06 in(-1, -2, -4) & fa_8d_uab_c_06 = 1) then ira6 = (ira6 + 90977);
else if (fa_8d_uab_a_06 in(-1, -2) | fa_8d_uab_b_06 in(-1, -2) | fa_8d_uab_c_06 in(-1, -2)) then ira6 = -3;

/********************************/
/* IRA Component - ira7: */
/********************************/

if (fa_8 = 1 & fa_8d_trunc_07 >= 0) then ira7 = (ira7 + fa_8d_trunc_07);
else if (fa_8 = 1 & fa_8d_trunc_07 in(-1, -2) & (fa_8d_sr000001_07 < 0 | fa_8d_sr000002_07 < 0) 
& fa_8d_uab_a_07 < 0 & fa_8d_uab_c_07 < 0) then ira7 = fa_8d_trunc_07;
else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 = fa_8d_sr000001_07) then 
ira7 = (ira7 + fa_8d_sr000001_07);
else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 > fa_8d_sr000001_07) then 
ira7 = (ira7 + (((fa_8d_sr000002_07 - fa_8d_sr000001_07)/2) + fa_8d_sr000001_07));
else if (fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 >= 0 & fa_8d_sr000002_07 < fa_8d_sr000001_07) then 
ira7 = (ira7 + (((fa_8d_sr000001_07 - fa_8d_sr000002_07)/2) + fa_8d_sr000002_07));
else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 0) then ira7 = (ira7 + quartile3);
else if (fa_8d_trunc_07 in(-1, -2, -4) & fa_8d_uab_c_07 = 1) then ira7 = (ira7 + 150000);
else if (fa_8d_uab_a_07 in(-1, -2) | fa_8d_uab_c_07 in(-1, -2)) then ira7 = -3;

/*******************************/
/* Add components IRA */
/*******************************/

if (ira1 >= 0) then irac = (irac + ira1); 
if (ira2 >= 0) then irac = (irac + ira2); 
if (ira3 >= 0) then irac = (irac + ira3); 
if (ira4 >= 0) then irac = (irac + ira4); 
if (ira5 >= 0) then irac = (irac + ira5); 
if (ira6 >= 0) then irac = (irac + ira6); 
if (ira7 >= 0) then irac = (irac + ira7); 
if (ira1 in(-1, -2, -3)) then irac = -3;
else if (ira2 in(-1, -2, -3)) then irac = -3;
else if (ira3 in(-1, -2, -3)) then irac = -3;
else if (ira4 in(-1, -2, -3)) then irac = -3;
else if (ira5 in(-1, -2, -3)) then irac = -3;
else if (ira6 in(-1, -2, -3)) then irac = -3;
else if (ira7 in(-1, -2, -3)) then irac = -3;


/****************************/
/* Compute A401K */
/****************************/

/***********************************/
/* A401K component - r_401k */
/***********************************/

if (fa_6b = 1 & fa_6e_trunc >= 0) then r_401k = (r_401k + fa_6e_trunc);
else if (fa_6b = 1 & fa_6e_ref_1 = 1 & fa_6e_sr000001 < 0 & fa_6e_sr000002 < 0 
& fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = -1;
else if (fa_6e_trunc in(-1, -2) & (fa_6e_sr000001 < 0 | fa_6e_sr000002 < 0) 
& fa_6e_uab_a < 0 & fa_6e_uab_b < 0 & fa_6e_uab_c < 0) then r_401k = fa_6e_trunc;
else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 = fa_6e_sr000001) then 
r_401k = (r_401k + fa_6e_sr000001);
else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 > fa_6e_sr000001) then 
r_401k = (r_401k + (((fa_6e_sr000002 - fa_6e_sr000001)/2) + fa_6e_sr000001));
else if (fa_6e_sr000001 >= 0 & fa_6e_sr000002 >= 0 & fa_6e_sr000002 < fa_6e_sr000001) then 
r_401k = (r_401k + (((fa_6e_sr000001 - fa_6e_sr000002)/2) + fa_6e_sr000002));
else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 0) then r_401k = (r_401k + quartile1);
else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_b = 1) then r_401k = (r_401k + quartile2);
else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 0) then r_401k = (r_401k + quartile3);
else if (fa_6e_trunc in(-1, -2, -4) & fa_6e_uab_c = 1) then r_401k = (r_401k + 150000);
else if (fa_6e_uab_a in(-1, -2) | fa_6e_uab_b in(-1, -2) | fa_6e_uab_c in(-1, -2)) then r_401k = -3;


/*************************************/
/* A401K component - sp_401k */
/*************************************/

if (fa_7 = 1 & fa_7c_trunc >= 0) then sp_401k = (sp_401k + fa_7c_trunc);
else if (fa_7 = 1 & fa_7c_ref_1 = 1 & fa_7c_sr000001 < 0 & fa_7c_sr000002 < 0 
& fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = -1;
else if (fa_7c_trunc in(-1, -2) & (fa_7c_sr000001 < 0 | fa_7c_sr000002 < 0) 
& fa_7c_uab_a < 0 & fa_7c_uab_b < 0 & fa_7c_uab_c < 0) then sp_401k = fa_7c_trunc;
else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 = fa_7c_sr000001) then 
sp_401k = (sp_401k + fa_7c_sr000001);
else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 > fa_7c_sr000001) then 
sp_401k = (sp_401k + (((fa_7c_sr000002 - fa_7c_sr000001)/2) + fa_7c_sr000001));
else if (fa_7c_sr000001 >= 0 & fa_7c_sr000002 >= 0 & fa_7c_sr000002 < fa_7c_sr000001) then 
sp_401k = (sp_401k + (((fa_7c_sr000001 - fa_7c_sr000002)/2) + fa_7c_sr000002));
else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 0) then sp_401k = (sp_401k + quartile1);
else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_b = 1) then sp_401k = (sp_401k + quartile2);
else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 0) then sp_401k = (sp_401k + quartile3);
else if (fa_7c_trunc in(-1, -2, -4) & fa_7c_uab_c = 1) then sp_401k = (sp_401k + 160000);
else if (fa_7c_uab_a in(-1, -2) | fa_7c_uab_b in(-1, -2) | fa_7c_uab_c in(-1, -2)) then sp_401k = -3;


/*******************************/
/* Add components A401K */
/*******************************/

if (r_401k >= 0) then a401kc = (a401kc + r_401k); 
if (sp_401k >= 0) then a401kc = (a401kc + sp_401k); 
if (r_401k in(-1, -2, -3)) then a401kc = -3;
else if (sp_401k in(-1, -2, -3)) then a401kc = -3;


/****************************/
/* Compute CDEBT */
/****************************/
/**************************************************/
/* CDEBT Component - amtowe_assetpoorcars: */
/**************************************************/

if (sc_12b_trunc >= 0) then amtowe_assetpoorcars = (amtowe_assetpoorcars + sc_12b_trunc);
else if (sc_12b_trunc = 1 & sc_12b_ref_1a = 1 & sc_12b_sr000001 < 0 & sc_12b_sr000002 < 0) then amtowe_assetpoorcars = -1;
else if (sc_12b_trunc in(-1, -2) & (sc_12b_sr000001 < 0 | sc_12b_sr000002 < 0)) then amtowe_assetpoorcars = sc_12b_trunc;
else if (sc_12b_sr000001 >= 0 & sc_12b_sr000002 >= 0 & sc_12b_sr000002 = sc_12b_sr000001) then 
amtowe_assetpoorcars = (amtowe_assetpoorcars + sc_12b_sr000001);
else if (sc_12b_sr000001 >= 0 & sc_12b_sr000002 >= 0 & sc_12b_sr000002 > sc_12b_sr000001) then 
amtowe_assetpoorcars = (amtowe_assetpoorcars + (((sc_12b_sr000002 - sc_12b_sr000001)/2) + sc_12b_sr000001));
else if (sc_12b_sr000001 >= 0 & sc_12b_sr000002 >= 0 & sc_12b_sr000002 < sc_12b_sr000001) then 
amtowe_assetpoorcars = (amtowe_assetpoorcars + (((sc_12b_sr000001 - sc_12b_sr000002)/2) + sc_12b_sr000002));

/***********************************************/
/* CDEBT Component - amountowe_vehicles: */
/***********************************************/

if (nfa_4f_trunc >= 0) then amountowe_vehicles = (amountowe_vehicles + nfa_4f_trunc);
else if (nfa_4f_trunc in(-1, -2) & (nfa_4f_sr000001_trunc < 0 | nfa_4f_sr000002_trunc < 0) 
& nfa_4f_uab_a < 0 & nfa_4f_uab_b < 0 & nfa_4f_uab_c < 0) then amountowe_vehicles = nfa_4f_trunc;
else if (nfa_4f_sr000001_trunc >= 0 & nfa_4f_sr000002_trunc >= 0 & nfa_4f_sr000002_trunc = nfa_4f_sr000001_trunc) then 
amountowe_vehicles = (amountowe_vehicles + nfa_4f_sr000001_trunc);
else if (nfa_4f_sr000001_trunc >= 0 & nfa_4f_sr000002_trunc >= 0 & nfa_4f_sr000002_trunc > nfa_4f_sr000001_trunc) then 
amountowe_vehicles = (amountowe_vehicles + (((nfa_4f_sr000002_trunc - nfa_4f_sr000001_trunc)/2) + nfa_4f_sr000001_trunc));
else if (nfa_4f_sr000001_trunc >= 0 & nfa_4f_sr000002_trunc >= 0 & nfa_4f_sr000002_trunc < nfa_4f_sr000001_trunc) then 
amountowe_vehicles = (amountowe_vehicles + (((nfa_4f_sr000001_trunc - nfa_4f_sr000002_trunc)/2) + nfa_4f_sr000002_trunc));
else if (nfa_4f_trunc in(-1, -2, -4) & nfa_4f_uab_b = 0) then amountowe_vehicles = (amountowe_vehicles + quartile1);
else if (nfa_4f_trunc in(-1, -2, -4) & nfa_4f_uab_b = 1) then amountowe_vehicles = (amountowe_vehicles + quartile2);
else if (nfa_4f_trunc in(-1, -2, -4) & nfa_4f_uab_c = 0) then amountowe_vehicles = (amountowe_vehicles + quartile3);
else if (nfa_4f_trunc in(-1, -2, -4) & nfa_4f_uab_c = 1) then amountowe_vehicles = (amountowe_vehicles + 40000);
else if (nfa_4f_uab_a in(-1, -2) | nfa_4f_uab_b in(-1, -2) | nfa_4f_uab_c in(-1, -2)) then amtowe_vehicles1 = -3;

/*************************************************/
/* CDEBT Component - amtowe_othervehicles: */
/*************************************************/

if (nfa_5 = 1 & nfa_5b_trunc >= 0) then amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_trunc);
else if (nfa_5 = 1 & nfa_5b_trunc in(-1, -2) & (nfa_5b_sr000001 < 0 | nfa_5b_sr000002 < 0)
& nfa_5b_uab_a < 0 & nfa_5b_uab_b < 0 & nfa_5b_uab_c < 0) then amtowe_othervehicles = nfa_5b_trunc;
else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 = nfa_5b_sr000001) then 
amtowe_othervehicles = (amtowe_othervehicles + nfa_5b_sr000001);
else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 > nfa_5b_sr000001) then 
amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000002 - nfa_5b_sr000001)/2) + nfa_5b_sr000001));
else if (nfa_5b_sr000001 >= 0 & nfa_5b_sr000002 >= 0 & nfa_5b_sr000002 < nfa_5b_sr000001) then 
amtowe_othervehicles = (amtowe_othervehicles + (((nfa_5b_sr000001 - nfa_5b_sr000002)/2) + nfa_5b_sr000002));
else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_b = 0) then amtowe_othervehicles = (amtowe_othervehicles + quartile1);
else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_b = 1) then amtowe_othervehicles = (amtowe_othervehicles + quartile2);
else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 0) then amtowe_othervehicles = (amtowe_othervehicles + quartile3);
else if (nfa_5b_trunc in(-1, -2, -4) & nfa_5b_uab_c = 1) then amtowe_othervehicles = (amtowe_othervehicles + 50000);
else if (nfa_5b_uab_a in(-1, -2) | nfa_5b_uab_b in(-1, -2) | nfa_5b_uab_c in(-1, -2)) then amtowe_othervehicles = -3;


/*******************************/
/* Add components CDEBT */
/*******************************/

if (amtowe_assetpoorcars >= 0) then cdebtc = (cdebtc + amtowe_assetpoorcars); 
if (amountowe_vehicles >= 0) then cdebtc = (cdebtc + amountowe_vehicles); 
if (amtowe_othervehicles >= 0) then cdebtc = (cdebtc + amtowe_othervehicles);


if (amtowe_assetpoorcars in(-1, -2, -3)) then cdebtc = -3; 
else if (amountowe_vehicles in(-1, -2, -3)) then cdebtc = -3; 
else if (amtowe_othervehicles in(-1, -2, -3)) then cdebtc = -3;


/****************************/
/* Compute CAR */
/****************************/
/***********************************************/
/* CAR Component - mktval_assetpoorcars: */
/***********************************************/
if (sc_12a_trunc >= 0) then mktval_assetpoorcars = (mktval_assetpoorcars + sc_12a_trunc);
else if (sc_12a_trunc = 1 & sc_12a_ref_1a = 1 & sc_12a_sr000001 < 0 & sc_12a_sr000002 < 0 
& sc_12a_uab_a < 0 & sc_12a_uab_b < 0 ) then mktval_assetpoorcars = -1;
else if (sc_12a_trunc in(-1, -2) & (sc_12a_sr000001 < 0 | sc_12a_sr000002 < 0) 
& sc_12a_uab_a < 0 & sc_12a_uab_b < 0) then mktval_assetpoorcars = sc_12a_trunc;
else if (sc_12a_sr000001 >= 0 & sc_12a_sr000002 >= 0 & sc_12a_sr000002 = sc_12a_sr000001) then 
mktval_assetpoorcars = (mktval_assetpoorcars + sc_12a_sr000001);
else if (sc_12a_sr000001 >= 0 & sc_12a_sr000002 >= 0 & sc_12a_sr000002 > sc_12a_sr000001) then 
mktval_assetpoorcars = (mktval_assetpoorcars + (((sc_12a_sr000002 - sc_12a_sr000001)/2) + sc_12a_sr000001));
else if (sc_12a_sr000001 >= 0 & sc_12a_sr000002 >= 0 & sc_12a_sr000002 < sc_12a_sr000001) then 
mktval_assetpoorcars = (mktval_assetpoorcars + (((sc_12a_sr000001 - sc_12a_sr000002)/2) + sc_12a_sr000002));
else if (sc_12a_trunc in(-1, -2, -4) & sc_12a_uab_b = 0) then mktval_assetpoorcars = (mktval_assetpoorcars + quartile1);
else if (sc_12a_trunc in(-1, -2, -4) & sc_12a_uab_b = 1) then mktval_assetpoorcars = (mktval_assetpoorcars + quartile2);
else if (sc_12a_uab_a in(-1, -2) | sc_12a_uab_b in(-1, -2)) then mktval_assetpoorcars = -3;

/************************************************/
/* CAR Component - marketvalue_vehicles: */
/************************************************/

if (nfa_4c_trunc >= 0) then marketvalue_vehicles = (marketvalue_vehicles + nfa_4c_trunc);
else if (nfa_4c_trunc in(-1, -2) & (nfa_4c_sr000001 < 0 | nfa_4c_sr000002_trunc < 0) 
& nfa_4c_uab_a < 0 & nfa_4c_uab_b < 0 & nfa_4c_uab_c < 0) then marketvalue_vehicles = nfa_4c_trunc;
else if (nfa_4c_sr000001 >= 0 & nfa_4c_sr000002_trunc >= 0 & nfa_4c_sr000002_trunc = nfa_4c_sr000001) then 
marketvalue_vehicles = (marketvalue_vehicles + nfa_4c_sr000001);
else if (nfa_4c_sr000001 >= 0 & nfa_4c_sr000002_trunc >= 0 & nfa_4c_sr000002_trunc > nfa_4c_sr000001) then 
marketvalue_vehicles = (marketvalue_vehicles + (((nfa_4c_sr000002_trunc - nfa_4c_sr000001)/2) + nfa_4c_sr000001));
else if (nfa_4c_sr000001 >= 0 & nfa_4c_sr000002_trunc >= 0 & nfa_4c_sr000002_trunc < nfa_4c_sr000001) then 
marketvalue_vehicles = (marketvalue_vehicles + (((nfa_4c_sr000001 - nfa_4c_sr000002_trunc)/2) + nfa_4c_sr000002_trunc));
else if (nfa_4c_trunc in(-1, -2, -4) & nfa_4c_uab_b = 0) then marketvalue_vehicles = (marketvalue_vehicles + quartile1);
else if (nfa_4c_trunc in(-1, -2, -4) & nfa_4c_uab_b = 1) then marketvalue_vehicles = (marketvalue_vehicles + quartile2);
else if (nfa_4c_trunc in(-1, -2, -4) & nfa_4c_uab_c = 0) then marketvalue_vehicles = (marketvalue_vehicles + quartile3);
else if (nfa_4c_trunc in(-1, -2, -4) & nfa_4c_uab_c = 1) then marketvalue_vehicles = (marketvalue_vehicles + 50000);
else if (nfa_4c_uab_a in(-1, -2) | nfa_4c_uab_b in(-1, -2) | nfa_4c_uab_c in(-1, -2)) then marketvalue_vehicles = -3;

/***********************************************/
/* CAR Component - mktval_othervehicles: */
/***********************************************/

if (nfa_5 = 1 & nfa_5c_trunc >= 0) then mktval_othervehicles = (mktval_othervehicles + nfa_5c_trunc);
else if (nfa_5 = 1 & nfa_5c_ref_1 = 1 & nfa_5c_sr000001 < 0 & nfa_5c_sr000002 < 0
& nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = -1;
else if (nfa_5 = 1 & nfa_5c_trunc in(-1, -2) & (nfa_5c_sr000001 < 0 | nfa_5c_sr000002 < 0)
& nfa_5c_uab_a < 0 & nfa_5c_uab_b < 0 & nfa_5c_uab_c < 0) then mktval_othervehicles = nfa_5c_trunc;
else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 = nfa_5c_sr000001) then 
mktval_othervehicles = (mktval_othervehicles + nfa_5c_sr000001);
else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 > nfa_5c_sr000001) then 
mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000002 - nfa_5c_sr000001)/2) + nfa_5c_sr000001));
else if (nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 >= 0 & nfa_5c_sr000002 < nfa_5c_sr000001) then 
mktval_othervehicles = (mktval_othervehicles + (((nfa_5c_sr000001 - nfa_5c_sr000002)/2) + nfa_5c_sr000002));
else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 0) then mktval_othervehicles = (mktval_othervehicles + quartile1);
else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_b = 1) then mktval_othervehicles = (mktval_othervehicles + quartile2);
else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 0) then mktval_othervehicles = (mktval_othervehicles + quartile3);
else if (nfa_5c_trunc in(-1, -2, -4) & nfa_5c_uab_c = 1) then mktval_othervehicles = (mktval_othervehicles + 60000);
else if (nfa_5c_uab_a in(-1, -2) | nfa_5c_uab_b in(-1, -2) | nfa_5c_uab_c in(-1, -2)) then mktval_othervehicles = -3;

/*******************************/
/* Add components CAR */
/*******************************/

if (mktval_assetpoorcars >= 0) then carc = (carc + mktval_assetpoorcars); 
if (marketvalue_vehicles >= 0) then carc = (carc + marketvalue_vehicles); 
if (mktval_othervehicles >= 0) then carc = (carc + mktval_othervehicles);

if (mktval_assetpoorcars in(-1, -2, -3)) then carc = -3; 
else if (marketvalue_vehicles in(-1, -2, -3)) then carc = -3; 
else if (mktval_othervehicles in(-1, -2, -3)) then carc = -3;


/****************************/
/* Compute NET_WORTH */
/****************************/
/************************************************************/
/* NET_WORTH - add components created in above code */
/************************************************************/

if (homec >= 0) then tnfw = (tnfw + homec );
if (mortc >= 0) then tnfw = (tnfw - mortc );
if (pdebtc >= 0) then tnfw = (tnfw - pdebtc);
if (cashc >= 0) then tnfw = (tnfw + cashc );
if (irac >= 0) then tnfw = (tnfw + irac );
if (a401kc >= 0) then tnfw = (tnfw + a401kc);
if (cdsc >= 0) then tnfw = (tnfw + cdsc );
if (stockc >= 0) then tnfw = (tnfw + stockc);
if (bizc >= 0) then tnfw = (tnfw + bizc );
if (bdebtc >= 0) then tnfw = (tnfw - bdebtc);
if (cdebtc >= 0) then tnfw = (tnfw - cdebtc);
if (carc >= 0) then tnfw = (tnfw + carc );
if (posesc >= 0) then tnfw = (tnfw + posesc);
if (odebtc >= 0) then tnfw = (tnfw - odebtc);

if (homec in(-1, -2, -3)) then tnfw = -3;
if (mortc in(-1, -2, -3)) then tnfw = -3;
if (pdebtc in(-1, -2, -3)) then tnfw = -3;
if (cashc in(-1, -2, -3)) then tnfw = -3;
if (irac in(-1, -2, -3)) then tnfw = -3;
if (a401kc in(-1, -2, -3)) then tnfw = -3;
if (cdsc in(-1, -2, -3)) then tnfw = -3;
if (stockc in(-1, -2, -3)) then tnfw = -3;
if (bizc in(-1, -2, -3)) then tnfw = -3;
if (bdebtc in(-1, -2, -3)) then tnfw = -3;
if (cdebtc in(-1, -2, -3)) then tnfw = -3;
if (carc in(-1, -2, -3)) then tnfw = -3;
if (posesc in(-1, -2, -3)) then tnfw = -3;
if (odebtc in(-1, -2, -3)) then tnfw = -3;

/************************************************/
/* Adjust for partially missing range estimates */
/************************************************/

if (tnfw ~= -3 & 
((((nfa_1a_sr000001 >= 0 & nfa_1a_sr000002 in(-1, -2)) | (nfa_1a_sr000001 in(-1, -2) & nfa_1a_sr000002 >= 0))
& nfa_1a_uab_a in(-1, -2, -3, -4) & nfa_1a_uab_b in(-1, -2, -3, -4) & nfa_1a_uab_c in(-1, -2, -3, -4))
| (((nfa_1b_sr000001 >= 0 & nfa_1b_sr000002 in(-1, -2)) | (nfa_1b_sr000001 in(-1, -2) & nfa_1b_sr000002 >= 0)) 
& nfa_1b_uab_a in(-1, -2, -3, -4) & nfa_1b_uab_b in(-1, -2, -3, -4) & nfa_1b_uab_c in(-1, -2, -3, -4))
| (((nfa_1c_sr000001 >= 0 & nfa_1c_sr000002 in(-1, -2)) | (nfa_1c_sr000001 in(-1, -2) & nfa_1c_sr000002 >= 0))
& nfa_1c_uab_a in(-1, -2, -3, -4) & nfa_1c_uab_b in(-1, -2, -3, -4) & nfa_1c_uab_c in(-1, -2, -3, -4))
| (((nfa_2a_sr000001 >= 0 & nfa_2a_sr000002 in(-1, -2)) | (nfa_2a_sr000001 in(-1, -2) & nfa_2a_sr000002 >= 0))
& nfa_2a_uab_a in(-1, -2, -3, -4) & nfa_2a_uab_b in(-1, -2, -3, -4) & nfa_2a_uab_c in(-1, -2, -3, -4))
| (((nfa_2b_sr000001 >= 0 & nfa_2b_sr000002 in(-1, -2)) | (nfa_2b_sr000001 in(-1, -2) & nfa_2b_sr000002 >= 0)) 
& nfa_2b_uab_a in(-1, -2, -3, -4) & nfa_2b_uab_b in(-1, -2, -3, -4) & nfa_2b_uab_c in(-1, -2, -3, -4))
| (((nfa_2c_sr000001 >= 0 & nfa_2c_sr000002 in(-1, -2)) | (nfa_2c_sr000001 in(-1, -2) & nfa_2c_sr000002 >= 0)) 
& nfa_2c_uab_a in(-1, -2, -3, -4) & nfa_2c_uab_b in(-1, -2, -3, -4) & nfa_2c_uab_c in(-1, -2, -3, -4))
| (((fa_1a_sr000001 >= 0 & fa_1a_sr000002 in(-1, -2)) | (fa_1a_sr000001 in(-1, -2) & fa_1a_sr000002 >= 0))
& fa_1a_uab_a in(-1, -2, -3, -4) & fa_1a_uab_b in(-1, -2, -3, -4) & fa_1a_uab_c in(-1, -2, -3, -4))
| (((fa_8d_sr000001_01 >= 0 & fa_8d_sr000002_01 in(-1, -2)) | (fa_8d_sr000001_01 in(-1, -2) & fa_8d_sr000002_01 >= 0))
& fa_8d_uab_a_01 in(-1, -2, -3, -4) & fa_8d_uab_b_01 in(-1, -2, -3, -4) & fa_8d_uab_c_01 in(-1, -2, -3, -4))
| (((fa_8d_sr000001_02 >= 0 & fa_8d_sr000002_02 in(-1, -2)) | (fa_8d_sr000001_02 in(-1, -2) & fa_8d_sr000002_02 >= 0)) 
& fa_8d_uab_a_02 in(-1, -2, -3, -4) & fa_8d_uab_b_02 in(-1, -2, -3, -4) & fa_8d_uab_c_02 in(-1, -2, -3, -4))
| (((fa_8d_sr000001_03 >= 0 & fa_8d_sr000002_03 in(-1, -2)) | (fa_8d_sr000001_03 in(-1, -2) & fa_8d_sr000002_03 >= 0)) 
& fa_8d_uab_a_03 in(-1, -2, -3, -4) & fa_8d_uab_c_03 in(-1, -2, -3, -4))
| (((fa_8d_sr000001_05 >= 0 & fa_8d_sr000002_05 in(-1, -2)) | (fa_8d_sr000001_05 in(-1, -2) & fa_8d_sr000002_05 >= 0)) 
& fa_8d_uab_a_05 in(-1, -2, -3, -4) & fa_8d_uab_c_05 in(-1, -2, -3, -4))
| (((fa_8d_sr000001_06 >= 0 & fa_8d_sr000002_06 in(-1, -2)) | (fa_8d_sr000001_06 in(-1, -2) & fa_8d_sr000002_06 >= 0)) 
& fa_8d_uab_a_06 in(-1, -2, -3, -4) & fa_8d_uab_b_06 in(-1, -2, -3, -4) & fa_8d_uab_c_06 in(-1, -2, -3, -4))
| (((fa_8d_sr000001_07 >= 0 & fa_8d_sr000002_07 in(-1, -2)) | (fa_8d_sr000001_07 in(-1, -2) & fa_8d_sr000002_07 >= 0)) 
& fa_8d_uab_a_07 in(-1, -2, -3, -4) & fa_8d_uab_c_07 in(-1, -2, -3, -4))
| (((fa_6e_sr000001 >= 0 & fa_6e_sr000002 in(-1, -2)) | (fa_6e_sr000001 in(-1, -2) & fa_6e_sr000002 >= 0))
& fa_6e_uab_a in(-1, -2, -3, -4) & fa_6e_uab_b in(-1, -2, -3, -4) & fa_6e_uab_c in(-1, -2, -3, -4))
| (((fa_7c_sr000001 >= 0 & fa_7c_sr000002 in(-1, -2)) | (fa_7c_sr000001 in(-1, -2) & fa_7c_sr000002 >= 0)) 
& fa_7c_uab_a in(-1, -2, -3, -4) & fa_7c_uab_b in(-1, -2, -3, -4) & fa_7c_uab_c in(-1, -2, -3, -4))
| (((fa_2a_sr000001 >= 0 & fa_2a_sr000002 in(-1, -2)) | (fa_2a_sr000001 in(-1, -2) & fa_2a_sr000002 >= 0)) 
& fa_2a_uab_a in(-1, -2, -3, -4) & fa_2a_uab_b in(-1, -2, -3, -4) & fa_2a_uab_c in(-1, -2, -3, -4))
| (((fa_3a_sr000001 >= 0 & fa_3a_sr000002 in(-1, -2)) | (fa_3a_sr000001 in(-1, -2) & fa_3a_sr000002 >= 0))
& fa_3a_uab_a in(-1, -2, -3, -4) & fa_3a_uab_b in(-1, -2, -3, -4) & fa_3a_uab_c in(-1, -2, -3, -4))
| (((fa_4a_sr000001 >= 0 & fa_4a_sr000002 in(-1, -2)) | (fa_4a_sr000001 in(-1, -2) & fa_4a_sr000002 >= 0))
& fa_4a_uab_a in(-1, -2, -3, -4) & fa_4a_uab_c in(-1, -2, -3, -4))
| (((fa_5a_sr000001 >= 0 & fa_5a_sr000002_trunc in(-1, -2)) | (fa_5a_sr000001 in(-1, -2) & fa_5a_sr000002_trunc >= 0))
& fa_5a_uab_a in(-1, -2, -3, -4) & fa_5a_uab_b in(-1, -2, -3, -4) & fa_5a_uab_c in(-1, -2, -3, -4))
| (((fa_9a_sr000001_trunc >= 0 & fa_9a_sr000002 in(-1, -2)) | (fa_9a_sr000001_trunc in(-1, -2) & fa_9a_sr000002 >= 0))
& fa_9a_uab_a in(-1, -2, -3, -4) & fa_9a_uab_b in(-1, -2, -3, -4) & fa_9a_uab_c in(-1, -2, -3, -4))
| (((fa_10a_sr000001_trunc >= 0 & fa_10a_sr000002_trunc in(-1, -2)) | (fa_10a_sr000001_trunc in(-1, -2) & fa_10a_sr000002_trunc >= 0))
& fa_10a_uab_a in(-1, -2, -3, -4) & fa_10a_uab_b in(-1, -2, -3, -4) & fa_10a_uab_c in(-1, -2, -3, -4))
| (((fa_11a_sr000001 >= 0 & fa_11a_sr000002 in(-1, -2)) | (fa_11a_sr000001 in(-1, -2) & fa_11a_sr000002 >= 0))
& fa_11a_uab_a in(-1, -2, -3, -4) & fa_11a_uab_b in(-1, -2, -3, -4) & fa_11a_uab_c in(-1, -2, -3, -4))
| (((q13_131_sr000001 >= 0 & q13_131_sr000002 in(-1, -2)) | (q13_131_sr000001 in(-1, -2) & q13_131_sr000002 >= 0))
& q13_131_uab_a in(-1, -2, -3, -4) & q13_131_uab_c in(-1, -2, -3, -4))
| (((q13_132_sr000001 >= 0 & q13_132_sr000002 in(-1, -2)) | (q13_132_sr000001 in(-1, -2) & q13_132_sr000002 >= 0))
& q13_132_uab_a in(-1, -2, -3, -4) & q13_132_uab_c in(-1, -2, -3, -4))
| (sc_12b_sr000001 >= 0 & sc_12b_sr000002 in(-1, -2)) | (sc_12b_sr000001 in(-1, -2) & sc_12b_sr000002 >= 0)
| (((nfa_4f_sr000001_trunc >= 0 & nfa_4f_sr000002_trunc in(-1, -2)) | (nfa_4f_sr000001_trunc in(-1, -2) & nfa_4f_sr000002_trunc >= 0))
& nfa_4f_uab_a in(-1, -2, -3, -4) & nfa_4f_uab_b in(-1, -2, -3, -4) & nfa_4f_uab_c in(-1, -2, -3, -4))
| (((sc_12a_sr000001 >= 0 & sc_12a_sr000002 in(-1, -2)) | (sc_12a_sr000001 in(-1, -2) & sc_12a_sr000002 >= 0))
& sc_12a_uab_a in(-1, -2, -3, -4) & sc_12a_uab_b in(-1, -2, -3, -4))
| (((nfa_4c_sr000001 >= 0 & nfa_4c_sr000002_trunc in(-1, -2)) | (nfa_4c_sr000001 in(-1, -2) & nfa_4c_sr000002_trunc >= 0))
& nfa_4c_uab_a in(-1, -2, -3, -4) & nfa_4c_uab_b in(-1, -2, -3, -4) & nfa_4c_uab_c in(-1, -2, -3, -4))
| (((nfa_5c_sr000001 >= 0 & nfa_5c_sr000002 in(-1, -2)) | (nfa_5c_sr000001 in(-1, -2) & nfa_5c_sr000002 >= 0))
& nfa_5c_uab_a in(-1, -2, -3, -4) & nfa_5c_uab_b in(-1, -2, -3, -4) & nfa_5c_uab_c in(-1, -2, -3, -4))
| (((nfa_6e_sr000001 >= 0 & nfa_6e_sr000002_trunc in(-1, -2)) | (nfa_6e_sr000001 in(-1, -2) & nfa_6e_sr000002_trunc >= 0))
& nfa_6e_uab_a in(-1, -2, -3, -4) & nfa_6e_uab_b in(-1, -2, -3, -4) & nfa_6e_uab_c in(-1, -2, -3, -4))))
then do;
tnfw = -3;
tnfw_trunc = -3;
end;


/*************************************************/
/* Apply Topcode to TNFW_TRUNC for 2020 */
/*************************************************/

if (tnfw_trunc > 5384000) then tnfw_trunc = 16449398;

tnfw_trunc = round(tnfw_trunc);

Asset and debt questions were first introduced in 1985. They were included in each survey through the 1990s, with the exception of 1991. Beginning in 2000, the assets module has been included in alternating rounds. These questions solicit information about specific categories of assets and debt. The 1985 survey included questions about ten categories. In subsequent years, these categories were expanded. Through the 1990s, the values for each category were collected with a single question per category. In 2000 and beyond, multiple values were collected with respect to some categories, providing some additional definition to those categories. For instance, questions about home value were expanded to include the value of a secondary residence as well. A single question on stocks/bonds/mutual funds/etc. was split to ask individually about stock values, bond values, mutual fund values, etc. Questions on business values and debts were expanded to establish sole or joint ownership of the business and percentage of the business that respondents owned if applicable.

In the 2000 and subsequent surveys, respondents were also given the opportunity to provide estimates for some values of which they were unsure or for which they refused to report a precise figure. Respondents had the opportunity to report values within a bounded range (reporting a low and high value) and/or to report values simply over or under certain amounts (see description of unfolding brackets earlier in the appendix), enabling a range to be established. These estimates were incorporated into the TNFW_TRUNC values where available. Questions containing the string “_SR000001” and “_SR000002” contain values for low- and high-bounded ranges respondents may have reported. Questions containing the string “UAB_A”, “UAB_B” and “UAB_C” contain responses to unfolding brackets if the respondent reported estimates in that manner.  The exception is 2000, the introductory year, when only a few questions (Q13-122, Q13-123C and Q13-125) were followed by unfolding brackets if necessary.

The categories of assets and debt are listed below, along with the survey year in which they were introduced.

  1. Home value (1985)
  2. Mortgages (1985)
  3. Other residential debt (1985)
  4. Value of farm/business/real estate (1985)
  5. Debts of farm/business/real estate  (1985)
  6. Market value of vehicles (1985)
  7. Debt of vehicles (1985)
  8. Value of stocks/bonds/mutual funds (1988)
  9. Value of CDs (1994)
  10. Value of trusts (1988–2000 only)
    • Note: Trusts were dropped in 2000 as few respondents reported being trust fund recipients.
  11. Value of IRAs (1994)
  12. Value of 401ks and 403bs (1994)
  13. Value of cash savings (1985)
  14. Value of other assets like jewelry/collections (1985)
  15. Value of all other debts like credit cards/student loans (1985)

Table 2 lists the reference numbers, question names and titles from the 1996 survey for each of the categories, and the imputed variable created for each category:

Table 2. Round 17 (1996) asset and debt variable categories
Asset/Debt Category
Note 2.1
R Number Root Question Name
Note 2.2
Variable Title
Q13-118_REVISED R57282.01 Q13-118 Mkt Val Res Property R-Sp Own 96
Q13-119 R57283.01 Q13-119 Amount R-Sp Owe On Res Property 96
Q13-120_REVISED R57284.01 Q13-120 Amt Oth Debt R-Sp Owes On Res Prop 96
Q13-122_REVISED R57286.01 Q13-122 Amount In Savings Accounts 96
Q13-123A_REVISED R57288.01 Q13-123A Amount In IRAs-Keough 96
Q13-123C_REVISED R57290.01 Q13-123C Amount In Tax-Defrd Plans 96
Q13-123E_REVISED R57292.01 Q13-123E Amount In CDs, Loans, Mortg 96
Q13-125_REVISED R57294.01 Q13-125 Mkt Val Of Stocks, Bonds R-Sp Have 96
Q13-127_REVISED R57296.01 Q13-127 Total Val Of Estate, Invest Trust 96
Q13-131_REVISED R57300.01 Q13-131 Ttl Mkt Val Farm, Bsns, Oth Prop? 96
Q13-132_REVISED R57301.01 Q13-132 Ttl Amt Debts, Liablty Farm, Bsns 96
Q13-135_REVISED R57304.01 Q13-135 Amt R-Sp Owe On Vehicles 96
Q13-136_REVISED R57305.01 Q13-136 Mkt Val Of Vehicles R-Sp Own 96
Q13-138_REVISED R57307.01 Q13-138 Ttl Mkt Val Items Over $500 96
Q13-140_REVISED R57309.01 Q13-140 Total Amt R-Sp Owe To Creditors 96

Note 2.1: Imputed variables were used to compute the older NET_WORTH_[YR], variables, but not the updated TNFW_TRUNC variables. These use the truncated versions of the variables in the question name column.

Note 2.2: Revised / truncated question names version used wherever available.

As an example, Table 3 lists the twelve variables used in 2004 to create the home value variable, as a component of "TNFW_TRUNC.”

Table 3. 2004 home value variables
R Number  Question Name  Variable Title
R83792.00 NFA_1A_TRUNC Mkt Val Res Property R/Sp Own 2004
R83793.00 NFA_1A_SR000001 Est Market Value Of Residential Property R/Spar Own
R83794.00 NFA_1A_SR000002 Est Market Value Of Residential Property R/Spar Own
R83795.00 NFA_1A_UAB_A Market Value Of Residence In 2003 More Than Entry Amount
R83795.10 NFA_1A_UAB_B Market Value Of Residence In 2003 More Than $5k
R83796.00 NFA_1A_UAB_C Market Value Of Residence In 2003 More Than $30k
R83814.00 NFA_2A_TRUNC Market Value of (2nd) Residential Property R/Spouse Own
R83814.00 NFA_2A_SR000001 Est Market Value Of (2nd) Residential Property R/Spar Own
R83815.00 NFA_2A_SR000002 Est Market Value Of (2nd) Residential Property R/Spar Own
R83816.00 NFA_2A_UAB_A Market Value Of (2nd) Residence In 2003 More Than Entry Amount
R83816.10 NFA_2A_UAB_B Market Value Of (2nd) Residence In 2003 More Than $5k
R83817.00 NFA_2A_UAB_C Market Value Of (2nd) Residence In 2003 More Than $30k

Table 4 lists the root variables included in the asset and debt categories starting with Round 21 (2004). While only the root question names are shown in Table 4, the additional bounded range and unfolding bracket estimate questions, shown in Table 3, are incorporated as well whenever applicable.

Table 4: Data underlying mid-level asset and debt categories used beginning in Round 21 (2004)
Asset/Debt Category R Number
Note 4.1
Root Question Name
Note 4.2
Description
Home/Residential Value R83792.00 NFA_1A Value of 1st Home
R83814.00 NFA_2A Value of 2nd Home/Time Share
Mortgage R83799.00 NFA_1B Mortgage on 1st Home
R83820.00 NFA_2B Mortgage on 2nd Home/Time Share
Property Debt R83808.00 NFA_1C Other Property Debt on 1st Home
R83827.00 NFA_2C Other Property Debt on 2nd Home/Time Share
Cash Savings R83630.00 FA_1A Total Amount In Checking, Savings, And Money Market Funds
Stocks/Bonds R83648.00 FA_3A Total Money If R-Spar Cashed In US Government Savings bonds
R83657.00 FA_4A Total Money If R-Spar Sold Mutual Funds
R83666.00 FA_5A Total Money If Insurance Policies Cashed
R83764.00 FA_9A Money R-Spar Have If Sold/Paid Amt Owe On Stock
R83773.00 FA_10A Amt Of $ If Cash/Pay Off Securities/ Bonds
R83782.00 FA_11A R-Spouse/Partner Owed Money From Personal Or Mortgage Loans
Trusts     These variables contain only -4s and -5s after survey year 2000, since the trust asset value questions were not asked. Because there was a chance the underlying questions would be brought back, the variables (all missing) are still present in several years after 2000 to preserve a consistent sequence.
Business Assets R83868.00 Q13-FJT-11.## Market Value Of Farm in 2003,
Excluding Crops Held Under Commodity Credit Loans
R83873.00 Q13-FJT-12B.## Percentage Of Farm Owned By R Or Spouse
R83896.00 Q13-BPPJT-11.## Market Value Of Business Professional Practice
R83904.00 Q13-BPPJT-12B.## Percentage Of Professional Practice That R Owns
R83907.00 Q13-BPPJT-12E.## Market Value Of R Share Of Professional Practice
R83927.00 Q13-REJT-11.## Market Value Of Additional Real Estate
R83932.00 Q13-REJT-12B.## Percentage Of Real Estate R-Spouse Own
R83936.00 Q13-REJT-12E.## Market Value Of R Share Of Real Estate
R83943.00 Q13-131 Total Market Value Of
Farm/Business/Other Property R/Spouse Own
Business Debt R83869.00 Q13-FJT-12.## Total Amount Of Debts Owed On Farm
R83900.00 Q13-BPPJT-12.## Total Amount Of Debts Owed
On Professional Practice
R83950.00 Q13-132 Total Amount Of Debts
On Farm/Business/Other Property R/Spouse Owe
Car Value R83979.00 NFA_4C.## Market Value Of Vehicle
R83611.00 SC_12A.01.## Current Value Of Vehicle
R84105.00 NFA_5C Market Value Of Other Personal Use Vehicles
CDs R83639.00 FA_2A Total Money If R-Spouse Cashed In
Certificate of Deposits/CDs
Car Debt R84080.00 NFA_4F.## Total Amount Owed By R-Spouse
On Vehicle After Last Car Payment
R84098.00 NFA_5B Total Amount Owed By R-Spar
On All Other Personal Use Vehicles
R83621.00 SC_12B.## Balance Owed On Vehicle
After Last Payment
Possessions R84116.00 NFA_6E Market Value Of Collections
Worth $1000 Or More
R84125.00 NFA_7D Market Value Of Individual R-Spouse Items
Worth $1000 Or More
Other Debt R84132.00 DEBT_1A Total Balance Owed
On All Credit Card Accounts Together
R84139.00 DEBT_2A Total Amount R-Spouse Owes
On Student Loans
R84147.00 DEBT_2D Total Amount Owed
On Student Loans For Children
R84154.00 DEBT_3A Total Amount R-Spouse Owes To Other Businesses
After Most Recent Payment
R84161.00 DEBT_4A Total Amount R-Spouse Owes Other Persons, Institutions, Companies to nearest $1000
IRAs R83733.00 FA_8D_TRUNC.## Total Money If Tax Advantage Account Cashed
401Ks R83683.00 FA_6E Total Value Of Emp-Sponsored Retiremt Plans
R83700.00 FA_7C Tot Balance Of Spar-Emp Sponsored Retiremt Plans

Note 4.1: The first Rnum is listed for sets of variables that fall in loops and have more than one occurrence.

Note 4.2: Truncated version used wherever it exists.

Researchers can find all the original respondent data (truncated where necessary) in the NLSY79 dataset in the NLS Investigator by searching the root qnames listed in the tables above.

NLSY79 Appendix 22: Migration Distance Variables for Respondent Locations

To support research on respondent mobility, we created a series of variables for the distance between respondent addresses at each interview round. This supplements the data on state and county of residence in the Geocode release. These variables are available only on the Geocode data release.

These confidential files are available for use only at the BLS National Office in Washington, DC, and at Federal Statistical Research Data Centers (FSRDCs) on statistical research projects approved by BLS. Access to data is subject to the availability of space and resources. Information about applying to use the zip code and Census tract data is available on the BLS Restricted Data Access page.

The distance between the respondent's addresses at each date of interview was created for all unique pairs of survey years with names in the form DISTANCE_DTyrA_yrB. (In order to avoid unnecessary duplication of variables these distance based variables are between years A and B only for A>B.) The data described here do not actually provide a location for the respondent's residence; these variables only provide distances between the various places the respondent lives. This pairwise matrix of variables enables various types of migration research by enabling users to consider the distance between residences and to identify return migration to an area where the respondent has lived in the past.

In addition to the set of distance variables, we created indicators of the quality of the geographic data. For a variety of reasons, we may not have an address for the respondent. In such cases we geocode the respondent to the centroid of the zipcode when we can determine the zipcode. To identify these cases, an indicator for the quality of this distance measure was created based on the quality of the matches in both years. This variable, DISTANCE_DFyrA_yrB takes a value of 1 if the addresses in both years were exact address matches, a value of 2 if one match was based on the zip centroid and the other was an exact address match, and a value of 3 if both were zip centroid matches.

Finally, DISTANCE_DZCyrA_yrB, an indicator for whether the respondent was located in the same zip code, was created for all pairs of years.

Data notes and variable construction

The large number of "Don't Know" values for 1979 and 1980 reflects the weakness of the address data for the 1980 wave due to 1980 addresses being missing at a high rate. The 1980 addresses were only recovered from the archives a few years ago and what we have represents considerable effort to re-constitute the historical record.

Respondent address data can be rather messy with some fields of an address either missing or incorrectly carried over from a previous round. The most reliable address components we have are the state and county of residence at each interview round. Archivists put considerable effort into examining conflicting pieces of evidence to arrive at the most reasonable judgment as to where the respondent lived at the time of the interview. Users should bear in mind that some respondents live in temporary quarters with friends, relatives or in a shelter, are working at remote locations where the employer supplies a place to stay, are homeless or living out of a car or choose not to say where they live. Some addresses are RFD, descriptive (at that trailer park just outside of town) or the respondent uses a PO Box, making it impossible to assign longitude and latitude to the address. Archivists consulted a variety of data resources in both the interview form and records from the field to make as accurate a determination as possible. For example, in years when landlines dominated telephony, area codes and exchanges provided reliable data on location as interviewers use the telephone heavily in setting appointments and, in some cases, conducting the interview over the phone.

These distance data were constructed in 2009. We proceeded under the assumption that any attempt to correct the existing state and county of residence many years after the original geocoding effort was more likely to degrade data quality than improve it. Hence the created distance variables are consistent with the state and county of residence data released in the various waves of the NLSY79 geocode data.

The major task was in placing the respondent at a particular location in the county so that we could compute distances. A corollary to this is that distance measures involving moves from one county to another, and especially one state to another, will likely contain error that are a relatively small fraction of the total distance moved. However, the major motivation of this effort is to provide the user with an indication of when a respondent moved back to a location that is relatively nearby one of their former addresses, signifying a return to a place where the respondent may have an existing network of contacts.

There are several caveats in using these data about which researchers should be aware.

  1. In years 1984-1989 address information was in principle collected only for individuals who had changed addresses since the date of the previous interview. The raw data from those years show fewer moves from year to year than at any other time during the project. We believe moves are understated in these years. As a consequence the created variables between pairs of years that include any year 1984-1989 likely understate the degree of mobility that occurred or incorrectly assigning mobility to a later date when address data were collected with greater rigor.
  2. The distance between a respondent's addresses in pairs of years is an imperfect proxy for whether the respondent ever moved between those years. There is a fair amount of return migration, and respondents may have experienced multiple, high frequency address changes and be located at the same address at the time of the two consecutive interviews despite having moved between interviews. It is possible to detect some of these interim moves from migration histories collected in selected survey years, but these moves are not represented in these data, which only deal with location at the date of interview.
  3. The frequency of moves between all possible pairs of years, A>B, is higher than it is between adjacent interview years. Consider two individuals with complete data over a 10-year window. There are up to 9 possible moves between consecutive interviews and 45 pairs of years. If individual 1 moves once between consecutive years or 10% of the time between consecutive years, his mean of moving over all year pairs is 20% (assuming the move is in the interior of the interval). If individual 2 moves 5 times or 50% of the time between consecutive years, his mean of moves between all pairs of years is 78%. By similar logic one long distance move will generate indications of many long distance years among all possible pairs of years.
  4. There have been changes over time in the FIPS (Federal Interagency Processing Standards) codes for some counties and county equivalents. In each round of data the state and county codes reflect the contemporaneous FIPS codes. In creating the distance based variables the changes in coding were reconciled. There are cases in which the FIPS codes are different across pairs of years but the change of address variable indicates that the respondent was located at the same address. That is, the distance moved variables we created will show no move whereas an examination of FIPS codes would suggest a move.
  5. Archivists were able to identify respondents' state and county of residence even in cases where the address data were insufficient to locate the residence more precisely within the county. In some cases we could locate the respondent in a zipcode and we used the zipcode centroid as the respondent location. In other cases, we could not generate the respondent's latitude and longitude if the zipcode was not determined. As a result, there are numerous cases in which the pairwise distance variables are missing but state and county variables are available in both years.
  6. For pairs of addresses within the same county, we reviewed addresses to determine whether what appeared to be different addresses were actually the same place but with differences in spelling or other minor errors that might lead to an address being put in a different location or treated as not translatable into latitude and longitude. For example, 126 USA Street and 126 USO Street may be the same place with a typographical error. We have made an effort to reconcile these differences, eliminating such false moves.

Because software packages that assign latitude and longitude to addresses have evolved over time and differ slightly among vendors, the same address can generate slightly different latitude and longitude based on variation in the software system. We have enforced matching coordinates for matching addresses based upon the presumption that geocoding software has seen a secular improvement so that more recently generated coordinates are most likely more reliable. When the same address generates different coordinates, we accept the more recent coordinates.

Click below to view programming code.


/**Variable Names in program           Variable Names in data release**/
dist_2022_&yra (1979-2022)             distance_d22_[survey year] (1979-2022)
dist_collapsed_2022_&yra (1979-2022)   distance_dt22_[survey year] (1979-2022) 
dist_type_2022_&yra (1979-2022)        distance_df22_[survey year] (1979- 2022) 
zip_changed_2022_&yra (1979-2022)      distance_dzc22_[survey year] (1979-2022)
/*----------------------------------------------------------------------*/
array rni  (i)     rni80-rni94 rni96 rni98 rni00 rni02 rni04 rni06 rni08 rni10 
rni12 rni14 rni16 rni18 rni20 rni22;
array nonint  (i)     nonint1980-nonint1994 nonint1996 nonint1998 nonint2000 
nonint2002 nonint2004 nonint2006 nonint2008 nonint2010 nonint2012 nonint2014 
nonint2016 nonint2018 nonint2020 nonint2022;
do over rni;
	if rni>=60 then nonint=1;
	else nonint=0;
end;
nonint1979=0;
*calculate distances;
%macro survey_y(yra);
    %if &yra < 2022 %then %do;
        latA = lat&yra;     
        latB = lat2022;
        longA = long&yra;
        longB = long2022;
        centrA = zip_centroid&yra;
        centrB = zip_centroid2022;
        
        if (latA ~= . and latB ~= .) then do;
            if latA = latB and longA = longB then do;
                dist = 0;
            end;
            else do;    
                latA  = latA  * 0.017453; 
                longA = longA * 0.017453;
                latB  = latB  * 0.017453;
                longB = longB * 0.017453;
                dlat = latB - latA;
                dlong = longB - longA;
                a1 = (sin(dlat/2))**2;
                a2 = cos(latA) * cos(latB) * ((sin(dlong/2))**2);
                a = a1 + a2;
                dist = 2.0 * 3963.0 * atan2( sqrt(a), sqrt(1-a) );
                dist = round(dist * 100)/100;
            end;
            
            if dist = 0 then dist_collapsed = 0;
            else if dist < 0.189393939 then dist_collapsed = 1;       
            else if dist < 1 then dist_collapsed = 2;
            else if dist < 5 then dist_collapsed = 3;
            else if dist < 20 then dist_collapsed = 4;
            else if dist < 50 then dist_collapsed = 5;                
            else if dist < 100 then dist_collapsed = 6;
            else if dist < 500 then dist_collapsed = 7;
            else if dist >=500 then dist_collapsed = 8;
                
            if latA ~= . and latB ~= . then do;
            	if centrA = 0 and centrB = 0 then dist_type = 1; 
            	else if centrA = 1 and centrB = 1 then dist_type = 3; 
            	else dist_type = 2; 
            end;
            
            dist_2022_&yra = dist;
            dist_collapsed_2022_&yra = dist_collapsed;
            dist_type_2022_&yra = dist_type; 
        end;
        
        if zip&yra = ' ' or zip2022 = ' ' then zip_changed = .;
        else if zip&yra = zip2022 & latA~=. & latB~=. then zip_changed=0;
        else if zip&yra ~= zip2022 & latA~=. & latB~=. then zip_changed=1;
        
        if latA ~= . and latB ~= .  then zip_changed_2022_&yra = zip_changed;
        else zip_changed_2022_&yra = .;
        
		if dist_2022_&yra=. and (nonint&yra=1 or nonint2022=1) then dist_2022_&yra=-5;
		if dist_collapsed_2022_&yra=. and (nonint&yra=1 or nonint2022=1) then dist_collapsed_2022_&yra=-5;
		if dist_type_2022_&yra=. and (nonint&yra=1 or nonint2022=1) then dist_type_2022_&yra=-5;
		if zip_changed_2022_&yra=. and (nonint&yra=1 or nonint2022=1) then zip_changed_2022_&yra=-5;
		
		if dist_2022_&yra=. then dist_2022_&yra=-4;
		if dist_collapsed_2022_&yra=. then dist_collapsed_2022_&yra=-4;
		if dist_type_2022_&yra=. then dist_type_2022_&yra=-4;
		if zip_changed_2022_&yra=. then zip_changed_2022_&yra=-4;
    %end; 
%mend;
%macro rd;
    %do yra = 1979 %to 1994;
        %survey_y(&yra);
    %end; 
    %do yra = 1996 %to 2020 %by 2;
        %survey_y(&yra);
    %end; 
%mend;
%rd;
run;

NLSY79 Appendix 20: Round 20 (2002) Early Bird and Income Recall Experiments

Two experiments were implemented with the round 20 (2002) survey. Each is described in more detail below.

Early Bird Experiment

The first experiment, called the "Early Bird Experiment," sought to encourage early participation in the survey and to save resources on later locating and conversion efforts. A group of over 2800 respondents who have been friendly and cooperative in round 19 (2000) were assigned to an "Early Bird" sample of respondents. These respondents were further assigned randomly to one of 12 replicates which were fielded sequentially at regular intervals. A toll-free telephone line was established, staffed with interviewers working remotely around the country.

An initial advance letter was sent to the respondents in each replicate as their replicate was to be activated for interviewing. They were offered a higher participation fee (randomly assigned $60/$80) if they called into the toll-free line to schedule an interview within a four week window. Respondents who had not contacted the toll-free line in the first two weeks of their initial letter were sent a reminder postcard. Respondents who did not contact the toll-free line to complete their interview by the time their Early Bird window expired reverted to a $40 standard fee.

Income Recall and Estimation Experiment

The second experiment was aimed at determining the most effective way for respondents to estimate income and asset amounts. This experiment was implemented in two stages.

First, a select group of historically cooperative respondents were asked to recall their own income and, if applicable, their spouse/partner's income for the calendar year 1999. These respondents were assigned randomly to one of three types of questions and asked to estimate his/her and/or his/her spouse/partner's 1999 income. The three types of questions are described below.

  • Unfolding brackets: This involves asking the respondent first if the amount is above a certain amount, and based on that response whether it would be above a second amount. This procedure establishes a loose range for the amount.
  • Estimate to the nearest $10,000: The respondent is asked to estimate the amount to the nearest $10,000.
  • Self-reported ranges: The respondent is asked to report an upper and lower range for the amount. The intent of this type of question is to have the respondent to narrow the possible range in his or her own mind.

In the second stage of this experiment, these three types of questions were included in the instrument following selected income questions. Respondents who answered either "don't know" or "refuse" to the exact income amount were asked to estimate the amount using one of the three types of questions, depending upon the type of questions to which they were pre-assigned.

The results from this experiment were analyzed to determine which yielded

  1. estimates of 1999 income that were closest to the actual amounts given in the 2000 interview;
  2. estimates of income that most closely coincided with income reports in previous interviews and;
  3. the method most successful in gaining income estimates from respondents who otherwise refuse to give such information. 

Users interested in obtaining the results of this analysis can request the report entitled "NLSY79 Income Experiment" (Aughinbaugh, Gardecki, 2003) by emailing NLS User Services.

NLSY79 Appendix 19: SF-12 Health Scale Scoring

The SF-12, which stands for short-form 12-question, is a brief inventory of self-reported mental and physical health. This scale was administered to respondents who had turned 40 since their last interview as part of the age 40+ Health Module, included in the 1998, 2000, 2002, 2004, and 2006 surveys, and in the 50+ Health Module administered in the 2008, 2010, 2012, 2014 and 2016 surveys. The 2018, 2020 and 2022 surveys contain the 60+ Health Module for respondents born in 1963 or 1964, as well as a small number of under-60 respondents in 2022 who had not previously been administered the 50+ module.

Rather than using the twelve questions separately, SF-12 users often create two summary scores:

  • PCS-12 or Physical Component Summary (measures physical health): question name H40-SF12_PCS_SCORE, H50-SF12_PCS_SCORE, H60-SF12_PCS_SCORE
  • MCS-12 or Mental Component Summary (measures mental health): question name H40-SF12_MCS_SCORE, H50-SF12_MCS_SCORE, H60-SF12_MCS_SCORE

CHRR has received permission to calculate these summary scores for NLSY79 respondents and release the scores with the main data set. Scores are created according to the manual by Ware, Kosinski, and Keller (1995) and are provided on the data set with the question names listed above. However, we are not permitted to release the scoring formula; interested users should visit the QualityMetric website for SF survey information. For users looking at the SF surveys on the Internet, note that the NLSY79 uses version 1, not version 2, of the survey.

In large national surveys of the entire US population, both the PCS-12 and MCS-12 have a mean of 50 and a standard deviation of 10. The interpretation of these two scores is straightforward. NLSY79 respondents with a score above 50 have better health than the typical person in the general U.S. population (age is not held constant). NLSY79 respondents with scores below 50 have worse health than the typical U.S. person. Each one-point difference above or below 50 corresponds to a one-tenth of a standard deviation. For example, a person with a score of 30 is two standard deviations away from the mean.

Table 1. Summary statistics for NLSY79 SF-12 scores
Survey Year PCS Score MCS Score
1998
40+ Health Module
Mean:52.54234
StDev:7.36181
Mean:53.09726
StDev:7.84907
2000
40+ Health Module
Mean:51.9258
StDev:8.3178
Mean:52.8005
StDev:8.7351
2002
40+ Health Module
Mean:51.8369
StDev:8.22884
Mean:52.9219
StDev:8.45037
2004
40+ Health Module
Mean:52.0493 
StDev:8.05267
Mean:52.9520 
StDev:8.39288
2006
40+ Health Module
Mean:51.2377
StDev:8.3259
Mean:53.0284
StDev:8.1516
2008
50+ Health Module
Mean:49.3411
StDev:10.1989
Mean:52.2461
StDev:8.9656
2010
50+ Health Module
Mean:48.9792
StDev:10.3186
Mean:52.9244
StDev:8.9174
2012
50+ Health Module
Mean:49.1479
StDev:10.1989
Mean:52.9057
StDev:9.1790
2014
50+ Health Module
Mean:48.9292
StDev:10.4001
Mean:53.2262
StDev:8.6177
2016
50+ Health Module
Mean:48.5636
StDev:11.7487
Mean:52.3556
StDev:10.6123
2018
50+ Health Module
Mean:48.9917
StDev:11.4059
Mean:53.8298
StDev:8.9462
2018
60+ Health Module
Mean:46.5358
StDev:11.4087
Mean:52.8598
StDev:8.7285
2020
60+ Health Module
Mean:45.1580
StDev:12.9898
Mean:52.0627
StDev:10.7300
2022
60+ Health Module
Mean:46.0572
StDev: 11.5745
Mean:53.0388
StDev: 9.2205

As Table 1 indicates, the typical NLSY79 respondent self-reports better health than the typical U.S. respondent while in their 40s. This matches the results described in the SF-12 scoring manual, which in addition to population norms reports the norms for U.S. residents in specific age ranges.

Table 2. Physical Component Summary (PCS) means and standard deviations by age range
Age Range Mean Standard Deviation
35-44 52.18 7.30
45-54 49.71 9.5
55-64 46.55 10.63
65-74 43.65 11.02
Table 3. Mental Component Summary (MCS) means and standard deviations by age range
Age Range Mean Standard Deviation
35-44 50.1 8.62
45-54 50.45 9.55
55-64 50.57 9.82
65-74 52.10 9.53

NLSY79 respondents in 2008 have higher MCS scores than the overall population and similar PCS scores.

Overall, the SF-12 manual shows higher-than-average physical scores prior to age 55 and rapidly falling scores after that age. Mental scores do not appear to decline with age. Information from the NLSY79 40+, 50+, and 60+ Health Modules appears to match this pattern.

Reference

Ware, John, Mark Kosinski and Susan Keller. 1995. SF-12: How to Score the SF-12 Physical and Mental Health Summary Scales, 2nd edition. Boston: The Health Institute, New England Medical Center.

NLSY79 Appendix 18: Work History Data

NLSY79 Week Numbers and Corresponding Dates crosswalk file (.xlsx). The Continuous Week Crosswalk contains the start date for each week (Sunday) from January 1, 1978, through September 3, 2023, and the week numbers assigned to that week in the construction of the work history data file. These week numbers do not match the week numbers printed on the employment calendar included with the survey instrument materials for earlier survey years. Week numbers in the work history programs are assigned based upon actual dates collected during the course of the interview. The variable names for the week-by-week arrays (status, hours, dual jobs) incorporate the specific year and number of the week within the specific year. For example, the 10th week in 1989 in the status array is called STAT8910. These names do not correspond to the strictly consecutive week numbers from 1-2384 listed in the Excel spreadsheet. The spreadsheet also contains the week numbers for each calendar year so that users will have a crosswalk for both calendar-year and continuous week numbers.

Description of the 1979-2022 NLSY79 Work History program

This document provides a general explanation of the procedures and logic of the work history programming and variables. The original PL/I programming was used to establish and maintain the structure and data from survey years 1979 to 1994. Therefore, the following discussion heavily references these programs. The series of SQL programs currently in use were converted directly from the PL/I code for the 1996 release.

The original PL/I work history program was written to create key work variables like "Number of Weeks Worked since Date of Last Interview," "Number of Weeks Worked in Last Calendar Year," etc. These key variables use all recorded jobs for each respondent (up to 10 jobs). The WEEKLY LABOR STATUS, HOURS WORKED, and DUAL JOB arrays also were created with data from up to 10 jobs for each respondent. However, only 1% of all respondents have more than 5 jobs in any given survey year, resulting in valid missing data for jobs 6 through 10 for 99% of the sample. In order to reduce the total number of variables, public data files contain the specific employer variables for only 5 jobs for each respondent.

The purpose of the WEEKLY LABOR STATUS, HOURS WORKED and DUAL JOB arrays are to create a longitudinal work history record for each respondent through the 2022 (round 30) interview date. Because each round's survey collects information on jobs held and periods not working since the date of the last interview, it is possible to construct a continuous, week-by-week record for each respondent.

There are a few exceptions, however. In the 1979 and 1980 surveys, job information was collected only for respondents age 16 and older at the date of the interview. Additionally, the 1979 survey data contain the most cases with inconsistent or invalid employment-related data of any survey year, resulting in a greater proportion of missing gaps in the work history record. For example, in 1979 there are 86 cases that have job dates that exceed the interview date; in 1980, there are 11 cases that have job dates that exceed the interview date; in 1981 there are none.

Users should also note that 1,079 members of the military sample were dropped as of the 1985 survey. In 1991, all members of the economically disadvantaged non-black/non-Hispanic oversample were dropped as well. More information on these sample types is available in the Retention and Reasons for Noninterview section.

Description of the 1979-1994 PL/1 program

The following is an abbreviated step-by-step description of the original 1979-1994 PL/I programming. In 1996, the PL/I program was converted to SQL code in a series of programs that replicate the PL/I program and functions.

  1. All of the variables used in the program are declared and most are included in the PL/I structure called VARIABLES.
  2. The variables common to all respondents, like ID, SAMPLE_ID, etc. are assigned values. The week-by-week arrays are initialized to zero and all of the variables included in the WORK_HISTORY part of the structure are initialized to -4.
  3. For each interview year, procedures (VARIABLES1979, VARIABLES1980, etc.) that assign the variables for each survey year are called if the respondent was interviewed. Start and stop dates for jobs and periods not working are sent to the WEEK procedure, where the valid month, day and year variables are converted to a week number, with week 1 being January 1, 1978. If the respondent was not interviewed, then all WORK_HISTORY variables for that survey year are set to -5.
  4. After all VARIABLES19XX are assigned, the procedure CALC is called to evaluate the various start and stop dates, to assign codes, and to create the job number for all of the jobs for each interview year. Within CALC, the procedure FILL is called to fill in the codes that are assigned to the WEEKLY LABOR STATUS and DUAL JOB arrays and to calculate the hours worked during each week that are loaded into the HOURS WORKED array.
  5. Finally, the procedure SUMMER is called to calculate and sum the key work history variables.

CALC procedure (in original PL/1 program)

This procedure processes all jobs for each survey year, beginning with the first job. CALC starts by calculating each year the number of jobs since the date of the last interview, assigning a job number, and calculating the hourly wage for each job. If the respondent had the job at the date of the last interview, the start date becomes the date of the last interview, which is then "ceiled" or rounded up using the "ceil" function. Next, if the respondent is currently working at the job, it assigns the interview date, which is "floored" or rounded down using the "floor" function, as the stop date. (All dates at this point have been converted to week numbers in the WEEK procedure.)

If the start and stop dates of the job are valid and do not coincide with an interview date, the start and stop dates are "ceiled." The number of weeks tenure on the job is calculated by subtracting the start week from the stop week of the job. FILL is then called to fill in the week arrays for the particular job. The start and stop weeks of the job, the job number, and the number of hours usually worked per week (HOURSWEEK) at the job are sent to the FILL procedure.

If the job had any periods not working associated with it, then up to four periods not working for the employer are processed. If the start and stop dates for the periods not working are valid, a code is assigned indicating whether the respondent was out of the labor force (OLF) or unemployed for the period. If the respondent is OLF the whole period, a code of 4 is assigned. If the period not working is divided between OLF and unemployed, a temporary code of 9 is assigned and the number of weeks unemployed is determined. If the start and stop dates of the period are valid, but the labor force status cannot be determined, a code of 2 is assigned.

The period start and stop dates, CODE, and HOURSWEEK are sent to FILL. If the period dates are invalid, a code of 3 is assigned and start and stop dates of the job are passed to FILL, along with HOURSWEEK. This is only done for the first period not working for the first employer this week.

Next, tenure at the job is again calculated, this time in terms of total weeks on the job instead of just since the date of the last interview. First, a determination is made to see if the employer is the same employer a respondent reported at the time of the previous interview. If there is a previous employer number and the tenure for that previous employer is valid, then the tenure for the job from the previous interview is added to the tenure for the job being processed. Only tenure with an employer that is reported during contiguous survey years can be calculated over the total time spent with an employer. For example, consider a respondent who was interviewed in 1981, 1982 and 1983 surveys. Now suppose the respondent reported having worked for the Department of Labor at the time of the 1981 survey and left and then began working for that same employer again by the time of the 1983 survey. Because the employer numbers are only followed between contiguous interviews, there is no way to calculate total tenure with the Labor Department since the respondent did not report that employer during the 1982 survey. Only employers from the previous year's survey are compared with employers reported in the current year's survey.

Finally, CALC evaluates up to six periods not working or in the military between jobs. For each of the periods not working, the same logic used for the periods not working on a job is used for the periods between jobs.

Important information: Invalid start/stop dates

  1. If the start and stop dates for a job are invalid, then that job has no dates that can be sent to FILL. As a result, there is no record of that job in the WEEKLY LABOR STATUS array and no indication that the job is missing. In 1979, there were 1190 cases with any invalid start or stop dates (i.e., at least one week is unaccounted for - WEEKLY LABOR STATUS=0); in 1980, there were 942 cases; in 1981, there were 254; and in each of the following survey years, there were fewer than 200 cases.
  2. A job held in any day of a week is counted as a job for the whole week. This is achieved by "flooring" start dates and "ceiling" stop job dates to integer week values. There is one exception previously mentioned--stop dates for jobs held at the interview date are floored. This is done to avoid double counting across interview years.
  3. tart and stop dates for periods not working either within tenure with a job or between jobs are "ceiled" in FILL.
  4. The HOURS WORKED array is set to -3 if any job in the week has an invalid value for HOURSWEEK. Between 1979 and 1992, the maximum number of hours for any given week is 96. Beginning in 1993, the maximum number of hours for a given week can be reported up to 168 hours (the total number of hours possible in a single week).

FILL procedure

The FILL procedure takes the start and stop dates that have been converted to week number values and fills in values for the WEEKLY LABOR STATUS, HOURS WORKED and DUAL JOB arrays for each week between stopping and starting dates that are passed to it.

In FILL, the WEELY LABOR STATUS array is loaded with either a survey year job number or a code signifying that there was not one civilian job that week (a code of 0, 2, 3, 4, 5, or 7). The DUAL JOB arrays are loaded with a survey year job number(s) if more than a civilian job is held that week; otherwise it is assigned a value of 0. The HOURS WORKED array is loaded with the number of hours worked on all jobs held that week, up to a maximum of 96 through 1992, and a maximum of 168 in subsequent years.

FILL is called from the CALC procedure for all start and stop dates except for military start and stop dates. Military start and stop dates are determined in the VARIABLES procedures for each year, and FILL is called from those procedures to fill in a code of 7 in the WEEKLY LABOR STATUS array for active military service.

Initially, FILL checks for valid start and stop dates. If the dates are valid, then FILL takes one of three paths. The first path is to evaluate the WEEKLY LABOR STATUS array for that week to see (1) if it contains a job number, (2) if the code passed from CALC is a job number, and (3) if the previous employer number for the job is different from the job number in the WEEKLY LABOR STATUS array. If all of these statements are true, then FILL determines that the job is not a duplication of the job that exists in the WEEKLY LABOR STATUS array for that week.

Next, FILL looks at the DUAL JOB arrays to see if there is a job number in a DUAL JOB array. If a DUAL JOB array already has a job number(s), then the current job number is compared to the DUAL JOB job number(s). If the job number does not exist in a DUAL JOB array, then the HOURSWEEK for that job is added to the number of hours for that week for the HOURS WORKED array and the job number is added to a DUAL JOB array. If the job is a duplicate job, then nothing is done to the arrays.

The second path is taken if there is no dual job and if the week dates are associated with a job or if there is not job number in the WEEKLY LABOR STATUS array. If this is the case, FILL tests for two conditions. The first condition is met if COD is 9. (A code of 9 means that the respondent had a period not working that was part OLF and part unemployed.) If COD equals 9, then the HOURSWEEK are subtracted from the hours in the HOURS WORKED array, because the respondent is not working at the job. The number of weeks unemployed (code of 4) is arbitrarily assigned to the middle portion of the weeks not working, and the rest of the period is determined to be OLF (code of 5).

The second condition in the second path tests to see if the value in the WEEKLY LABOR STATUS array is not a code of 4; if COD is a job number then the job number is placed into WEEKLY LABOR STATUS. If there are hours for the week and if the respondent was not working for the employer during this week, then the hours for the week are set to zero if the HOURS WORKED array is greater than zero. Otherwise, HOURS WORKED receives whatever value is in HOURSWEEK.

The third path FILL evaluates is if the week falls in a period not working and if there is a dual job. Then, the job number is deleted from the DUAL JOB arrays and HOURSWEEK for the job are subtracted from the HOURS WORKED array.

Finally, if there are more than four dual jobs in the DUAL JOB arrays then no other job numbers are added to the DUAL JOB arrays because the arrays accommodate up to four dual jobs.

Important information: Additional FILL procedure notes

A few last notes about FILL:

  1. Civilian work takes precedence over any other activity. If the respondent has a civilian job while in the military, then the civilian job code replaces the military code in the WEEKLY LABOR STATUS array.
  2. The order of precedence in the construction of the WEEKLY LABOR STATUS array after a civilian job is as follows:
    1. a code of 3, associated with an employer but periods not working with employer are missing; if any period not working is missing, then the entire period of the job is assigned a 3. In 1979, there are 274 cases with invalid period dates, and in each of the following survey years, there are fewer than 60 cases
    2. a code of 4, unemployed
    3. a code of 5, OLF
    4. a code of 2, period not working with employer, but OLF vs unemployed status is unknown
    5. a code of 7, active military service
    6. a code of 0, no information is reported to account for the week
  3. About 32 cases have a week in which JOB # 1 from a survey week first appears in the DUAL JOBS array rather than the WEEKLY LABOR STATUS array. This occurs when (1) there is a discrepancy between the date of the previous interview date as it appears on the info sheet that the interviewer uses at the time of the interview and the interview date recorded at the previous interview or (2) the starting date and ending date for a job across interview years are the same due primarily to the way the dates are floored and ceiled. In all these cases, an erroneous entry appears in the DUAL JOB array for that given week.

Changes to the Work History data

There have been a number of changes and updates to programs and input variables that are used to create the Work History data over the NLSY79 tenure. The most significant programming change was the conversion of the programming from PL/1 to equivalent SQL code. A list of the main NLSY79 variables used in the creation of the 1979-1996 work history data set is accessible at the end of this appendix.

Click below to view other changes and updates.

Changes between the 1979-86 and the 1979-87 Work History Data File

In 1987, a few changes were made to the program that created the work history data. These changes from the 1986 program affected the created labor force participation key variables, the WEEKLY LABOR STATUS array, and the HOURS WORKED array.

The following is a detailed discussion of the changes in the code that were made and the effects of those changes on the key variables and the week-by-week arrays:

  1. In the CALC PROC, the stop dates for all jobs and all periods not working were set to the interview date if the dates were greater than zero and if they were greater than the interview date. These changes resulted in an increased number of weeks unaccounted for in calculating weeks not working and in changes in the number of weeks unemployed and out of the labor force across all of the key variables for each survey year. Most of the changes were a difference of one week or a change to an invalid value.
  2. In the FILL PROC when hours were subtracted from the weekly HOURS WORKED array, a check was made to determine if the subtraction resulted in a value greater than or equal to zero. If it did not, the value in the HOURS WORKED array for that week was set to zero. If there was no dual job for that week, then the value in the HOURS WORKED array for that week was set to zero; previously, a subtraction was performed.
  3. Before these changes, some cases had negative hours (not including missing value codes) in some of the weeks in the HOURS WORKED array. Now, all of the values in the HOURS WORKED array are positive except for the standard missing values. These changes resulted in an overall decrease in the number of hours reported in a given week and in the number of hours calculated for the last calendar year and since the date of the last interview for those cases that were affected.

Note: The Work History Key Variable Cases Changed in 1987 Work History Program (PDF) contains a table listing the key variables for each year that had a change in values and the number of cases that had a change in the calculation of that key variable between the 1979-1987 work history creations and the previous years.

Changes between the 1979-1987 and the 1979-1988 Work History Data File

Most changes made to the work history program between the 1979-87 and 1979-88 releases did not affect the content of the variables themselves. Some changes were made to simplify the reading and use of the program in the future. Format changes were also made to allow for larger variable lengths. Because 1988 is the 10th year of the NLSY79, variables such as a job number, which provided only one space for the survey year, were expanded. The DUAL JOB array was no longer concatenated. Instead, four variables are created for each week in the array, allowing (as before) for up to four dual jobs per week.

Substantive changes are not major and are a function of changes in the questionnaire:

  • HOURSWEEK in 1988 also includes additional hours worked at home if any are reported. The 1988 questionnaire asked respondents separately about hours worked at home for a job. If any hours worked at home were reported, respondents were asked if their total hours worked per week included those hours worked at home. If not, the total hours worked per week and the hours worked at home were added together to get a total number of hours worked per week anywhere for a job.

Changes between the 1979-1988 and the 1979-1989 Work History Data File

A new set of variables was created in the 1979-89 work history program. These additions did not affect the content or substance of already existing variables.

  • A set of JOBSEVER variables was created from 1979-1989. These variables provide a cumulative count of the number of different jobs that have ever been reported by a respondent up to the date of interview for the survey year. Users should note that, as with calculations for the TENURE variables discussed earlier in this program description, employers can only be traced through contiguous years. In non-contiguous years, the number of jobs reported may be slightly inflated in some cases.

Some data changes were made in existing variables as well. Two of these reflect corrections that have been made in the calculations for 1987 and 1988 variables.

  1. The 1987-88 TENURE variables created by the 1979-87 and 1979-88 work history programs were in error. An error in the program statements which calculate this variable resulted in large numbers of respondents with valid values receiving -3 values instead. This error was corrected and the changes have been incorporated in subsequent releases.
  2. Beginning with the 1979-88 data release, the HOURSWEEK variable was created to include additional hours worked at home on a job, if reported. Although this was true for employers #6-10, the necessary programming changes for employers #1-5 were inadvertently omitted from the program. Therefore, employers #1-5 were calculated as they have been in previous work history programs, based upon one question without qualification for any additional hours worked at home. The omission was corrected.
  3. In 1988, 116 cases reported a 3rd within-job gap for at least one job. The information for these gaps was erroneously included as information for a 4th within-job gap. The 3rd within-job gaps for these cases would have been missing. This was corrected for the 1979-89 release. Additionally, information on a 4th within-job gap for at least one job was included for 18 cases.

Changes between the 1979-1989 and the 1979-1990 Work History Data File

A minor modification was made to the procedure which calculates the Hourly Rate of Pay (HRP#) from PAYRATE and TIMEUNIT). Starting in 1990, any PAYRATE with a value of 9999995 is set to -4 by the HRP procedure. This 9999995 value indicates a case for which the dollars and cents PAYRATE exceeded $100,000.00.

Some data updates were made to existing variables as well.

  1. Specific job information for 70 cases was edited, for one or more jobs, due to improper identification of CPS jobs in the Employer Supplements.
  2. Corrections were made to 23 cases for 1988 PAYRATES and/or 1988-1989 HOURLYWAGES. These cases exceeded $100,000.00 and should have been assigned the 9999995 value. While some contained that value, some retained an erroneous dollars and cents value in PAYRATE. In either case, the HOURLYWAGEs were calculated based upon an incorrect PAYRATE figure. The above-mentioned adjustment to HRP procedure will prevent the calculation of HOURLYWAGE figures from the truncated 9999995 value in the future.

Changes between the 1979-1991 and the 1979-1992 Work History Data File

A change has been made to the structure of the 1979-1992 work history data file on magnetic tape only. Due to the volume of the current work history data file, the data were split into two records. The first record contains the data for the STATUS, HOURS and DUALJOBS arrays. The second contains the remainder of the data, pertaining to specific job characteristics, gaps in employment and summary labor force activity variables. Those wishing to use only job specific variables can now do so without being required to process information for an entire case to do so. Those wishing to incorporate the arrays in analysis can access them in a separate record. Tape users should refer to the record layout and format table provided in this package of documentation for details on the exact location of each variable. This change does not affect the content or substance of already existing variables.

A correction was made to an existing set of variables as well. Users have already been notified of the inadvertent omission of hourly rates of pay for those respondent reporting earnings on a semi-monthly basis in the 1990 and 1991 main NLSY79 and work history data files, and in the Winter 1993 (No. 74) issue of NLSUPDATE. These cases have been corrected in the 1979-1992 version of the work history data file.

Changes between the 1979-1992 and the 1979-1993 Work History Data File

Beginning with the 1979-1993 release, the formats for the PAYRATE variables have been extended to 8 characters to accommodate values up to 99999999 ($999999.99). Previously, these cases containing these variables had been assigned a PAYRATE value of 9999995 and set to -4 in the HRP procedure, which creates the HOURLYWAGE variables. Valid PAYRATE and HOURLYWAGE values are now present in these cases.

Changes between the 1979-1993 and the 1979-1994 Work History Data File

The recall experiment (an experiment to test the recall of respondents over a two year period) was conducted with over 850 randomly selected respondents during the 1994 interview. For this experiment, respondents were treated as if the 1993 interview never took place; the interview was conducted as if the 1992 interview was the most recent. Because data from 1993 were already incorporated into the work history data, programmers sought to keep redundant data from the 1994 interview for the "recall" cases from overwriting the already incorporated 1993 data. Efforts were made to eliminate the overlap between the information reported in 1993 and 1994 for those cases, and to keep only the information from the 1994 interview that covered the period since the 1993 interview. However, there were isolated circumstances in which this was not possible. These relate to the assignment of "OLF" versus "unemployed" labor force status during periods not working which contain both types of statuses (see earlier discussion in this document). While it is possible to determine which part of a period not working occurred since the 1993 interview, it is not possible to make the same determination for "OLF" versus "unemployed" status during those periods. Therefore, it is likely that in some cases these statuses would not have been assigned correctly to certain periods not working. See Appendix 16 for further details on the recall experiment.

Changes between the 1979-1994 and the 1979-1996 Work History Data File

Through survey year 1994, the work history data was created by running PL/I programs on an IBM mainframe. In 1996, the volume of the work history data dictated a change to a more efficient method of production. To create the 1979-1996 data, the PL/I program was converted to a series of programs SQL code. Relevant variables from the main NLSY79 data were loaded into a relational data base, from which the work history data was generated. The SQL code that generated the data replicates the PL/I program, both in substance and function.

For respondents with missing interviews between the last interview and 1996, the WEEKLY LABOR STATUS, HOURS WORKED and DUAL JOB arrays were updated by the SQL program in the same manner as in past years with the PL/I programs.

Although the SQL programs are not included in this appendix, a separate addendum contains the PL/I programs from past years (see Work History PL/1 Programs). A list of the main NLSY79 variables used in the creation of the 1979-1996 work history data set is accessible at the end of this appendix.

Changes between the 1979-1996 and the 1979-1998 Work History Data File

Windows-based extraction software accompanied the 1979-1998 separate Work History data release for the first time.

The TENURE variable for job #2, reported in 1980, was found to be in error on the 1979-1996 work history release only. This variable was replaced with the correct data on the 1979-1998 work history release.

Changes between the 1979-1998 and the 1979-2000 Work History Data File

The 1979-2000 (round 19) combined public data release, marked the first time that the work history data was released in combination with the main NLSY79 data. Data items formerly available only in a separate work history data release, including the week-by-week arrays, were made available in a series of new areas of interest in the public release data set, using the same extraction software as the main NLSY79 data. This eliminated the need for multiple extracts and merging of data from different data sets, as well as the duplication of some information specific to individual jobs and respondents between data files.

The following areas of interest contain variables generated by the Work History programs that were formerly available only on the separate Work History release.

  • WORK HISTORY -- CALENDAR YEAR
  • WORK HISTORY -- DUAL JOB [1-4]
  • WORK HISTORY -- GAPS BETWEEN JOBS
  • WORK HISTORY -- HISTORY
  • WORK HISTORY -- HOURS WORKED
  • WORK HISTORY -- JOBS
  • WORK HISTORY -- MILITARY
  • WORK HISTORY -- SINCE LAST INTERVIEW
  • WORK HISTORY -- WEEKLY LABOR STATUS

Changes between the 1979-2000 and the 1979-2002 Work History Data File

The 1979-2002 (round 20) Employer Supplements underwent some significant revisions to better accommodate respondents reporting self-employed and non-traditional (temporary, contracting, on-call, etc.) types of employment situations, as well as teaching occupations. Many adjustments involved asking comparable or consistent questions with wording more appropriate to the type of employment being reported. These additional questions have been incorporated wherever necessary in the construction of the Work History data to produce variables consistent with those produced historically. Relevant question names are noted in the discussions below.

The 2000 Census Industry and Occupation Classifications were used to code the 2002 NLSY79 data. Prior to survey year 2002, industry and occupation data were coded using the 1970 codes, with 1980 codes being assigned to the current/most recent job for the respondent only.

Description and codes for variables in 1979-2022 NLSY79 Work History data

Below are discussions of three types of variables:

  • the weekly arrays created by the Work History programs
  • other items produced by the Work History programs
  • variables that are either used in the Work History programs, or are basic, commonly used job-specific survey items

Variable coding information, as well as formulas for combining job-specific characteristics from several sources, are included where relevant.

Work History weekly array variables

The foundation of the work history data is the set of week-by-week arrays depicting labor force status, total number of hours, and dual job holdings if any, for each week since January 1, 1978. These array variables are found in three areas of interest in the NLSY79 public release. The construction and coding for each of the three arrays are described below, listed by their area of interest.

Area of interest: WORK HISTORY-WEEKLY LABOR STATUS

The WEEKLY LABOR STATUS array is the work history week array. Each variable corresponds to a week relative to 1/1/78.[Note 1] There are 2385 variables in the 1979-2022 WEEKLY LABOR STATUS array--one for week #0 and one for each of the 2384 weeks from 1/1/78 to 09/03/2023.[Note 1] [Note 3] There are no missing data codes, and the codes that are in the array are as follows:

Table 1. Weekly Labor Status array codes

Code

Description

0

No information reported to account for week.

2

Not working (unemployment vs. out of the labor force cannot be determined.)

3

Associated with an employer but the periods not working for the employer are missing. If all of the time with the employer cannot be accounted for, a 3 is loaded into the STATUS array instead of a job code.

4

Unemployed. If a respondent is not working and part of the time is spent looking for work or on layoff, the exact weeks spent looking for work is unknown. As a result, the number of weeks spent looking is assigned to the middle part of the period not working.

5

Out of the labor force.

7

Active military service. If a respondent has a civilian job while in active military service, the civilian job code is loaded into the array instead of a code of 7.

>100

Worked. The code represents the appropriate work history year multiplied by 100 plus the job number for that employer in that year. For example, 102=year 1, job 2; 305=year 3, job 5. This allows one to associate any characteristic for a job with that week. If a respondent has more than one job at the same time, the job number that is loaded into the array is determined by the starting date of the job with the lowest job number, not by any particular characteristics of the job such as the number of hours worked at the job. The year in the job code is the year in which the job is reported. Jobs held in year 2, but reported in year 10 would be assigned job numbers beginning with 1001 instead of 201.

Important information: OLF and unemployed

In some cases, a respondent reports a period not working that is part OLF and part unemployed. In these cases, a week-specific distinction between OLF and unemployed cannot be made. Users should refer to the Work History Program Description in this appendix for a discussion of how OLF and unemployed codes are assigned to the WEEKLY LABOR STATUS array in the event that such a period occurs.

Area of interest: WORK HISTORY-HOURS WORKED

The HOURS WORKED array contains the usual hours worked per week at all jobs. There are 2385 variables in the 1979-2022 HOURS WORKED array--one for week #0 and one for each of the 2384 weeks from 1/1/78 to 09/03/2023.[Note 3] The codes are as follows:

Table 2. Hours Worked array codes

Code

Description

0

No hours worked or interview does not cover array week

1-95

Usual hours worked per week

96

96 or more hours per week

-5

Noninterview

-4

Valid skip

-3

Invalid skip

-2

Don't know

-1

Refusal

Important information: Max hours allowed

Beginning in 1993, the first all-CAPI survey year, the maximum hours allowed per week is 168.

Area of interest: WORK HISTORY-DUAL JOB 1-4

The DUAL JOB arrays contain job numbers for any weeks when the respondent worked at more than one job simultaneously. There can be up to 2385 variables in each DUAL JOB [#] array -- one for week #0 and one for each of the 2384 weeks from 1/1/78 to 09/03/2023.[Note 1] [Note 3] DUAL JOB array variables are present if a dual job was reported.[Note 2]

The codes are as follows:

Table 3. Dual Job array codes

Code

Description

0

No dual job

>100

Dual job year and job number

For example, if a respondent worked at three jobs at the same time, the code for the lowest job number would be in the WEEKLY LABOR STATUS array, and the codes for the other two jobs would be in the DUAL JOB arrays (see below). If the three jobs that the respondent held during week 190 from the 1981 (round 3) survey were jobs 1, 5, and 6, then WEEKLY LABOR STATUS would contain the value '301' for that week, the DUAL JOB 1 array for week 190 would contain the value '305' and the DUAL JOB 2 array for week 190 would contain '306'.

Important information: Additional dual job notes

  1. The maximum number of dual jobs accounted for is 4. The variable descriptions for variables in the WORK HISTORY - DUAL JOB [#] areas of interest indicate the relevant job number and week.
  2. The DUAL JOB [#] arrays do not provide labor force status in the detailed manner of the WEEKLY LABOR STATUS array. They contain only second, third, fourth, and fifth job numbers for weeks in which the respondent reports more than one employer.
  3. Users should be aware that it is possible in survey years 1979-1992 for the CPS job number to appear in one of the DUAL JOB [#] arrays instead of the WEEKLY LABOR STATUS array, as would be expected. In most cases, the CPS job will be the lowest number job for a given year. However, this is not always the case. Each year contains a relatively small number of cases for which JOB #1 is not the CPS job. For these cases, the job number assigned by the work history program will not necessarily be the lowest one for that year. In cases for which the CPS job is not held simultaneously to any other job, the job number for the CPS job will appear in the WEEKLY LABOR STATUS array as expected. However, in cases for which the CPS job is held simultaneously with another job with a lower job number, the possibility exists that the job number for the CPS job will appear in one of the DUAL JOB [#] arrays instead of the WEEKLY LABOR STATUS array. Mechanical changes implemented in the 1993 CAPI instrument to ensure that the CPS job is always the first job have virtually eliminated this possibility from 1993 forward.

Work History non-weekly array created

Non-weekly array variables produced by the work history programs are listed below by area of interest. Variables marked with an asterisk (*) contain an actual consecutive week number, ranging from week #0-2384, with the week of January 1, 1978, being week #1. Week #0 represents information for time prior to that date.

Area of interest: TIME & TENURE W/EMPLOYER

Table 4. Work History: Main Created variables
Question Name Variable Title
TENURE[#] Total weeks tenure at each job as of interview date

Area of interest: WORK HISTORY-MAIN-CREATED

Table 5. Work History: Main Created variables
Question Name Variable Title
MILWK-SLI Weeks of active military service since date of last interview
WKSWK-SLI Number of weeks worked since date of last interview
HRSWK-SLI Number of hours worked since date of last interview
WKSUEMP-SLI Number of weeks unemployed since date of last interview
WKSOLF-SLI Number of weeks out of the labor force since date of last interview
WKSUNACCT-SLI Percentage of weeks unaccounted for in calculating weeks worked since date of last interview
MILWK-PCY Weeks of active military service in past calendar year
WKSWK-PCY Number of weeks worked in past calendar year
HRSWK-PCY Number of hours worked in past calendar year
WKSUEMP-PCY Number of weeks unemployed in past calendar year
WKSOLF-PCY Number of weeks out of the labor force in past calendar year
WKSUNACCT-PCY Percentage of weeks unaccounted for in calculating weeks worked in past calendar year
WKSSINCELI (see also KEY Variables) Number of weeks since date of last interview
JOBSNUM Number of jobs ever reported as of interview date

Area of interest: KEY VARIABLES

Table 6. Work History: Key variables
Question Name Variable Title
WKSSINCELI (see also WORK HISTORY-MAIN-CREATED) Number of weeks since date of last interview

Area of interest: Earnings

Table 7. Work History: Earnings variable
Question Name Variable Title
HRP[#] Usual wage earned at each job converted to an hourly rate

Area of interest: WORK HISTORY-HISTORY

Table 8. Work History: History variables
Question Name Variable Title
LASTINT_WK#_[YEAR]* Week of last interview
CURRINT_WK#_[YEAR]* Week of current interview

Area of interest: WORK HISTORY-CALENDAR YEAR

Table 9. Work History: Calendar Year variables
Question Name Variable Title
CAL_YEAR_JOB[#]_[YEAR] Job number that is loaded into the WEEKLY LABOR STATUS array for each job. The 1st two digits of the number are the survey year (01 thru 30) and the 2nd two digits are the job for that year (job 01 thru 10)
CAL_YEAR_JOBS_[YEAR] Number of jobs in past calendar year
WKS_NWMISSC_[YEAR] Percentage of weeks not employed in past calendar year that cannot be split between unemployed and out of the labor force

Area of interest: WORK HISTORY-JOBS

Table 10. Work History: Jobs variables
Question Name Variable Title
START_WK#_[YEAR]_JOB#[##] Starting week of each job
STOP_WK#_[YEAR]_JOB#[##] Stopping week of each job
PER[#]_START_[YEAR]_JOB#[##] Starting week of each period not working for each job
PER[#]_STOP_[YEAR]_JOB#[##] Stopping week of each period not working for each job
PREV_EMP#_[YEAR]_JOB#[##] Previous job number at last interview for each job
JOB_NUM_A_[YEAR]_JOB#[##] Job number in STATUS array for each job

Area of interest: WORK HISTORY-GAPS BETWEEN JOBS

Table 11. Work History: Gaps Between Jobs variables
Question Name Variable Title
BSTART_[YEAR]_PERIOD[#] Week started each period not working between jobs
BSTOP_[YEAR]_PERIOD[#] Week stopped each period not working between jobs.

Area of interest: WORK HISTORY-SINCE LAST INTERVIEW

Table 12. Work History: Since Last Interview variables
Question Name Variable Title
LASTINT_#JOBS_[YEAR] Number of jobs since the date of the last interview
WKS_NWMISSL_[YEAR] Percentage of weeks not employed since the date of the last interview that cannot be split between unemployed and out of the labor force

Area of interest: WORK HISTORY-MILITARY

Table 13. Work History: Military variables
Question Name Variable Title
MIL_START1_[YEAR] Starting week of first period of active military service.
MIL_START2_[YEAR] Starting week of second period of active military service.
MIL_STOP1_[YEAR] Stopping week of first period of active military service.
MIL_STOP2_[YEAR] Stopping week of second period of active military service.

NLSY79 main data Work History variables

A third set of variables are either used in the Work History programs, or are basic, commonly used job-specific and gap-related survey items. These items are enumerated in "Work History Job and Gap-specific Survey Items (2022)" section below, click to view details.

The separate Work History data files released prior to survey year 2000 contained a large number of duplicated items pertaining to jobs, job gaps, and the individual respondents that were copied straight from the main data file. In the public data releases in 2000 and subsequent years, these items can be found in their traditional place among public release data items. They are listed below by type of variable. Example QNAMES for the most current survey year for each variable are listed in parentheses. The variable names each was assigned in 1979-1994 PL/I programs are listed in parentheses. The SAS and SQL programs that use the items in the table below to compute inputs for and create the Work History variable outputs can be found the Variables used in creation of 1996 and subsequent Work History data file section below.

Type Question Name Description
Respondent Variables PUBLIC ID Respondent's public identification code
SAMPLE_SEX (SEX) Respondent's sex
SAMPLE_RACE (RACE) Respondent's race
SAMPLE_ID (SAMPLE_ID) Respondent's sample type
Q1-3_A~M (BIRTHM_79) Respondent's month of birth from the 1979 interview.
Q1-3_A~Y (BIRTHY_79) Respondent’s year of birth from the 1979 interview.
Q1-3_A~M (BIRTHM_81) Respondent's month of birth from 1981 interview or from 1979 interview if 1981 non-interview
Q1-3_A~Y (BIRTHY_81) Respondent's year of birth from 1981 interview or from 1979 interview if 1981 non-interview
Survey year variables (data present for each survey year) SAMPWEIGHT (WEIGHT) Sampling weight
CURDATE~M (INTM) Date of interview - Month
CURDATE~Y (INTY) Date of interview - Year
Job variables (data present for up to 5 jobs for each survey year) EMPLOYER_STARTDATE.##~M (STARTM) Starting month of job
EMPLOYER_STARTDATE.##~Y (STARTY) Starting year of job
EMPLOYER_STOPDATE.##~M (STOPM) Stopping month of job
EMPLOYER_STOPDATE.##~Y (STOPY) Stopping year of job
QES-4A.## & QES-4B.## (PAST) Starting date of each job is before, the same as, or after the date of the last interview?
*Combination of two variables in CAPI interviews
QES-23.## (CURRENT) Currently working for employer at date of interview
QES-23A.## (WHYLEFT) Reason left job
*Please note that coding varies over time
EMPLOYER_CPSFLAG.## (CPSJOB) Is employer the CPS employer? In other words, is employer the current or most recent employer?
*This variable is all -4's for 1979, when job 1 is the CPS job. Beginning in 1993, job #1 is always the CPS job if there is one.
OCCALL-EMP.## (OCCUPATION) Kind of work usually done for employer - 1970 codes through survey year 2000, 2000 codes thereafter.
INDALL-EMP.## (INDUSTRY) Kind of business or industry of employer - 1970 codes through survey year 2000, 2000 codes thereafter
COWALL-EMP.## (CLASSWORKER) Employee of a private company, a government employee, self-employed, or working without pay at a family business or farm of worker at each job?
*Please note coding changes beginning in 1994
QES-51.## (HOURDAY) Hours per day usually worked at job
PAYRATE-ALL-EMP.## (PAYRATE) How much usually earned at job
QES-71A.## (TIMERATE) Pay rate reported per hour, per day, per week, or what at job
QES-88B.## (UNION) Wages or salary at each job set by a collective bargaining agreement between employer and a union or employee association?
*Please note restriction on hours per week working varies over time
QES-22.## (GOVTJOB)* Is one or more of government job codes circled on the cover of employer supplement? In other words, is job a government-sponsored job?
*Question eliminated in 1988
QES-28.## (WEEKSNOTWORKED) Between start and stop dates for each job for each year, were there any periods of a full week or more during which R did not work for employer, not counting paid vacations or paid sick leave?
QES-6.## (PRETEN) The total number of months worked for employer before date of last interview
Gaps within jobs (data present for up to 4 gaps within each job for each survey year) QES-33.## (REASON) Reason not working for employer for each period not working
QES-36.## (ALL) How many weeks looking for work or on layoff during each period not working?
QES-41.## (LOOK) Number of weeks not working or looking for work or on layoff during each period not working
Gaps between jobs (data present for up to 6 gaps between jobs for each survey year) Q7-12.## (BALL) How many weeks not working spent looking for work or on layoff during periods not working between jobs?
Q7-16.## (BLOOK) Number of weeks looking for work or on layoff during periods not working between jobs
Q7-19.## (BREASON) Reason not looking for work during periods not working between jobs

Variables compiled from NLSY79 main data variables A small set of variables in the pre-2000 separate work history data files were created from multiple variables in the main data. They are listed below, along with the items that were used to compile them in the most recent year available.

Question Name Description
  • QES-52A.##*
  • HOURS_WORKED_WEEK_ALL.##
  • (HOURSWEEK)**

Hours per week usually worked at each job

*Variables exist through 2012 survey year.
**Beginning in 1988 this variable includes additional hours worked at home if any are reported

  • EMPLOYER_EMPPREVID.##
  • (PREVIOUSEMP#)

Job number assigned to employer from last interview as listed on information sheet for each interview year. This allows for matching employers between consecutive interview years only.

See Appendix 9: Linking Employers Through Survey Years for a more detailed discussion.

Variables used in creation of 1996 and subsequent Work History data file

Beginning in 1996, the work history programming was converted to SQL programming. The SQL programs, which mirror the older PL/1 program run prior to 1996, are available by accessing the "Work History SQL Variable Creation Programs" section below. Programs that create the input variables for the Work History SQL programs can be accessed in the "Work History Inputs Creation Programs" section below.

Click to view programming code.

Employer Data Table Variables

EMPLOYER, PUBID,  JOBSTWHN, MNSB4DLI, CURWKEMP, YLEFTJOB, ANYWJGAP, STAJOBCM, STAJOBCD, STAJOBCY,  STOJOBM, STOJOBD, STOJOBY, STAWGP1M,  STAWGP1D, STAWGP1Y, STOWGP1M, STOWGP1D,  STOWGP1Y, STAWGP2M, STAWGP2D, STAWGP2Y, STOWGP2M, STOWGP2D, STOWGP2Y, STAWGP3M, STAWGP3D, STAWGP3Y, STOWGP3M, STOWGP3D, STOWGP3Y, STAWGP4M, STAWGP4D, STAWGP4Y, STOWGP4M,  STOWGP4D, STOWGP4Y, YNWKWG11, YNWKWG1C, WKLKWG11, WKLKWG12, YNWKWG21, YNWKWG2C, WKLKWG21, WKLKWG22, YNWKWG31, YNWKWG3C, WKLKWG31, WKLKWG32, YNWKWG41, YNWKWG4C, WKLKWG41, WKLKWG42, HRSDAYU, HRSWKU, HRSWKUHM, HRSWK, OCCSMDLI, ROPTU, HRROP1, HRROP2, HRROP3, HRROP4, HRROP5, WKROP1, WKROP2, WKROP3, WKROP4, WKROP5, WKROP6, MOROP1, MOROP2, MOROP3, MOROP4, MOROP5, MOROP6, YRROP1, YRROP2, YRROP3, YRROP4, YRROP5, YRROP6, BWROP1, BWROP2, BWROP3, BWROP4, BWROP5, BWROP6, PAYRATE, UNIONJOB, PREVID, IND, OCC, COW

Gaps Data Table Variables

SURVYR, PUBID, STABGPM1, STABGPD1, STABGPY1, STOBGPM1, STOBGPD1, STOBGPY1, WKLKBG11, WKLKBG12, YNOLKB1G, STABGPM2, STABGPD2, STABGPY2, STOBGPM2, STOBGPD2, STOBGPY2, WKLKBG21, WKLKBG22, YNOLKB2G, STABGPM3, STABGPD3, STABGPY3, STOBGPM3, STOBGPD3, STOBGPY3, WKLKBG31,WKLKBG32, YNOLKB3G, STABGPM4, STABGPD4, STABGPY4, STOBGPM4, STOBGPD4, STOBGPY4, WKLKBG41, WKLKBG42, YNOLKB4G, STABGPM5, STABGPD5, STABGPY5, STOBGPM5, STOBGPD5, STOBGPY5, WKLKBG51, WKLKBG52, YNOLKB5G, STABGPM6, STABGPD6, STABGPY6, STOBGPM6, STOBGPD6, STOBGPY6, WKLKBG61, WKLKBG62, YNOLKB6G

Newyear Data Table Variables

SURVYR, PUBID, NORCID, WEIGHT, CURINTMO, CURINTDA, CURINTYR, LINTMO, LINTDAY, LINTYR, MILOUTLI, MILINLI, AMILCRLI, MILOUTM1, MILOUTD1, MILOUTY1, MILSINLI, MLSINLI2, MLSINLI3, MLSINLI4, MLSINLI5, CRMLSNLI, AMILSNLI, MILINM1, MILIND1, MILINY1, SRVACTML, Q4_12A, MILINM2, MILIND2, MILINY2, MILINM3, MILIND3, MILINY3, MILOUTM2, MILOUTD2, MILOUTY2, MILOUTM3, MILOUTD3, MILOUTY3, ACTMLNOW, MILSTDLI

01_INITARRAYS.SQL

set serveroutput on
DECLARE
max_wk number(5);
max_master_wk number(5);
BEGIN
SELECT MAX(wk_num) INTO max_wk FROM datadba.weeks;
SELECT MAX(endwk)  INTO max_master_wk FROM datadba.master_weeks;
DBMS_OUTPUT.PUT_LINE('PREV MAX WEEK# (from datadba.weeks)         : ' || TO_CHAR(max_wk));
DBMS_OUTPUT.PUT_LINE('NEW MAX WEEK#  (from datadba.master_weeks)  : ' || TO_CHAR(max_master_wk));
 FOR n IN 1..12686 LOOP
  FOR i IN max_wk+1..max_master_wk LOOP  /* 104 weeks+2 extra just in case*/
  INSERT INTO datadba.weeks VALUES (n,i,0,0);
  END LOOP;
 COMMIT;
 END LOOP;
END;
/
exit;

02_HISTORY.SQL

set serveroutput on;
delete from datadba.history where round=30;
DECLARE
      max_value INTEGER;
      var_pubid   INTEGER;
      month  NUMBER (2);
      day    NUMBER (2);
      year   NUMBER (4);
      leap   NUMBER (5,2);
      days_month INTEGER;
      temp_weight INTEGER;
      max_lintwk INTEGER;
      wk_num  NUMBER (7,2);
      CURSOR id_cursor IS
                       SELECT pubid
                       from datadba.newyear_data order by pubid;
BEGIN
      OPEN id_cursor;
      LOOP
          FETCH id_cursor INTO var_pubid;
          EXIT WHEN id_cursor%NOTFOUND;
          SELECT weight, curintmo, curintda, curintyr 
              INTO temp_weight, month,day,year
              FROM datadba.newyear_data
              WHERE pubid=var_pubid;
           
          SELECT MAX(round), MAX(currint_wk#)
          INTO max_value, max_lintwk FROM datadba.history
          WHERE public_id=var_pubid;
          max_value :=max_value + 1;
          max_lintwk :=max_lintwk+1;
          IF temp_weight = 0 THEN
             INSERT INTO datadba.history 
             VALUES (var_pubid, max_value, 0, -5, -5, -5, -5, -5);
             GOTO nextcase;
          END IF;
          leap:=0;
          IF year<=99 THEN DBMS_OUTPUT.PUT_LINE('HALT !!! NON Y2K YEAR'); END IF;
          IF year>=1980 THEN
            leap:=CEIL((year-1980)/4);
          END IF;
          IF MOD(year,4)=0 AND month>2 THEN
             leap:=leap+1;
          END IF;
          IF month=1 THEN
            days_month:=0;
          END IF;
          IF month=2 THEN
             days_month:=31;
          END IF;
          IF month=3 THEN
            days_month:=59;
          END IF;
          IF month=4 THEN
            days_month:=90;
          END IF;
          IF month=5 THEN
            days_month:=120;
          END IF;
          IF month=6 THEN
             days_month:=151;
          END IF;
          IF month=7 THEN
             days_month:=181;
          END IF;
          IF month=8 THEN
            days_month:=212;
          END IF;
          IF month=9 THEN
             days_month:=243;
          END IF;
          IF month=10 THEN
             days_month:=273;
          END IF;
          IF month=11 THEN
             days_month:=304;
          END IF;
          IF month=12 THEN
            days_month:=334;
          END IF;
     
          wk_num:=FLOOR(((year-1978) *365 + days_month + day + leap)/7);
          INSERT INTO datadba.history VALUES 
             (var_pubid, max_value, temp_weight, max_lintwk, wk_num, 
              month,day,year);
          <<nextcase>>
          COMMIT;           
      END LOOP;  
      CLOSE id_cursor;
END;    
/
exit;

03_JOBS.SQL

delete from datadba.jobs where round=30;
delete from datadba.error_tab;
set serveroutput on format wrapped;
set echo off;
set tab off;
set linesize 4000;
DECLARE  -- variables declared used within the program.
      temp_number  NUMBER (4);
      max_value    INTEGER;
      var_pubid    INTEGER;
      month        NUMBER (2);
      day          NUMBER (2);
      year         NUMBER (4);
      leap         NUMBER (4);
      days_month   INTEGER;
      wk_num       NUMBER (6);
      wk_num_stop  NUMBER (6);
      month_stop   NUMBER (2);
      day_stop     NUMBER (2);
      year_stop    NUMBER (4);
      leap_stop    NUMBER (4);
      days_month_stop  INTEGER;
      var_weight    INTEGER;
      var_curintmo  NUMBER (2);
      var_curintda  NUMBER (2);
      var_curintyr  NUMBER (4);
      var_lintmo    NUMBER (2);
      var_lintday   NUMBER (2);
      var_lintyr    NUMBER (4);
      var_actmlnow  NUMBER (2);
      var_stajob1m  NUMBER (2); /* Nagi drops these 1/2001 */
      var_stajob1d  NUMBER (2); /* Nagi drops these 1/2001 */
      var_stajob1y  NUMBER (4); /* Nagi drops these 1/2001 */
      var_stajob2m  NUMBER (2); /* Nagi drops these 1/2001 */
      var_stajob2d  NUMBER (2); /* Nagi drops these 1/2001 */
      var_stajob2y  NUMBER (4); /* Nagi drops these 1/2001 */
      var_job_num_a NUMBER (4);
      var_tenure    NUMBER (4);
      var_cps       NUMBER (2);
      var_stawgp1m  NUMBER (2);
      var_stawgp1d  NUMBER (2);
      var_stawgp1y  NUMBER (4);
      var_stowgp1m  NUMBER (2);
      var_stowgp1d  NUMBER (2);
      var_stowgp1y  NUMBER (4);
      var_stawgp2m  NUMBER (2);
      var_stawgp2d  NUMBER (2);
      var_stawgp2y  NUMBER (4);
      var_stowgp2m  NUMBER (2); 
      var_stowgp2d  NUMBER (2); 
      var_stowgp2y  NUMBER (4);
      var_stawgp3m  NUMBER (2);
      var_stawgp3d  NUMBER (2); 
      var_stawgp3y  NUMBER (4);
      var_stowgp3m  NUMBER (2);
      var_stowgp3d  NUMBER (2);
      var_stowgp3y  NUMBER (4);
      var_stawgp4m  NUMBER (2);
      var_stawgp4d  NUMBER (2);
      var_stawgp4y  NUMBER (4);
      var_stowgp4m  NUMBER (2);
      var_stowgp4d  NUMBER (2);
      var_stowgp4y  NUMBER (4);
      var_start     NUMBER(5);
      var_stop      NUMBER(5);
      var_job#      NUMBER (4);
      var_period    NUMBER (1);
      var_number    NUMBER (4);
      var_past      NUMBER (3);
      past_tenure   INTEGER;
      temp_maxvalue NUMBER (3);
      var_stajobcm  NUMBER (2);
      var_stajobcd  NUMBER (2);
      var_stajobcy  NUMBER (4);
      var_stojobm   NUMBER (2);
      var_stojobd   NUMBER (2);
      var_stojoby   NUMBER (4);
      var_payrate1  NUMBER (10);
      var_payrate2  NUMBER (10);
      var_payrate3  NUMBER (10);
      var_payrate4  NUMBER (10);
      var_payrate5  NUMBER (10);
      var_payrate6  NUMBER (10);
      var_payrate7  NUMBER (10);
      var_payrate8  NUMBER (10);
      var_payrate9  NUMBER (10);
      var_payrate10 NUMBER (10);
      var_anywjgap  NUMBER (1); 
      var_roptu     NUMBER (3);
      var_hrsdayu   NUMBER (2);
      var_hrswku    NUMBER (4);
      hrly_wage     NUMBER (8);
      var_hrswk1    NUMBER (3);
      var_previd    NUMBER (2);
      var_preten    NUMBER (4);
      var_per1_start NUMBER (4);
      var_per1_stop  NUMBER (4);
      var_per1_reason  NUMBER (2);
      var_per1_all   NUMBER (3);
      var_per1_look  NUMBER (3);
      var_per2_start NUMBER (4);
      var_per2_stop  NUMBER (4);
      var_per2_reason  NUMBER (2);
      var_per2_all   NUMBER (3);
      var_per2_look  NUMBER (3);
      var_per3_start NUMBER (4);
      var_per3_stop  NUMBER (4);
      var_per3_reason  NUMBER (2);
      var_per3_all   NUMBER (3);
      var_per3_look  NUMBER (3);
      var_per4_start NUMBER (4);
      var_per4_stop  NUMBER (4);
      var_per4_reason  NUMBER (2);
      var_per4_all   NUMBER (3);
      var_per4_look  NUMBER (3); 
      var_curwkemp   NUMBER (3);
      var_yleftjob   NUMBER (3);
      var_hrswk      NUMBER (4);
      var_occ        NUMBER (4);
      var_ind        NUMBER (4);
      var_cow        NUMBER (4);
      var_unionjob   NUMBER (4);
      kount          INTEGER;
      err_num        NUMBER;
      err_msg        VARCHAR2(100);
      CURSOR id_cursor IS 
                    SELECT pubid,weight,curintmo,curintda,curintyr,
                           lintmo,lintday,lintyr,actmlnow
                    FROM datadba.newyear_data order by pubid;
      FUNCTION wk_number (month NUMBER, day NUMBER, year NUMBER)RETURN NUMBER IS
        wk_num     NUMBER(7,2);
        leap       NUMBER (7,3);
        days_month NUMBER (3);
        rday       NUMBER(3);
      BEGIN
        rday:=day;
        IF day<=0 THEN rday:=15; END IF;
        IF month =-1 OR year =-1 THEN
          RETURN -1;
        ELSIF month =-2 OR year =-2 THEN
          RETURN -2; 
        ELSIF month =-3 OR year =-3 THEN
          RETURN -3; 
        ELSIF month <=0 OR year <=0 THEN
          RETURN -4;
        ELSIF year > 1900 AND year < 1978 THEN 
          RETURN 0;
        END IF;  
        leap:=0;
        IF year <=99 THEN 
          DBMS_OUTPUT.PUT_LINE('HALT !!! DATE ^ Y2K !!!'); 
          RETURN (0);
        END IF;
        IF year>=1980 THEN
           leap:=CEIL((year-1980)/4);
        END IF;
        IF MOD(year,4)=0 AND month>2 THEN
           leap:=leap+1;
        END IF;
        IF month=1 THEN
          days_month:=0;
        END IF;
        IF month=2 THEN
            days_month:=31;
        END IF; 
        IF month=3 THEN
          days_month:=59;
        END IF;
        IF month=4 THEN
          days_month:=90;
        END IF;
        IF month=5 THEN
          days_month:=120;
        END IF;
        IF month=6 THEN
          days_month:=151;
        END IF;
        IF month=7 THEN
          days_month:=181;
        END IF;
        IF month=8 THEN
           days_month:=212;
        END IF;
        IF month=9 THEN
          days_month:=243;
        END IF;
        IF month=10 THEN
           days_month:=273;
        END IF;
        IF month=10 THEN
          days_month:=273;
        END IF;
        IF month=11 THEN
           days_month:=304;
        END IF;
        IF month=12 THEN
        days_month:=334;
         END IF;
        wk_num:=((year-1978) *365 + days_month + rday + leap)/7;
        RETURN(wk_num);
      END wk_number;
BEGIN
DBMS_OUTPUT.ENABLE(10000);
       SELECT MAX(round) INTO max_value FROM datadba.jobs;
        max_value:=max_value + 1;
           
     kount:=0;
     OPEN id_cursor;
      LOOP
        <<nextcase>>
        FETCH id_cursor INTO var_pubid,var_weight,
                        var_curintmo,var_curintda,var_curintyr,
                        var_lintmo,var_lintday,var_lintyr,var_actmlnow;
        EXIT WHEN id_cursor%NOTFOUND;   
/*         EXIT WHEN id_cursor%ROWCOUNT=20; */
        IF var_weight=0 THEN GOTO nextcase;  END IF;
/**************************EMPLOYER #1-10 ********************************/
         FOR f IN 1..10 LOOP
          SELECT curwkemp, stajobcm, stajobcd, stajobcy 
          INTO var_curwkemp, var_stajobcm, var_stajobcd, var_stajobcy
          FROM datadba.emp_supplement
          WHERE pubid=var_pubid AND employer=f;
          EXIT WHEN var_curwkemp=-4;
          IF var_stajobcm=-4 AND var_stajobcd=-4 AND var_stajobcy=-4 THEN
             var_job_num_a:=-4;
          END IF;
          IF var_stajobcm>=-3 AND var_stajobcd>=-3 AND var_stajobcy>=-3 AND 
                 var_actmlnow^=1 AND f=1
                 THEN  var_cps:=1;   /*CPS JOB ASSUMED TO BE IN ES1 IN CAPI*/
          ELSE var_cps:=0;
          END IF;
/*calculate the start week number of the job */ 
        IF CEIL(wk_number(var_stajobcm,var_stajobcd,var_stajobcy))<0 THEN
           var_start:=CEIL(wk_number(var_stajobcm,var_stajobcd,var_stajobcy));          
         ELSIF CEIL(wk_number(var_stajobcm,var_stajobcd,var_stajobcy))=
           FLOOR(wk_number(var_stajobcm,var_stajobcd,var_stajobcy)) THEN
           var_start:=CEIL(wk_number(var_stajobcm,var_stajobcd,var_stajobcy))+1;
         ELSE var_start:=CEIL(wk_number(var_stajobcm,var_stajobcd,var_stajobcy));
        END IF;
/* calculate stop week */
          SELECT stojobm, stojobd, stojoby INTO var_stojobm,var_stojobd,var_stojoby
          FROM datadba.emp_supplement
          WHERE pubid=var_pubid and employer=f;
          var_stop:=CEIL(wk_number(var_stojobm,var_stojobd,var_stojoby));
          IF var_stojobm=var_curintmo AND var_stojobd=var_curintda AND
             var_stojoby=var_curintyr THEN                  
             var_stop:=FLOOR(wk_number(var_stojobm,var_stojobd,var_stojoby));
          END IF;
/*compute hourly wage */
           SELECT roptu, hrsdayu, payrate, hrswk, hrswku 
             INTO var_roptu, var_hrsdayu, var_payrate1, var_hrswk1, var_hrswku
           FROM datadba.emp_supplement
           WHERE pubid=var_pubid and employer=f;
           IF var_payrate1>0 AND var_roptu>0 THEN 
             IF var_roptu=1 THEN hrly_wage:=var_payrate1;
               ELSIF(var_roptu=2 OR var_roptu=3 or var_roptu=7) AND var_hrswk1>0
                   THEN hrly_wage:=FLOOR(var_payrate1/var_hrswk1);
                 ELSIF var_roptu=4 AND var_hrswk1>0 
                     THEN hrly_wage:=FLOOR(var_payrate1/(var_hrswk1 * 2));
                   ELSIF var_roptu=5 AND var_hrswk1>0
                       THEN hrly_wage:=FLOOR(var_payrate1/(var_hrswk1 * 4.3));
                     ELSIF var_roptu=6 AND var_hrswk1>0
                         THEN hrly_wage:=FLOOR(var_payrate1/(var_hrswk1 * 52));
                       ELSIF var_roptu=8 AND var_hrswk1>0
                           THEN hrly_wage:=FLOOR(var_payrate1/(var_hrswk1 * 2.15));
                        ELSE hrly_wage:=-4;
             END IF;
           ELSE hrly_wage:=-4;
           END IF;
/* calculate periods not working*/
               SELECT anywjgap INTO var_anywjgap FROM datadba.emp_supplement
               WHERE pubid=var_pubid and employer=f;
               IF var_anywjgap=1 THEN 
                 SELECT stawgp1m, stawgp1d, stawgp1y, stowgp1m, stowgp1d, stowgp1y, 
                        stawgp2m, stawgp2d, stawgp2y, stowgp2m, stowgp2d, stowgp2y, 
                        stawgp3m, stawgp3d, stawgp3y, stowgp3m, stowgp3d, stowgp3y, 
                        stawgp4m, stawgp4d, stawgp4y, stowgp4m, stowgp4d, stowgp4y 
                 INTO var_stawgp1m, var_stawgp1d, var_stawgp1y, var_stowgp1m, var_stowgp1d, var_stowgp1y, 
                      var_stawgp2m, var_stawgp2d, var_stawgp2y, var_stowgp2m, var_stowgp2d, var_stowgp2y, 
                      var_stawgp3m, var_stawgp3d, var_stawgp3y, var_stowgp3m, var_stowgp3d, var_stowgp3y, 
                      var_stawgp4m, var_stawgp4d, var_stawgp4y, var_stowgp4m, var_stowgp4d, var_stowgp4y 
                 FROM datadba.emp_supplement
                 WHERE pubid=var_pubid and employer=f;      
                 
                     IF var_stawgp1m>0 AND var_stawgp1d>0  AND var_stawgp1y>0 THEN
                       IF CEIL(wk_number(var_stawgp1m,var_stawgp1d,var_stawgp1y))=
                          FLOOR(wk_number(var_stawgp1m,var_stawgp1d,var_stawgp1y)) 
                          THEN var_per1_start:=
                          CEIL(wk_number(var_stawgp1m,var_stawgp1d,var_stawgp1y))+1;
                       ELSE var_per1_start:=
                          CEIL(wk_number(var_stawgp1m,var_stawgp1d,var_stawgp1y));
                       END IF;
                       IF var_per1_start>0 THEN 
                         SELECT ynwkwg1c, wklkwg11, wklkwg12 INTO var_per1_reason, var_per1_all, var_per1_look                         
                         FROM datadba.emp_supplement
                         WHERE pubid=var_pubid AND employer=f;
                       ELSE var_per1_reason:=-4; var_per1_all:=-4; var_per1_look:=-4;
                       END IF;
                       var_per1_stop:=CEIL(wk_number(var_stowgp1m,var_stowgp1d,var_stowgp1y));
                       IF var_stowgp1m=var_curintmo AND 
                          var_stowgp1d=var_curintda AND
                          var_stowgp1y=var_curintyr THEN                  
                       var_per1_stop:=FLOOR(wk_number(var_stowgp1m,var_stowgp1d,var_stowgp1y)); 
                       END IF;
                     END IF;
                     
                     IF var_stawgp2m>0 AND var_stawgp2d>0  AND var_stawgp2y>0 THEN
                       IF CEIL(wk_number(var_stawgp2m,var_stawgp2d,var_stawgp2y))=
                          FLOOR(wk_number(var_stawgp2m,var_stawgp2d,var_stawgp2y)) 
                          THEN var_per2_start:=
                          CEIL(wk_number(var_stawgp2m,var_stawgp2d,var_stawgp2y))+1;
                       ELSE var_per2_start:=
                          CEIL(wk_number(var_stawgp2m,var_stawgp2d,var_stawgp2y));
                       END IF;
                       var_per2_stop:=CEIL(wk_number(var_stowgp2m,var_stowgp2d,var_stowgp2y));
                       IF var_stowgp2m=var_curintmo AND 
                          var_stowgp2d=var_curintda AND
                          var_stowgp2y=var_curintyr THEN                  
                       var_per2_stop:=FLOOR(wk_number(var_stowgp2m,var_stowgp2d,var_stowgp2y)); 
                       END IF;
                       SELECT ynwkwg2c, wklkwg21, wklkwg22 INTO var_per2_reason, var_per2_all, var_per2_look 
                       FROM datadba.emp_supplement
                       WHERE pubid=var_pubid AND employer=f;
                     ELSE var_per2_start:=-4;
                          var_per2_stop:=-4;
                          var_per2_reason:=-4;
                          var_per2_all:=-4;
                          var_per2_look:=-4;
                     END IF;                  
                     IF var_stawgp3m>0 AND var_stawgp3d>0  AND var_stawgp3y>0 THEN
                       IF CEIL(wk_number(var_stawgp3m,var_stawgp3d,var_stawgp3y))=
                          FLOOR(wk_number(var_stawgp3m,var_stawgp3d,var_stawgp3y)) 
                          THEN var_per3_start:=
                          CEIL(wk_number(var_stawgp3m,var_stawgp3d,var_stawgp3y))+1;
                       ELSE var_per3_start:=
                          CEIL(wk_number(var_stawgp3m,var_stawgp3d,var_stawgp3y));
                       END IF;
                      var_per3_stop:=
                       CEIL(wk_number(var_stowgp3m,var_stowgp3d,var_stowgp3y));
                       IF var_stowgp3m=var_curintmo AND 
                          var_stowgp3d=var_curintda AND
                          var_stowgp3y=var_curintyr THEN                  
                       var_per3_stop:=FLOOR(wk_number(var_stowgp3m,var_stowgp3d,var_stowgp3y)); 
                       END IF;
                       SELECT ynwkwg3c, wklkwg31, wklkwg32 INTO var_per3_reason, var_per3_all, var_per3_look 
                       FROM datadba.emp_supplement
                       WHERE pubid=var_pubid AND employer=f;
                     ELSE var_per3_start:=-4;
                          var_per3_stop:=-4;
                          var_per3_reason:=-4;
                          var_per3_all:=-4;
                          var_per3_look:=-4;
                     END IF;
                     IF var_stawgp4m>0 AND var_stawgp4d>0  AND var_stawgp4y>0 THEN
                       IF CEIL(wk_number(var_stawgp4m,var_stawgp4d,var_stawgp4y))=
                          FLOOR(wk_number(var_stawgp4m,var_stawgp4d,var_stawgp4y)) 
                          THEN var_per4_start:=
                          CEIL(wk_number(var_stawgp4m,var_stawgp4d,var_stawgp4y))+1;
                       ELSE var_per4_start:=
                          CEIL(wk_number(var_stawgp4m,var_stawgp4d,var_stawgp4y));
                       END IF;
                      var_per4_stop:=CEIL(wk_number(var_stowgp4m,var_stowgp4d,var_stowgp4y));
                       IF var_stowgp4m=var_curintmo AND 
                          var_stowgp4d=var_curintda AND
                          var_stowgp4y=var_curintyr THEN                  
                       var_per4_stop:=FLOOR(wk_number(var_stowgp4m,var_stowgp4d,var_stowgp4y)); 
                       END IF;
                       SELECT ynwkwg4c, wklkwg41, wklkwg42  INTO var_per4_reason, var_per4_all, var_per4_look 
                       FROM datadba.emp_supplement
                       WHERE pubid=var_pubid AND employer=f;
                     ELSE var_per4_start:=-4;
                          var_per4_stop:=-4;
                          var_per4_reason:=-4;
                          var_per4_all:=-4;
                          var_per4_look:=-4;
                     END IF;
               ELSE var_per1_start:=-4; var_per1_stop:=-4; var_per1_reason:=-4; var_per1_all:=-4; var_per1_look:=-4; 
                    var_per2_start:=-4; var_per2_stop:=-4; var_per2_reason:=-4; var_per2_all:=-4; var_per2_look:=-4; 
                    var_per3_start:=-4; var_per3_stop:=-4; var_per3_reason:=-4; var_per3_all:=-4; var_per3_look:=-4; 
                    var_per4_start:=-4; var_per4_stop:=-4; var_per4_reason:=-4; var_per4_all:=-4; var_per4_look:=-4; 
               END IF;
/* calculate TENURE*/   
               IF var_start>=0 AND var_stop>=var_start THEN
                          var_tenure:=var_stop - var_start+1;
               ELSE var_tenure:=-3;
               END IF;
               IF var_tenure>0 THEN
               SELECT previd INTO var_previd FROM datadba.emp_supplement
                      WHERE pubid=var_pubid AND employer=f;
               IF var_previd=0 THEN var_previd:=-4; END IF;
               BEGIN     
                   IF var_previd>0 THEN 
                      SELECT MAX(round) INTO temp_maxvalue
                             FROM datadba.jobs WHERE public_id=var_pubid AND
                             round ^= max_value;
                      SELECT tenure INTO past_tenure FROM datadba.jobs
                             WHERE public_id=var_pubid and 
                             round=temp_maxvalue and job#=var_previd;
                      IF past_tenure>0 THEN 
                             var_tenure:=var_tenure + past_tenure;
                      ELSE var_tenure:=-3;
                      END IF;
                   END IF;
              EXCEPTION
                WHEN NO_DATA_FOUND THEN var_tenure:=-3;
               END;
               SELECT mnsb4dli INTO var_preten FROM datadba.emp_supplement
                      WHERE pubid=var_pubid AND employer=f;
                IF var_preten>-4 THEN 
                   IF var_preten>=0 THEN
                      IF var_tenure >=0 and var_preten>=0  THEN
                         var_tenure:=FLOOR(var_tenure + 4.3 * var_preten);
                      END IF;
                   ELSE var_preten:=-3;
                   END IF;
                END IF;
               END IF;
               IF var_tenure<0 THEN var_tenure:=-3; END IF;
               var_job_num_a:=max_value * 100 + f;
             SELECT jobstwhn, curwkemp, yleftjob, hrswk, occ, ind, cow, unionjob INTO  var_past, var_curwkemp, var_yleftjob, 
                          var_hrswk, var_occ, var_ind, var_cow, var_unionjob
             FROM datadba.emp_supplement
             WHERE pubid=var_pubid and employer=f;
             kount:=kount+1;
             /*IF max_value ^= 17 THEN 
             DBMS_OUTPUT.PUT_LINE('NON R17 rows being inserted!!!'); END IF;*/
             INSERT INTO datadba.jobs 
             VALUES (var_pubid, max_value, f, var_start, var_stajobcm, var_stajobcd, var_stajobcy, var_stop, var_stojobm, 
                  var_stojobd, var_stojoby, var_past, var_curwkemp, var_yleftjob, var_cps, var_hrswk, var_occ, var_ind, var_cow,
                  var_hrsdayu, var_payrate1, var_roptu, hrly_wage, var_unionjob, -4, var_anywjgap, var_per1_start, var_per1_stop, 
                  var_per1_reason, var_per1_all, var_per1_look, var_per2_start, var_per2_stop, var_per2_reason, var_per2_all, 
                  var_per2_look, var_per3_start, var_per3_stop, var_per3_reason, var_per3_all, var_per3_look, var_per4_start, 
                  var_per4_stop, var_per4_reason, var_per4_all, var_per4_look, var_previd, var_preten, var_tenure, var_job_num_a);
       END LOOP;
       COMMIT;
      END LOOP;
      CLOSE id_cursor;
      DBMS_OUTPUT.PUT_LINE('KOUNT='|| TO_CHAR(kount));
--EXCEPTION
--    WHEN NO_DATA_FOUND THEN
--       DBMS_OUTPUT.PUT_LINE('HALT!!! AT CASE-NO ROW ' || TO_CHAR(var_pubid));
--    WHEN OTHERS THEN
--        err_num:= sqlcode;
--        err_msg:= SUBSTR(SQLERRM,1,100);
--        DBMS_OUTPUT.PUT_LINE('FAILED CASE ' || TO_CHAR(var_pubid) || ' ' ||
--                                                TO_CHAR(max_value) || ' ' ||
--                                                TO_CHAR(var_job_num_a));
--        DBMS_OUTPUT.PUT_LINE('SQL ERROR# ' || TO_CHAR(err_num) || 
--                                       ' ' || err_msg);   
INSERT INTO datadba.error_tab VALUES
(var_pubid,NULL,NULL,var_start, var_stajobcm, var_stajobcd, var_stajobcy, var_stop, var_stojobm, 
var_stojobd, var_stojoby, var_past, var_curwkemp, var_yleftjob, var_cps, var_hrswk, var_occ, var_ind, var_cow,
var_hrsdayu, var_payrate1, var_roptu, hrly_wage, var_unionjob, -4, var_anywjgap, var_per1_start, var_per1_stop, 
var_per1_reason, var_per1_all, var_per1_look, var_per2_start, var_per2_stop, var_per2_reason, var_per2_all, 
var_per2_look, var_per3_start, var_per3_stop, var_per3_reason, var_per3_all, var_per3_look, var_per4_start, 
var_per4_stop, var_per4_reason, var_per4_all, var_per4_look, var_previd, var_preten, var_tenure, var_job_num_a);
END;
/

04_BETWEEN_JOBS.SQL

delete from datadba.betweenjobs where round=30;
set echo off;
set serveroutput on;
DECLARE
      max_value    INTEGER;
      var_pubid    INTEGER;
      temp_stabgam NUMBER(2);
      temp_stabgad NUMBER(2);
      temp_stabgay NUMBER(4);
      temp_stobgam NUMBER(2);
      temp_stobgad NUMBER(2);
      temp_stobgay NUMBER(4);
      temp_wkslkb1 NUMBER(2);
      temp_wkslkb2 NUMBER(3);
      temp_ynolkbg NUMBER(2);
      bstart_var   NUMBER(5);
      bstop_var    NUMBER(5);
      temp_wt      NUMBER(8);
      var_curintmo NUMBER(2);
      var_curintda NUMBER(2);
      var_curintyr NUMBER(4);
      var_lintmo   NUMBER(2);
      var_lintday  NUMBER(2);
      var_lintyr   NUMBER(4);
      CURSOR id_cursor IS
                       SELECT pubid,weight,curintmo,curintda,curintyr,
                              lintmo,lintday,lintyr
                       FROM datadba.newyear_data order by pubid;
      FUNCTION wk_number 
        (month  NUMBER, day NUMBER, year NUMBER)RETURN NUMBER IS
        wk_num  NUMBER(7,2);
        leap    NUMBER(7,3);
        days_month NUMBER(3);
        rday       NUMBER(3);
      BEGIN
        rday:=day;
        IF day<=0 THEN rday:=15; END IF;
        IF month =-1 OR year =-1 THEN
          RETURN -1;
        ELSIF month =-2 OR year =-2 THEN
          RETURN -2; 
        ELSIF month =-3 OR year =-3 THEN
          RETURN -3; 
        ELSIF month <=0 OR year <=0 THEN
          RETURN -4;
        END IF;  
        leap:=0;
        IF year <= 99 THEN 
           DBMS_OUTPUT.PUT_LINE('HALT!!! DATE^Y2K !!!');
        END IF;
        IF year>=1980 THEN
           leap:=CEIL((year-1980)/4);
        END IF;
        IF MOD(year,4)=0 AND month>2 THEN
           leap:=leap+1;
        END IF;
        IF month=1 THEN
          days_month:=0;
        END IF;
        IF month=2 THEN
            days_month:=31;
        END IF; 
        IF month=3 THEN
          days_month:=59;
        END IF;
        IF month=4 THEN
          days_month:=90;
        END IF;
        IF month=5 THEN
          days_month:=120;
        END IF;
        IF month=6 THEN
          days_month:=151;
        END IF;
        IF month=7 THEN
          days_month:=181;
        END IF;
        IF month=8 THEN
           days_month:=212;
        END IF;
        IF month=9 THEN
          days_month:=243;
        END IF;
        IF month=10 THEN
           days_month:=273;
        END IF;
        IF month=10 THEN
          days_month:=273;
        END IF;
        IF month=11 THEN
           days_month:=304;
        END IF;
        IF month=12 THEN
        days_month:=334;
         END IF;
        wk_num:=((year-1978) *365 + days_month + rday + leap)/7;
        RETURN(wk_num);
      END wk_number;
BEGIN
DBMS_OUTPUT.ENABLE(10000);
      SELECT MAX(round) INTO max_value
      FROM datadba.history;
      OPEN id_cursor;
      LOOP
          FETCH id_cursor INTO var_pubid,temp_wt,
                               var_curintmo,var_curintda,var_curintyr,
                               var_lintmo,var_lintday,var_lintyr;
          EXIT WHEN id_cursor%NOTFOUND;   
   /*     EXIT WHEN id_cursor%ROWCOUNT > 20;  */
          IF temp_wt > 0 THEN
           SELECT stabga1m,stabga1d,stabga1y,
                  stobga1m,stobga1d,stobga1y,
                  wkslkb11,wkslkb12,ynolkb1g INTO
                  temp_stabgam,temp_stabgad,temp_stabgay,
                  temp_stobgam,temp_stobgad,temp_stobgay,
                  temp_wkslkb1,temp_wkslkb2,temp_ynolkbg
           FROM datadba.gaps WHERE pubid=var_pubid;
           IF temp_stabgam >= -3 THEN
           IF CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))=
              FLOOR(wk_number(temp_stabgam,temp_stabgad,temp_stabgay)) THEN
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))+1;
           ELSE
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay));
           END IF;
           bstop_var:=
            CEIL(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); 
           IF temp_stobgam=var_curintmo AND
              temp_stobgad=var_curintda AND
              temp_stobgay=var_curintyr THEN
           bstop_var:=
             FLOOR(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); END IF; 
         
           IF bstart_var >= -3 THEN
            INSERT INTO datadba.betweenjobs
            VALUES (var_pubid,max_value,1,bstart_var,bstop_var,
                   temp_wkslkb1,temp_wkslkb2,temp_ynolkbg); 
           END IF; 
             ELSE GOTO nomore;
           END IF;
           SELECT stabga2m,stabga2d,stabga2y,
                  stobga2m,stobga2d,stobga2y,
                  wkslkb21,wkslkb22,ynolkb2g INTO
                  temp_stabgam,temp_stabgad,temp_stabgay,
                  temp_stobgam,temp_stobgad,temp_stobgay,
                  temp_wkslkb1,temp_wkslkb2,temp_ynolkbg
           FROM datadba.gaps WHERE pubid=var_pubid;
           IF temp_stabgam >= -3 THEN
           IF CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))=
              FLOOR(wk_number(temp_stabgam,temp_stabgad,temp_stabgay)) THEN
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))+1;
           ELSE
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay));
           END IF;
           bstop_var:=
            CEIL(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); 
           IF temp_stobgam=var_curintmo AND
              temp_stobgad=var_curintda AND
              temp_stobgay=var_curintyr THEN
           bstop_var:=
             FLOOR(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); END IF;
           IF bstart_var >= -3 THEN
            INSERT INTO datadba.betweenjobs
            VALUES (var_pubid,max_value,2,bstart_var,bstop_var,
                   temp_wkslkb1,temp_wkslkb2,temp_ynolkbg); 
           END IF; 
             ELSE GOTO nomore;
           END IF;
           SELECT stabga3m,stabga3d,stabga3y,
                  stobga3m,stobga3d,stobga3y,
                  wkslkb31,wkslkb32,ynolkb3g INTO
                  temp_stabgam,temp_stabgad,temp_stabgay,
                  temp_stobgam,temp_stobgad,temp_stobgay,
                  temp_wkslkb1,temp_wkslkb2,temp_ynolkbg
           FROM datadba.gaps WHERE pubid=var_pubid;
           IF temp_stabgam >= -3 THEN
           IF CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))=
              FLOOR(wk_number(temp_stabgam,temp_stabgad,temp_stabgay)) THEN
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))+1;
           ELSE
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay));
           END IF;
           bstop_var:=
            CEIL(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); 
           IF temp_stobgam=var_curintmo AND
              temp_stobgad=var_curintda AND
              temp_stobgay=var_curintyr THEN
           bstop_var:=
             FLOOR(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); END IF; 
 
           IF bstart_var >= -3 THEN
            INSERT INTO datadba.betweenjobs
            VALUES (var_pubid,max_value,3,bstart_var,bstop_var,
                   temp_wkslkb1,temp_wkslkb2,temp_ynolkbg); 
           END IF; 
             ELSE GOTO nomore;
           END IF;
           SELECT stabga4m,stabga4d,stabga4y,
                  stobga4m,stobga4d,stobga4y,
                  wkslkb41,wkslkb42,ynolkb4g INTO
                  temp_stabgam,temp_stabgad,temp_stabgay,
                  temp_stobgam,temp_stobgad,temp_stobgay,
                  temp_wkslkb1,temp_wkslkb2,temp_ynolkbg
           FROM datadba.gaps WHERE pubid=var_pubid;
           IF temp_stabgam >= -3 THEN
           IF CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))=
              FLOOR(wk_number(temp_stabgam,temp_stabgad,temp_stabgay)) THEN
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay))+1;
           ELSE
              bstart_var:=
                CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay));
           END IF;
           bstop_var:=
            CEIL(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); 
           IF temp_stobgam=var_curintmo AND
              temp_stobgad=var_curintda AND
              temp_stobgay=var_curintyr THEN
           bstop_var:=
             FLOOR(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); END IF; 
           IF bstart_var >= -3 THEN
            INSERT INTO datadba.betweenjobs
            VALUES (var_pubid,max_value,4,bstart_var,bstop_var,
                   temp_wkslkb1,temp_wkslkb2,temp_ynolkbg); 
           END IF; 
             ELSE GOTO nomore;
           END IF;
           SELECT stabga5m,stabga5d,stabga5y,
                  stobga5m,stobga5d,stobga5y,
                  wkslkb51,wkslkb52,ynolkb5g INTO
                  temp_stabgam,temp_stabgad,temp_stabgay,
                  temp_stobgam,temp_stobgad,temp_stobgay,
                  temp_wkslkb1,temp_wkslkb2,temp_ynolkbg
           FROM datadba.gaps WHERE pubid=var_pubid;
           IF temp_stabgam >= -3 THEN
           bstart_var:=
            CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay));
           IF temp_stabgam=var_lintmo AND
              temp_stabgad=var_lintday AND
              temp_stabgay=var_lintyr THEN 
           bstart_var:=bstart_var+1; END IF;
           bstop_var:=
            CEIL(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); 
           IF temp_stobgam=var_curintmo AND
              temp_stobgad=var_curintda AND
              temp_stobgay=var_curintyr THEN
           bstop_var:=
             FLOOR(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); END IF;
           IF bstart_var >= -3 THEN
            INSERT INTO datadba.betweenjobs
            VALUES (var_pubid,max_value,5,bstart_var,bstop_var,
                   temp_wkslkb1,temp_wkslkb2,temp_ynolkbg); 
           END IF; 
             ELSE GOTO nomore;
           END IF;
 
           SELECT stabga6m,stabga6d,stabga6y,
                  stobga6m,stobga6d,stobga6y,
                  wkslkb61,wkslkb62,ynolkb6g INTO
                  temp_stabgam,temp_stabgad,temp_stabgay,
                  temp_stobgam,temp_stobgad,temp_stobgay,
                  temp_wkslkb1,temp_wkslkb2,temp_ynolkbg
           FROM datadba.gaps WHERE pubid=var_pubid;
           IF temp_stabgam >= -3 THEN
           bstart_var:=
            CEIL(wk_number(temp_stabgam,temp_stabgad,temp_stabgay));
           IF temp_stabgam=var_lintmo AND
              temp_stabgad=var_lintday AND
              temp_stabgay=var_lintyr THEN 
           bstart_var:=bstart_var+1; END IF;
           bstop_var:=
            CEIL(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); 
           IF temp_stobgam=var_curintmo AND
              temp_stobgad=var_curintda AND
              temp_stobgay=var_curintyr THEN
           bstop_var:=
             FLOOR(wk_number(temp_stobgam,temp_stobgad,temp_stobgay)); END IF;
           IF bstart_var >= -3 THEN
            INSERT INTO datadba.betweenjobs
            VALUES (var_pubid,max_value,6,bstart_var,bstop_var,
                   temp_wkslkb1,temp_wkslkb2,temp_ynolkbg); 
           END IF; 
             ELSE GOTO nomore;
           END IF;    
           <<nomore>>
           COMMIT;
          END IF; 
      END LOOP;
      CLOSE id_cursor;
EXCEPTION
      WHEN OTHERS THEN
      ROLLBACK;       
END;    
/

05_MILITARY.SQL

set serveroutput on;
delete from datadba.military where round=30;
DECLARE
      max_value    INTEGER;
      max_week     INTEGER;
      var_pubid    INTEGER;
      temp_wt      NUMBER(8);
      t_current    NUMBER(4);
      t_last       NUMBER(4);
      t_status     NUMBER(4);
      start1       NUMBER(4);
      start2       NUMBER(4);
      stop1        NUMBER(4);
      stop2        NUMBER(4);
      wksl         NUMBER(4);
      t_miloutli     number (2);
      t_milinli      number (2);
      t_amilcrli     number (2);
      t_miloutm1     number (2);
      t_miloutd1     number (2);
      t_milouty1     number (4);
      t_milsinli     number (2);
      t_mlsinli2     number (2);
      t_mlsinli3     number (2);
      t_mlsinli4     number (2);
      t_mlsinli5     number (2);
      t_crmlsnli     number (2);
      t_amilsnli     number (2);
      t_milinm1      number (2);
      t_milind1      number (2);
      t_miliny1      number (4);
      t_srvactml     number (2);
      t_q4_12a       number (2);
      t_milinm2      number (2);
      t_milind2      number (2);
      t_miliny2      number (4);
      t_milinm3      number (2);
      t_milind3      number (2);
      t_miliny3      number (4);
      t_milinmc      number (2);
      t_milindc      number (2);
      t_milinyc      number (4);
      t_miloutm2     number (2);
      t_miloutd2     number (2);
      t_milouty2     number (4);
      t_miloutm3     number (2);
      t_miloutd3     number (2);
      t_milouty3     number (4);
      t_miloutmc     number (2);
      t_miloutdc     number (2);
      t_miloutyc     number (4);
      t_actmlnow     number (2);
      t_omilcode     number (2);
      CURSOR id_cursor IS
                       SELECT pubid FROM datadba.newyear_data order by pubid;
      FUNCTION wk_number
        (month NUMBER, day NUMBER, year NUMBER)RETURN NUMBER IS
        wk_num NUMBER(7,2);
        leap  NUMBER (7,3);
        days_month NUMBER (3);
      BEGIN
        IF month =-1 OR day =-1 OR year =-1 THEN
          RETURN -1;
        ELSIF month =-2 OR day =-2 OR year =-2 THEN
          RETURN -2;
        ELSIF month =-3 OR day =-3 OR year =-3 THEN
          RETURN -3;
        ELSIF month <=0 OR day <=0 OR year <=0 THEN
          RETURN -4;
        END IF;
        leap:=0;
        IF year <= 99 THEN
           DBMS_OUTPUT.PUT_LINE('HALT!!! DATE^Y2K !!!');
        END IF;
        IF year>=1980 THEN
           leap:=CEIL((year-1980)/4);
        END IF;
        IF MOD(year,4)=0 AND month>2 THEN
           leap:=leap+1;
        END IF;
        IF month=1 THEN
          days_month:=0;
        END IF;
        IF month=2 THEN
            days_month:=31;
        END IF;
        IF month=3 THEN
          days_month:=59;
        END IF;
        IF month=4 THEN
          days_month:=90;
        END IF;
        IF month=5 THEN
          days_month:=120;
        END IF;
        IF month=6 THEN
          days_month:=151;
        END IF;
        IF month=7 THEN
          days_month:=181;
        END IF;
        IF month=8 THEN
           days_month:=212;
        END IF;
        IF month=9 THEN
          days_month:=243;
        END IF;
        IF month=10 THEN
           days_month:=273;
        END IF;
        IF month=10 THEN
          days_month:=273;
        END IF;
        IF month=11 THEN
           days_month:=304;
        END IF;
        IF month=12 THEN
        days_month:=334;
         END IF;
          IF MONTH > 12 THEN
          DBMS_OUTPUT.PUT_LINE (TO_CHAR(VAR_PUBID) || '  ERROR, BAD MONTH VALUE: ' || TO_CHAR(MONTH));
          END IF;
        wk_num:=CEIL(((year-1978) *365 + days_month + day + leap)/7);
        RETURN(wk_num);
      END wk_number;
BEGIN
   SELECT MAX(round) INTO max_value FROM datadba.history;
   SELECT MAX(wk_num) INTO max_week FROM datadba.weeks;
   OPEN id_cursor;
   LOOP
       <<nextcase>>
       FETCH id_cursor INTO var_pubid;
       EXIT WHEN id_cursor%NOTFOUND;
   /*           EXIT WHEN id_cursor%ROWCOUNT> 500;  */
       SELECT weight,
              miloutli,
              milinli ,
              amilcrli,
              miloutm1, miloutd1, milouty1,
              milsinli,
              mlsinli2,
              mlsinli3,
              mlsinli4,
              mlsinli5,
              crmlsnli,
              amilsnli,
              milinm1, milind1, miliny1,
              srvactml,
              q4_12a,
              milinm2, milind2, miliny2,
              milinm3, milind3, miliny3,
              milinmc, milindc, milinyc,
              miloutm2, miloutd2, milouty2,
              miloutm3, miloutd3, milouty3,
              miloutmc, miloutdc, miloutyc,
              actmlnow,
              milstdli
               INTO
              temp_wt,
              t_miloutli,
              t_milinli ,
              t_amilcrli,
              t_miloutm1, t_miloutd1, t_milouty1,
              t_milsinli,
              t_mlsinli2,
              t_mlsinli3,
              t_mlsinli4,
              t_mlsinli5,
              t_crmlsnli,
              t_amilsnli,
              t_milinm1, t_milind1, t_miliny1,
              t_srvactml,
              t_q4_12a,
              t_milinm2, t_milind2, t_miliny2,
              t_milinm3, t_milind3, t_miliny3,
              t_milinmc, t_milindc, t_milinyc,
              t_miloutm2, t_miloutd2, t_milouty2,
              t_miloutm3, t_miloutd3, t_milouty3,
              t_miloutmc, t_miloutdc, t_miloutyc,
              t_actmlnow,
              t_omilcode
           FROM datadba.newyear_data WHERE pubid=var_pubid;
           IF temp_wt = 0 THEN GOTO nextcase; END IF;
           IF t_amilcrli ^=1 and t_amilsnli ^=1 and
              t_miloutm1 <=-4 THEN GOTO nextcase; END IF;
           SELECT lastint_wk#,currint_wk# INTO
               t_last,t_current
               FROM datadba.history WHERE public_id=var_pubid and round=max_value;
       start1 :=-4; start2 :=-4; stop1 :=-4;  stop2 :=-4; wksl :=-4;
-- Description: If r was serving in active military branch at dli then set start1 to dli
       IF (t_omilcode = 1 or t_omilcode = 2 or t_omilcode = 3 or t_omilcode = 4) THEN
           start1 :=t_last;
       END IF;
-- Description: If r was serving in active military branch at dli and is currently serving in the same branch, then set stop1 to intdate
       IF ((t_omilcode = 1 or t_omilcode = 2 or t_omilcode = 3 or t_omilcode = 4) and t_amilcrli = 1) THEN
           stop1 :=t_current;
-- Description: Else if r was serving in active military branch at dli and is not currently serving in that branch, and the exit date for active military service is present, then set stop1 to that exit date
-- Correction - changed t_amilcrli = 0 to t_amilcrli = -4
       ELSIF ((t_omilcode = 1 or t_omilcode = 2 or t_omilcode = 3 or t_omilcode = 4) and t_amilcrli = -4 and t_miloutm1 > -4) THEN
           stop1 := wk_number(t_miloutm1,t_miloutd1,t_milouty1);
       END IF;
--Description: If r enlisted in active armed forces since dli then …
       IF ((t_milsinli =1 or  t_milsinli =3) and (t_mlsinli2 =1 or (t_mlsinli2 =4 and (t_mlsinli3 =1 or t_mlsinli3 =4)))) or
          ((t_milsinli =2 or  t_milsinli =4) and (t_mlsinli4 =1 or (t_mlsinli4 =4 and (t_mlsinli5 =1 or t_mlsinli5 =4))))  THEN
--Description: …If R is currently serving in the active branch enlisted in since dli and there is no start1, then set start1 to the date entered active service branch since dli and stop1 to intdate
--Correction: this is where start1 should be set for pubid 4293.  It's not working, but I can't figure out why.  All the data appears to be there.
           IF  (t_crmlsnli =1 and start1=-4 and t_milinm1 > -4) THEN
               start1 := wk_number(t_milinm1,t_milind1,t_miliny1);
               stop1 := t_current;
--Description: …Else if R is currently serving in the active branch enlisted in since dli and start1 is already set, then set start2 to the date entered active service branch since dli and stop2 to intdate
           ELSIF (t_crmlsnli =1 and start1 > -4 and t_milinm1 > -4) THEN
               start2 := wk_number(t_milinm1,t_milind1,t_miliny1);
               stop2 := t_current;
--Description: …Else if R is not currently serving in the active branch enlisted in since dli, but r did serve on active duty and there is no start1, then set start1 to the date entered active duty branch since dli and stop1 to exit date from active duty branch enlisted in since dli
           ELSIF  (t_crmlsnli =0 and t_srvactml = 1 and start1=-4 and t_milinm2 > -4) THEN
               start1 := wk_number(t_milinm2,t_milind2,t_miliny2);
               stop1 := wk_number(t_miloutm2,t_miloutd2,t_milouty2);
--Description:…Else if R is not currently serving in the active branch enlisted in since dli, but r did serve on active duty and start1 is already set, then set start2 to the date entered active duty branch since dli and stop2 to exit date from active duty branch enlisted in since dli
           ELSIF  (t_crmlsnli =0 and t_srvactml = 1 and start1 > -4 and t_milinm2 > -4) THEN
               start2 := wk_number(t_milinm2,t_milind2,t_miliny2);
                stop2 := wk_number(t_miloutm2,t_miloutd2,t_milouty2);
           END IF;
        END IF;
       IF start1 >=0 and stop1 >=start1 THEN
           FOR f IN start1..stop1 LOOP
               UPDATE datadba.weeks SET status=7, hrs_worked=0  WHERE public_id=var_pubid and wk_num=f;
           END LOOP;
        END IF;
       IF start2 >=0 and stop2 >=start2 THEN
           FOR f IN start2..stop2 LOOP
               UPDATE datadba.weeks SET status=7, hrs_worked=0  WHERE public_id=var_pubid and wk_num=f;
           END LOOP;
        END IF;
       IF start1 >-4 or start2 >-4 or stop1  >-4 or stop2  >-4 THEN
           IF (start1 =-3 or start2 =-3 or stop1  =-3 or stop2  =-3) or start1 > stop1 or start2 > stop2  THEN
               wksl :=-3;
           ELSE
               IF start1 >=0 THEN wksl :=stop1-start1 + 1; END IF;
               IF start2 >=0 THEN wksl :=wksl +stop2 - start2 + 1; END IF;
               wksl :=FLOOR(wksl+.5);
           END IF;
       END IF;
      /* WKSC-Military wks in last cal yr is created in SUMMATION.SQL */
       IF start1 >=-3 or start2 >=-3 or stop1 >=-3 or stop2 >=-3 or wksl > 0 THEN
           INSERT INTO datadba.military VALUES (var_pubid,max_value,start1,start2,stop1,stop2,wksl,NULL);
       END IF;
       COMMIT WORK;
   END LOOP;
   CLOSE id_cursor;
END;
/
exit;

06_FILL.SQL

set serveroutput on ;
--********************************************************************************************************************
-- Change below constant number after '=' sign to current round
delete from datadba.dualjobs where floor(job/100)=30;
--********************************************************************************************************************
DECLARE
 CURSOR id_cursor IS SELECT pubid, weight FROM datadba.newyear_data ORDER BY pubid;
 var_pubid      INTEGER;
 var_weight     NUMBER(10);
 var_round      INTEGER;
 pr             INTEGER;
 filler         NUMBER(4);
 temp_prev_emp# INTEGER;
 w              NUMBER(6);
 var_startwk    NUMBER(4);
 var_stopwk     NUMBER(4);
 var_jobnum     NUMBER(4);
 var_hours      NUMBER(4);
 var_wks_not_wk NUMBER(4);
 debug_status   NUMBER(4);
 debug_hours    NUMBER(4);
 type number_array is table of number index by binary_integer;
 
 var_per_start  number_array;
 var_per_stop   number_array;
 var_per_reason number_array;
 var_per_all    number_array;
 var_per_look   number_array;
 var_gap_index  NUMBER(2);
 var_#weeks     NUMBER(4);
 temp_hours     NUMBER(4);
 max_dual       INTEGER;
 max_job#       INTEGER;
 max_per#       INTEGER;
 max_value      INTEGER;
 stat_code      INTEGER;
 temp_stat_code INTEGER;
 db_status      INTEGER;
 db_hours       INTEGER;
 dj             INTEGER;
 emp            INTEGER;
 var_bstart     NUMBER(4);
 var_bstop      NUMBER(4);
 var_ball       NUMBER(4);
 var_blook      NUMBER(4);
 var_breason    NUMBER(4);
 
BEGIN
 SELECT MAX(round) INTO max_value FROM datadba.jobs;
 OPEN id_cursor;
 <<respl>>
 LOOP
 <<nfetch>>
  FETCH id_cursor INTO var_pubid,var_weight;
    EXIT WHEN id_cursor%NOTFOUND;
  IF var_weight=0 THEN 
      GOTO nfetch; 
  END IF;
  FOR r IN REVERSE 1..(max_value-1) LOOP
    SELECT weight,round INTO var_weight,var_round FROM datadba.history
           WHERE public_id=var_pubid AND round=r;
    EXIT WHEN var_weight>0;
  END LOOP;
  BEGIN
    SELECT MAX(job#) INTO max_job# FROM datadba.jobs
       WHERE public_id=var_pubid AND round=max_value;
  EXCEPTION
    WHEN NO_DATA_FOUND THEN max_job#:=0;
  END;
  max_job#:=NVL(max_job#,0);
  /* Section for respondents with jobs */
  <<jobl>>
  FOR f IN 1..max_job# LOOP
   SELECT start_wk#,stop_wk#,job_num_a,hoursweek,wks_not_wk,
          per1_start, per2_start, per3_start,  per4_start,
          per1_stop,  per2_stop,  per3_stop,   per4_stop,
          per1_reason,per2_reason,per3_reason, per4_reason,
          per1_all,   per2_all,   per3_all,    per4_all,
          per1_look,  per2_look,  per3_look,   per4_look,
          prev_emp#
          INTO
          var_startwk,var_stopwk,var_jobnum,var_hours,var_wks_not_wk,
          var_per_start (1), var_per_start (2), var_per_start (3), var_per_start (4),
          var_per_stop (1), var_per_stop (2), var_per_stop (3), var_per_stop (4),
          var_per_reason (1), var_per_reason (2), var_per_reason (3), var_per_reason (4),
          var_per_all (1), var_per_all (2), var_per_all (3), var_per_all (4),
          var_per_look (1), var_per_look (2), var_per_look (3), var_per_look (4),
          temp_prev_emp#
          FROM datadba.jobs 
          WHERE public_id=var_pubid AND round=max_value AND job#=f; 
   
   IF var_startwk<0 OR var_stopwk< 0 THEN 
       GOTO nextjob; 
   END IF;
   IF var_hours < 0 THEN 
       var_hours:=-3;   
   END IF;
   IF var_hours >168 THEN 
       var_hours:=168; 
   END IF;
   <<weekl>>
   FOR w IN var_startwk..var_stopwk LOOP
      IF ((var_per_start (1) > 0) and (var_per_stop (1) > 0) and (w >= var_per_start (1)) and (w <= var_per_stop (1))) THEN
          var_gap_index := 1;
      ELSIF ((var_per_start (2) > 0) and (var_per_stop (2) > 0) and (w >= var_per_start (2)) and (w <= var_per_stop (2))) THEN
          var_gap_index := 2;
      ELSIF ((var_per_start (3) > 0) and (var_per_stop (3) > 0) and (w >= var_per_start (3)) and (w <= var_per_stop (3))) THEN
          var_gap_index := 3;
      ELSIF ((var_per_start (4) > 0) and (var_per_stop (4) > 0) and (w >= var_per_start (4)) and (w <= var_per_stop (4))) then
          var_gap_index := 4;
      ELSE
          var_gap_index := 0;
      END IF;
      
      temp_hours := var_hours;
      db_status := -999;
      db_hours := -999;
--DBMS_OUTPUT.put_line ('public_id: ' || to_char(var_pubid) || ' wk_num: ' || to_char(w));      
      SELECT status, hrs_worked INTO db_status, db_hours FROM datadba.weeks WHERE public_id=var_pubid AND wk_num=w;
      
      IF (db_status > 100) and (floor (db_status/100) <> max_value) THEN    /* if week already has a job from prev round - overlap */
          NULL;
      
      ELSIF (var_gap_index = 0) THEN      /* WORK WEEK */
          IF (db_status < 100) THEN      /* STRAIGHT JOB WEEK, UPDATE WEEKS TABLE */
              UPDATE datadba.weeks SET hrs_worked=temp_hours, status=var_jobnum
                     WHERE public_id=var_pubid AND wk_num=w;
                     
          ELSIF (db_status > 100) AND (db_status <> (var_round*100 + temp_prev_emp#)) THEN   /* JOB WEEK, EXISTING JOB IN WEEKS TABLE */
              BEGIN
                  SELECT MAX(dualjob_num) INTO max_dual FROM datadba.dualjobs WHERE public_id=var_pubid AND wk_num=w; 
              EXCEPTION
                  WHEN NO_DATA_FOUND THEN max_dual:=0;
              END;
              max_dual := NVL(max_dual,0);
              max_dual := max_dual+1; 
              dj := 0;
             IF (max_dual <= 4) then
                 dj := 1;
                 INSERT INTO datadba.dualjobs VALUES (var_pubid,w,max_dual,var_jobnum); 
              END IF;
              IF (temp_hours > 0 and db_hours >= 0) THEN
                  temp_hours := db_hours + temp_hours;
                  IF (temp_hours > 168) THEN 
                      temp_hours := 168;  
                  END IF;
                  UPDATE datadba.weeks SET hrs_worked = temp_hours WHERE public_id=var_pubid AND wk_num=w;
               ELSIF (temp_hours < 0) THEN
                  UPDATE datadba.weeks SET hrs_worked = -3 WHERE public_id=var_pubid AND wk_num=w;
               END IF;
          END IF;   /* JOB WEEK, EXISTING JOB IN WEEKS TABLE */
      ELSIF (var_gap_index > 0) and (db_status < 100) THEN      /* GAP WEEK  W/ NO GOOD JOB ALREADY IN DB */
          stat_code := 5;
          IF (var_per_reason (var_gap_index) = -4) THEN 
              stat_code := 2;
          ELSIF var_per_reason (var_gap_index) = 2 THEN 
              stat_code := 4;
          ELSIF var_per_reason (var_gap_index) = 3 OR var_per_reason (var_gap_index) = 4 THEN
              stat_code := 2;
              IF var_per_all (var_gap_index) = 1 THEN 
                 stat_code := 5; 
              ELSIF var_per_all (var_gap_index) = 3 THEN 
                 stat_code := 4; 
              ELSIF var_per_all (var_gap_index) = 2 AND var_per_look (var_gap_index) >= 0 THEN 
                  stat_code := 9; 
                  var_#weeks:=var_per_look (var_gap_index);
              END IF;
          END IF;
          filler := 0;
        
          IF (stat_code = 9) THEN
              IF (temp_hours > 0 AND db_hours > 0 AND (db_hours - temp_hours) > 0) THEN 
                  temp_hours := (db_hours - temp_hours);  
              ELSIF (temp_hours > 0) THEN 
                  temp_hours := 0;
              END IF;
              IF (filler < var_#weeks AND w > (var_stopwk-var_startwk-var_#weeks)/2 + var_startwk) THEN
                  stat_code := 4; 
                  filler := filler + 1;
              ELSIF (db_status <> 4) THEN 
                  stat_code:=5;
              END IF;
          END IF;
          IF (stat_code <> 3) THEN 
              temp_hours:=0; 
          END IF;
          UPDATE datadba.weeks SET status=stat_code,hrs_worked=temp_hours WHERE public_id=var_pubid and wk_num=w;
      ELSE                 /* OTHERWISE, SET STATUS TO '3' - IN JOB WEEK, BUT NOT A GOOD JOB AND NOT A GOOD GAP */
      
          UPDATE datadba.weeks SET status=3,hrs_worked=temp_hours WHERE public_id=var_pubid and wk_num=w and status < 100;
          
      END IF;
      COMMIT;
   
   END LOOP weekl;                
   <<nextjob>>
   NULL;
  END LOOP jobl;
 /* Begin between job gap fill   */
  SELECT max(period) INTO max_per# FROM datadba.betweenjobs WHERE public_id=var_pubid AND round=max_value;
  max_per#:=NVL(max_per#,0);
  stat_code := 0;
  
  <<periodl>>
  FOR p IN 1..max_per# LOOP
-- dbms_output.put_line ('pubid: ' || to_char(var_pubid) || '   round: ' || to_char(max_value) || '  period: ' || to_char(p));
   SELECT bstart,bstop,ball,blook,breason 
         INTO var_bstart,var_bstop,var_ball,var_blook,var_breason 
         FROM datadba.betweenjobs WHERE public_id=var_pubid AND round=max_value AND period=p;
   IF (var_bstart > 0 and var_bstop >= var_bstart) THEN 
       stat_code := 2;
       IF (var_ball = 1) THEN 
           stat_code := 5;
       ELSIF (var_ball = 3) THEN 
           stat_code := 4;
       ELSIF (var_ball = 2 and var_blook >= 0) THEN 
           stat_code := 9; 
           var_#weeks := var_blook; 
       END IF;
   END IF;
 
   filler:=0;
   temp_stat_code := stat_code;
--dbms_output.put_line ('pubid: ' || to_char(var_pubid) || '   var_bstart: ' || to_char(var_bstart) || '  var_bstop: ' || to_char(var_bstop));
   
   FOR w IN var_bstart..var_bstop LOOP   /* If gap starts/ends same week as job then leave job in the array */
       emp:=1;
       FOR j IN 1..max_job# LOOP
           SELECT start_wk#,stop_wk# INTO var_startwk,var_stopwk FROM datadba.jobs WHERE public_id=var_pubid AND job#=j AND round=max_value;
           IF (w = var_startwk OR w = var_stopwk) THEN 
               emp:=0; 
           END IF;
       END LOOP;
       IF (temp_stat_code = 9) THEN    
           IF (filler < var_#weeks) AND (w > (var_bstop-var_bstart-var_#weeks)/2 + var_bstart) THEN
              stat_code:=4; 
              filler:=filler+1;
           ELSE 
              stat_code:=5;
           END IF;
       END IF;      
       IF emp=1 THEN 
           UPDATE datadba.weeks SET status=stat_code, hrs_worked=0 WHERE public_id=var_pubid AND wk_num=w;
       END IF;
   END LOOP;
  END LOOP periodl;
 END LOOP respl;
END;
/
exit;

07_SUMMATION.SQL

set serveroutput on
delete from datadba.lastint where round=30;
delete from datadba.calendars where round=30;
DECLARE
      max_value       INTEGER;
      max_job#        INTEGER;
      max_week        INTEGER;
       max_wk_pcy      INTEGER;
      var_wt          NUMBER(10);
      var_pubid       INTEGER;
      var_start_wk#   INTEGER;
      var_stop_wk#    INTEGER;
      var_lastint_wk# INTEGER;
      var_current_wk# INTEGER;
      var_status      INTEGER;
      var_hrs_worked  INTEGER;
      var_job_num_a   INTEGER;
      var_prev_emp#   INTEGER;
      jf              INTEGER;
      var_workc         datadba.calendars.wks_workc%type;
      var_hourc         datadba.calendars.hrs_workc%type;
      var_wumpc         datadba.calendars.wks_umpc%type;
      var_wolfc         datadba.calendars.wks_olfc%type;
      var_cal_year_jobs datadba.calendars.cal_year_jobs%type;
      var_cal_year_job1 datadba.calendars.cal_year_job1%type;
      var_cal_year_job2 datadba.calendars.cal_year_job2%type;
      var_cal_year_job3 datadba.calendars.cal_year_job3%type;
      var_cal_year_job4 datadba.calendars.cal_year_job4%type;
      var_cal_year_job5 datadba.calendars.cal_year_job5%type;
      var_missc         datadba.calendars.wks_missc%type;
      var_nwmissc       datadba.calendars.wks_nwmissc%type;
      var_lastint_jobs  datadba.lastint.lastint_#jobs%type; 
      var_workl         datadba.lastint.wks_workl%type;
      var_hourl         datadba.lastint.hrs_workl%type;
      var_wumpl         datadba.lastint.wks_umpl%type;
      var_wolfl         datadba.lastint.wks_olfl%type;
      var_wbid          datadba.lastint.wks_bid%type;
      var_missl         datadba.lastint.wks_missl%type;
      var_nwmissl       datadba.lastint.wks_nwmissl%type;
      var_jobever       datadba.lastint.num_jobever%type;
      m_wksc            datadba.military.mil_wksc%type;
      err_msg           VARCHAR2(100);
      err_num           NUMBER;
      CURSOR id_cursor IS SELECT pubid FROM datadba.newyear_data order by pubid;
BEGIN
      SELECT MAX(round) INTO max_value FROM datadba.history;
      SELECT MAX(endwk) INTO max_week FROM datadba.master_weeks WHERE round#=max_value;
      /* This is used to establish round that WH is creating and
         'last calendar year' dates to be used.*/
      DBMS_OUTPUT.PUT_LINE('Work History for R ' || TO_CHAR(max_value) || 
                         ' Last Calendar Yr Wk#s ' || TO_CHAR(max_week-103)
                           || '-' || TO_CHAR(max_week));
      OPEN id_cursor;
      LOOP
          <<nfetch>>
          FETCH id_cursor INTO var_pubid;
          EXIT WHEN id_cursor%NOTFOUND;  
          SELECT weight,lastint_wk#,currint_wk# INTO 
          var_wt,var_lastint_wk#,var_current_wk#
          FROM datadba.history
          WHERE public_id=var_pubid AND round=max_value;
          IF var_wt = 0 THEN GOTO nfetch;  END IF;
      var_workc:=0;
      var_hourc:=0;
      var_wumpc:=0;
      var_wolfc:=0;
      var_cal_year_jobs:=0;
      var_cal_year_job1:=0;
      var_cal_year_job2:=0;
      var_cal_year_job3:=0;
      var_cal_year_job4:=0;
      var_cal_year_job5:=0;
      var_missc:=0;
      var_nwmissc:=0;
      var_lastint_jobs:=0;
      var_workl:=0;
      var_hourl:=0;
      var_wumpl:=0;
      var_wolfl:=0;
      var_wbid:=0;
      var_missl:=0;
      var_nwmissl:=0;
      var_jobever:=0;
      m_wksc:=0;
 /* Begin creation of variables SINCE LAST INT  */
          var_wbid:=var_current_wk#-var_lastint_wk# + 1;  /*WKS SINCE LINT */
          
          BEGIN                                          
            SELECT MAX(job#) INTO max_job# FROM datadba.jobs
              WHERE public_id=var_pubid AND round=max_value;
          EXCEPTION
            WHEN NO_DATA_FOUND THEN max_job#:=0;
          END;
          max_job#:=NVL(max_job#,0);        
          var_lastint_jobs:=max_job#;       /*#JOBS SINCE LINT*/
          SELECT max(num_jobever) INTO var_jobever FROM datadba.lastint /*GET PREV MAX*/
            WHERE public_id=var_pubid;                       /*OF JOBS EVER*/
          IF var_jobever>=0 THEN 
            FOR k IN 1..var_lastint_jobs LOOP
               SELECT job_num_a,prev_emp# INTO 
                      var_job_num_a,var_prev_emp# FROM datadba.jobs
                      WHERE round=max_value AND public_id=var_pubid AND
                            job#=k;
               IF var_job_num_a > 100 AND var_prev_emp#=-3 THEN
                  var_jobever:=-3;
               ELSIF var_job_num_a > 100 AND
                      (var_prev_emp#=-4 OR var_prev_emp#=0 ) AND 
                       var_jobever>=0 THEN
                  var_jobever:=var_jobever+1;           /*#JOBS EVER HELD*/
               END IF;  
            END LOOP;
          END IF;
          
          FOR w IN var_lastint_wk#..var_current_wk# LOOP
            SELECT status,hrs_worked INTO 
            var_status,var_hrs_worked FROM datadba.weeks WHERE  
            public_id=var_pubid AND wk_num=w;
            IF var_status > 100 THEN 
              var_workl:=var_workl+1;             
              IF var_hrs_worked >= 0 and var_hourl >= 0 THEN
                 var_hourl:= var_hourl+var_hrs_worked;
              ELSE var_hourl:=-3;
              END IF;
            ELSIF var_status=4 THEN var_wumpl:=var_wumpl+1; 
            ELSIF var_status=2 THEN 
                  var_nwmissl:= var_nwmissl+1;
                  var_wumpl:=-3;
            ELSIF var_status=5 OR var_status=7 THEN var_wolfl:=var_wolfl+1;
            ELSIF var_status=3 THEN
                  var_workl:=var_workl+1;
                  var_missl:=var_missl+1;
                  var_wumpl:=-3;
                  var_wolfl:=-3;
                     IF var_hrs_worked >= 0 and var_hourl >= 0 THEN 
                       var_hourl:= var_hourl+var_hrs_worked;
                     ELSE var_hourl:=-3;
                     END IF;
            ELSE var_missl:=var_missl+1;
                     var_wumpl:=-3;
                     var_wolfl:=-3;
            END IF;
          END LOOP;
          /* Change to Percentages */
          IF var_missl>0 THEN 
          var_missl:=
             TRUNC((var_missl/(var_current_wk#-var_lastint_wk#+1))*100);
          END IF;
          IF var_missl>0 THEN 
          var_nwmissl:=
             TRUNC((var_nwmissl/(var_current_wk#-var_lastint_wk#+1))*100);
          END IF;
          INSERT INTO datadba.lastint VALUES (var_pubid,max_value,
              var_lastint_jobs,
              var_workl,
              var_hourl,
              var_wumpl,
              var_wolfl,
              var_wbid,
              var_missl,
              var_nwmissl,
              var_jobever);
  /* Begin creation of variables for CALENDAR YEAR  */
          max_wk_pcy := -4;
          IF (var_current_wk# <= max_week-52) then max_wk_pcy := var_current_wk#;
          ELSIF (var_current_wk# > max_week-52) then max_wk_pcy := max_week-52;
           END IF;
          FOR j IN REVERSE 1..max_job# LOOP
            SELECT start_wk#,stop_wk#,job_num_a INTO
                   var_start_wk#,var_stop_wk#,var_status FROM datadba.jobs WHERE
                   public_id=var_pubid AND round=max_value AND job#=j;
                jf:=0;
                FOR w IN var_start_wk#..var_stop_wk# LOOP
                   IF w >= max_week-103 AND w <=  max_wk_pcy THEN jf:=1; END IF;
                   EXIT WHEN jf=1;
                END LOOP;
               IF jf=1 THEN var_cal_year_jobs:=var_cal_year_jobs+1;
               IF    var_cal_year_jobs=1 THEN var_cal_year_job1:= var_status;
               ELSIF var_cal_year_jobs=2 THEN var_cal_year_job2:= var_status;
               ELSIF var_cal_year_jobs=3 THEN var_cal_year_job3:= var_status;
               ELSIF var_cal_year_jobs=4 THEN var_cal_year_job4:= var_status;
               ELSIF var_cal_year_jobs=5 THEN var_cal_year_job5:= var_status;
               END IF;
            END IF;
            END LOOP;
          FOR k IN max_week-103..max_wk_pcy LOOP
            SELECT status,hrs_worked INTO 
            var_status,var_hrs_worked FROM datadba.weeks WHERE  
            public_id=var_pubid AND wk_num=k;
            IF var_status > 100 THEN 
              var_workc:=var_workc+1;
              IF var_hourc >= 0 AND var_hrs_worked >= 0 THEN
                 var_hourc:=var_hourc+var_hrs_worked;
              ELSE var_hourc:=-3;
              END IF;
            ELSIF var_status=2 THEN var_nwmissc:=var_nwmissc+1;
                                    var_wumpc:=-3;
                                    var_wolfc:=-3;
            ELSIF var_status=4 AND var_wumpc^=-3 THEN var_wumpc:=var_wumpc+1;
            ELSIF var_status=5 AND var_wolfc^=-3 THEN var_wolfc:=var_wolfc+1;
         ELSIF var_status=7 THEN m_wksc:=m_wksc+1; /* Military Wks*/
           IF var_wolfc^=-3 THEN var_wolfc:=var_wolfc+1;END IF;  
            ELSIF var_status=3 THEN 
                  var_workc:=var_workc+1;
                  var_missc:=var_missc+1;
                  IF var_hourc >= 0 AND var_hrs_worked >= 0 THEN 
                     var_hourc:=var_hourc+var_hrs_worked;  
                  ELSE var_hourc:= -3; 
                  END IF;
                  var_wumpc:=-3;
                  var_wolfc:=-3;
            ELSE  var_missc:=var_missc+1;
                  var_wolfc:=-3;
                  var_wumpc:=-3; 
            END IF;
          END LOOP;
             IF m_wksc=0 THEN 
                 m_wksc:=-4; /* Sa: added*/
             END IF;
          IF var_missc>0 THEN 
              var_missc:=TRUNC((var_missc/52)*100);
          END IF;
          IF var_nwmissc>0 THEN 
              var_nwmissc:=TRUNC((var_nwmissc/52)*100);
          END IF;
          INSERT INTO datadba.calendars VALUES (var_pubid,max_value,
                  var_workc,
                  var_hourc,
                  var_wumpc,
                  var_wolfc,
                  var_cal_year_jobs,
                  var_cal_year_job1,
                  var_cal_year_job2,
                  var_cal_year_job3,
                  var_cal_year_job4,
                  var_cal_year_job5,
                  var_missc,
                  var_nwmissc);
          UPDATE datadba.military SET mil_wksc=m_wksc 
                 WHERE round=max_value AND public_id=var_pubid;
      END LOOP;
      CLOSE id_cursor;
END;    
/exit;

08_MAINVARS.SQL

set serveroutput on;
truncate table datadba.mainvars;
DECLARE
      var_pubid         NUMBER(5);
      var_norcid        NUMBER(7);
      var_round         NUMBER(2);
      var_weight        NUMBER(20);
      err_msg           VARCHAR2(100);
      err_num           NUMBER;
      v1                NUMBER(10);
      v2                NUMBER(10);
      v3                NUMBER(10);
      v4                NUMBER(10);
      v5                NUMBER(10);
      v6                NUMBER(10);
      v7                NUMBER(10);
      CURSOR id_cursor IS SELECT public_id,round,weight FROM datadba.history;
BEGIN
  OPEN id_cursor;
  LOOP
      <<nfetch>>
      FETCH id_cursor INTO var_pubid,var_round,var_weight;
      EXIT WHEN id_cursor%NOTFOUND;   
      IF var_weight = 0 THEN GOTO nfetch;  END IF;
      SELECT norcid INTO var_norcid FROM datadba.interview_status WHERE pubid=var_pubid;
  /* LAST INT VARIABLES */
  BEGIN
  SELECT wks_workl,hrs_workl,wks_umpl,wks_olfl,
         wks_bid,wks_missl,num_jobever INTO 
         v1,v2,v3,v4,v5,v6,v7 FROM datadba.lastint 
         WHERE public_id=var_pubid AND round=var_round;    
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4; v4:=-4; 
                                 v5:=-4; v6:=-4; v7:=-4;
  END;
  IF v1>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'WKSWK-SLI');  END IF;
  IF v2>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'HRSWK-SLI');  END IF;
  IF v3>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'WKSUEMP-SLI');END IF;
  IF v4>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v4,'WKSOLF-SLI'); END IF;
  IF v5>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v5,'WKSSINCELI'); END IF;
  IF v6>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v6,'WKSUNACCT-SLI');END IF;
  IF v7>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v7,'JOBSNUM');    END IF;
  /* CALENDAR VARIABLES */
  BEGIN
  SELECT wks_workc,hrs_workc,wks_umpc,wks_olfc,wks_missc INTO
         v1,v2,v3,v4,v5 FROM datadba.calendars
         WHERE public_id=var_pubid AND round=var_round;    
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4; v4:=-4; v5:=-4;
  END;
  IF v1>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'WKSWK-PCY');  END IF;
  IF v2>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'HRSWK-PCY');  END IF;
  IF v3>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'WKSUEMP-PCY');END IF;
  IF v4>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v4,'WKSOLF-PCY'); END IF;
  IF v5>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v5,'WKSUNACCT-PCY'); END IF;
  /* MILTARY VARIABLES */
  BEGIN
  SELECT mil_wksl,mil_wksc INTO v1,v2 FROM datadba.MILITARY
         WHERE public_id=var_pubid AND round=var_round;    
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4;
  END;
  IF v1>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'MILWK-SLI');  END IF;
  IF v2>=-3 THEN 
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'MILWK-PCY');  END IF;
  /* JOB VARIABLES */
  BEGIN
  SELECT hourly_wage,tenure,pay_rate INTO v1,v2,v3 FROM datadba.JOBS 
         WHERE public_id=var_pubid AND round=var_round AND job#=1;
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4;
  END;
  IF v1>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'HRP1');  END IF;
  IF v2>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'TENURE1');  END IF;
  IF v3>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'PAYRATE-ALL-EMP1'); END IF;
  BEGIN
  SELECT hourly_wage,tenure,pay_rate INTO v1,v2,v3 FROM datadba.JOBS 
         WHERE public_id=var_pubid AND round=var_round AND job#=2;
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4;
  END;
  IF v1>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'HRP2');  END IF;
  IF v2>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'TENURE2');  END IF;
  IF v3>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'PAYRATE-ALL-EMP2'); END IF;
  BEGIN
  SELECT hourly_wage,tenure,pay_rate INTO v1,v2,v3 FROM datadba.JOBS 
         WHERE public_id=var_pubid AND round=var_round AND job#=3;
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4;
  END;
  IF v1>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'HRP3');  END IF;
  IF v2>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'TENURE3');  END IF;
  IF v3>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'PAYRATE-ALL-EMP3'); END IF;
  BEGIN
  SELECT hourly_wage,tenure,pay_rate INTO v1,v2,v3 FROM datadba.JOBS 
         WHERE public_id=var_pubid AND round=var_round AND job#=4;
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4;
  END;
  IF v1>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'HRP4');  END IF;
  IF v2>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'TENURE4');  END IF;
  IF v3>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'PAYRATE-ALL-EMP4'); END IF;
  BEGIN
  SELECT hourly_wage,tenure,pay_rate INTO v1,v2,v3 FROM datadba.JOBS 
         WHERE public_id=var_pubid AND round=var_round AND job#=5;
  EXCEPTION
         WHEN NO_DATA_FOUND THEN v1:=-4; v2:=-4; v3:=-4;
  END;
  IF v1>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v1,'HRP5');  END IF;
  IF v2>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v2,'TENURE5');  END IF;
  IF v3>=-3 THEN
  INSERT INTO datadba.mainvars VALUES (var_pubid,var_norcid,var_round,v3,'PAYRATE-ALL-EMP5'); END IF;
  COMMIT;
  END LOOP;
  CLOSE id_cursor;
EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('HALT ' || TO_CHAR(var_pubid) || ' ' ||
                                    TO_CHAR(var_round));
    err_num:= sqlcode;
    err_msg:= SUBSTR(SQLERRM,1,100);
    DBMS_OUTPUT.PUT_LINE('SQL ERROR# ' || TO_CHAR(err_num) || 
                                      ' ' || err_msg);
END;    
/
exit;

Listed below are programs that generate input variables for the Work History arrays and a number of other related variables. These inputs are loaded into data table structures and then used in a series of SQL programs to create the Work History arrays and other variables. Some of the variables created as inputs for Work History are also released as public variables independently. The contents of these data tables and the SQL programs can be accessed in the Work History Variable Creation Programs above.

PREVID_RESET_2022.SAS

options nocenter validvarname=any;

*There is a max of 14 jobs in R30;

Variable Names in program    Variable Names in data release
CURDAY                       CURDATE~D
CURMO                        CURDATE~M
CURYR                        CURDATE~Y
Lintdat                      SYMBOL_LINTDATE~D
Lintmo                       SYMBOL_LINTDATE~M
Lintyr                       SYMBOL_LINTDATE~Y
empname_wrong                DLI-2A_1~000002
dliemp_added                 DLI-2A_1~000005
empname_change               DLI-FIXROSTER
tempid## (1-14)              TEMPLOYER_ID.## (1-14)
tempast## (1-14)             TEMPLOYER_ASSIGNMT.## (1-14)
tempname## (1-14)            TEMPLOYER_NAME.## (1-14)
tempuid## (1-14)             TEMPLOYERU_ID.## (1-14)
tempuname## (1-14)           TEMPLOYERU_NAME.## (1-14)
empid## (1-14)               EMPLOYER_ID.## (1-14)
empname## (1-14)             EMPLOYER_NAME.## (1-14)
empast## (1-14)              EMPLOYER_ASSIGNMT.## (1-14)
dliname## (1-4)              DLI_UPD1_NAME.## (1-4)

array all        lintmo lintdat lintyr tempid1-tempid14 tempuid1-tempuid14 empid1-empid14;

do over all;
    if all=. then all=-4;
end;

array    tempnm    (i)    $    tempname1-tempname14;
array    tempast    (i)        tempast1-tempast14;
array    tempunm    (i)    $    tempuname1-tempuname14;
array    empid    (i)        empid1-empid14;
array    empname    (i)    $    empname1-empname14;

ct_temp=0;
ct_tempast=0;
ct_tempu=0;
ct_emp=0;
do i=1 to 14;
    if ct_tempast=1 then ct_tempast=ct_tempast+1;
    if tempnm~=' ' then ct_temp=ct_temp+1;
    if tempunm~=' ' then ct_tempu=ct_tempu+1;
    if empname~=' ' then ct_emp=ct_emp+1;
end;

if (ct_emp>ct_temp|ct_emp>ct_tempu) & ct_tempast=0 then handedit=1;
if (ct_emp<ct_temp|ct_emp<ct_tempu) & ct_tempast=0 then problem_case=1;

array previd    (14)        previd_reset1-previd_reset14;
array empid        (14)        empid1-empid14;
array tempuid    (14)        tempuid1-tempuid14;

do i=1 to 14;
    previd(i) = -4;
    if (empid(i)>-4 & tempuid(i)>-4) then previd(i)=tempuid(i);
    if (empid(i)>-4 & (tempuid(i)=0 | tempuid(i)=-4)) then previd(i)=-4;
end;

ES_EXTRACT_2022_ORACLE.SAS

Variable Names in program    Variable Names in survey instrument
 INT_D                        CURDATE~D
 INT_M                        CURDATE~M
 INT_Y                        CURDATE~Y
 E##COWCD                     EMPLOYER_COWCODE.## (1-14)
 JOBTYP##                     EMPLOYER_FJOBTYPE.## (1-14)
 PREVID##                     EMPLOYER_ID.## (1-14)
 STAJOBD##                    EMPLOYER_STARTDATE.##~D (1-14)
 STAJOBM##                    EMPLOYER_STARTDATE.##~M (1-14)
 STAJOBY##                    EMPLOYER_STARTDATE.##~Y (1-14)
 STOJOBD##                    EMPLOYER_STOPDATE.##~D (1-14)
 STOJOBM##                    EMPLOYER_STOPDATE.##~M (1-14)
 STOJOBY##                    EMPLOYER_STOPDATE.##~Y (1-14)
 NTNGAP##                     NTES-28B.## (1-14)
 NTSRGD##                     NTES-28D.##~D (1-14)
 NTSRGM##                     NTES-28D.##~M (1-14)
 NTSRGY##                     NTES-28D.##~Y (1-14)
 NTERGD##                     NTES-28E.##~D (1-14)
 NTERGM##                     NTES-28E.##~M (1-14)
 NTERGY##                     NTES-28E.##~Y (1-14)
 NTSLGD##                     NTES-28F.##~D (1-14)
 NTSLGM##                     NTES-28F.##~M (1-14)
 NTSLGY##                     NTES-28F.##~Y (1-14)
 NTELGD##                     NTES-28G.##~D (1-14)
 NTELGM##                     NTES-28G.##~M (1-14)
 NTELGY##                     NTES-28G.##~Y (1-14)
 NTMROP##                     NTES-50A1.## (1-14)
 Miloutli                     Q4-1A
 Milinli                      Q4-1B
 Crmlsnli                     Q4-10
 Amilsnli                     Q4-11
 q4_11a_m                     Q4-11A~M
 q4_11a_y                     Q4-11A~Y
 milind1                      Q4-11B~D
 milinm1                      Q4-11B~M
 miliny1                      Q4-11B~Y
 srvactml                     Q4-12
 milind2                      Q4-12B~D
 milinm2                      Q4-12B~M
 miliny2                      Q4-12B~Y
 milind3                      Q4-12C~D
 milinm3                      Q4-12C~M
 miliny3                      Q4-12C~Y
 miloutd2                     Q4-13~D
 miloutm2                     Q4-13~M
 milouty2                     Q4-13~Y
 miloutd3                     Q4-13A~D
 miloutm3                     Q4-13A~M
 milouty3                     Q4-13A~Y
 q4_28                        Q4-28
 q4_3                         Q4-3
 actmlnow                     Q4-30
 amilcrli                     Q4-5A
 q4_6_m                       Q4-6~M
 q4_6_y                       Q4-6~Y
 miloutd1                     Q4-6A~D
 miloutm1                     Q4-6A~M
 milouty1                     Q4-6A~Y
 milsinli                     Q4-9
 q4_9a_a                      Q4-9A-A
 mlsinli2                     Q4-9A
 mlsinli3                     Q4-9A1
 mlsinli4                     Q4-9B
 mlsinli5                     Q4-9B1
 q4_c                         Q4-C
 stabgpd##                    Q7-10.##~D (1-6)
 stabgpm##                    Q7-10.##~M (1-6)
 stabgpy##                    Q7-10.##~Y (1-6)
 stobgpd##                    Q7-11.##~D (1-6)
 stobgpm##                    Q7-11.##~M (1-6)
 stobgpy##                    Q7-11.##~Y (1-6)
 wklkbg1##                    Q7-12.## (1-6)
 q7_15_##                     Q7-15.## (1-6)
 wklkbg##2                    Q7-16.## (1-6)
 q7_17_##                     Q7-17.## (1-6)
 ynolkb##g                    Q7-19.## (1-6)
 q7_9                         Q7-9
 q7_a                         Q7-A
 CRWKEMP#                     EMPLOYER_CURFLAG.01 (1-14)
 YLFTJOB#                     QES-23A.14
 ANYWJGP#                     QES-28.14
 STAWG####D                   QES-30.##.##~D (job 1-14, within job gap 1-4)
 STAWG####M                   QES-30.##.##~M (job 1-14, within job gap 1-4)
 STAWG####Y                   QES-30.##.##~Y (job 1-14, within job gap 1-4)
 STOWG####D                   QES-31.##.##~D (job 1-14, within job gap 1-4)
 STOWG####M                   QES-31.##.##~M (job 1-14, within job gap 1-4)
 STOWG####Y                   QES-31.##.##~Y (job 1-14, within job gap 1-4)
 YNWKG####1                   QES-33.##.## (job 1-14, within job gap 1-4)
 WKLKG####1                   QES-36.##.## (job 1-14, within job gap 1-4)
 WKLKG####2                   QES-40.##.## (job 1-14, within job gap 1-4)
 QES4A_##                     QES-4A.## (1-14)
 JBSTWHN##                    QES-4B.## (1-14)
 HRSDAYU##                    QES-51.## (1-14)
 HRSWKU##                     QES-52A.## (1-14)
 HRWKUHM##                    QES-52D.## (1-14)
 e_53b_##                     QES-53B.## (1-14)
 e_54b_##                     QES-54B.## (1-14)
 OCCSMLI##                    QES-55DC.## (1-14)
 COWNEW##                     QES-56B.## (1-14)
 MNSB4LI##                    QES-6.## (1-14)
 ROPTU##                      QES-71G.## (1-14)
 HRROP##1                     QES-71I.## (1-14)
 HRROP##2                     QES-71J.## (1-14)
 HRROP##3                     QES-71P.## (1-14)
 HRROP##4                     QES-71R.## (1-14)
 HRROP##5                     QES-73J.## (1-14)
 WKROP##1                     QES-74D.## (1-14)
 WKROP##2                     QES-74E.## (1-14)
 WKROP##3                     QES-74K.## (1-14)
 WKROP##4                     QES-74M.## (1-14)
 WKROP##5                     QES-74Q.## (1-14)
 WKROP##6                     QES-74R.## (1-14)
 MOROP##1                     QES-74U.## (1-14)
 MOROP##2                     QES-74V.## (1-14)
 MOROP##3                     QES-75B.## (1-14)
 MOROP##4                     QES-75D.## (1-14)
 MOROP##6                     QES-75H.## (1-14)
 YRROP##1                     QES-75J.## (1-14)
 YRROP##2                     QES-75K.## (1-14)
 YRROP##3                     QES-75Q.## (1-14)
 YRROP##4                     QES-75S.## (1-14)
 YRROP##5                     QES-75V.## (1-14)
 YRROP##6                     QES-75W.## (1-14)
 BWROP##1                     QES-75Y.## (1-14)
 BWROP##2                     QES-75Z.## (1-14)
 BWROP##3                     QES-76F.## (1-14)
 BWROP##4                     QES-76H.## (1-14)
 ES_8_##                      QES-8.## (1-14)
 UNIONJB##                    QES-88B.## (1-14)
 TEACH##                      QES-TEACH1.## (1-14)
 TCSHRW##                     QES-TEACH10.## (1-14)
 TCSNUM##                     QES-TEACH11.## (1-14)
 THRSWK##                     QES-TEACH13.## (1-14)
 TAPAY####                    QES-TEACH17.##.## (job 1-14, teaching assignment 1-3)
 TADWK####                    QES-TEACH18.##.## (job 1-14, teaching assignment 1-3)
 TADHR####                    QES-TEACH19.##.## (job 1-14, teaching assignment 1-3)
 TREGSC##                     QES-TEACH2.## (1-14)
 TADAPT##                     QES-TEACH5.## (1-14)
 TYROP##                      QES-TEACH6.## (1-14)
 TCSPAY##                     QES-TEACH7.## (1-14)
 TCSROP##                     QES-TEACH8.## (1-14)
 TCSWKS##                     QES-TEACH9.## (1-14)
 YLFTSEJ##                    SES-BUSOWN-23A.## (1-14)
 HRWKSEU##                    SES-52A.## (1-14)
 HRWKSEH##                    SES-52D.## (1-14)
 SEYROP##                     SES-71A.## (1-14)
 Milact                       SYMBOL_ACTIVEFLAG
 LINT_D                       SYMBOL_LINTDATE~D
 LINT_M                       SYMBOL_LINTDATE~M
 LINT_Y                       SYMBOL_LINTDATE~Y
 Omilcode                     SYMBOL_OLDMILCODE
 INDNWDS##                    QES-55E.## (1-14)
 OCCNWDS##                    QES-55H.## (1-14)
 TPEROP##                     QES-TEACH12.## (1-14)
 
do over newvarschar;
  if missing(oldvarschar) then do;
     call missing(newvarschar);
     end;
  else newvarschar=oldvarschar;
end;

************************;
************************;
************************;
*  employers #1 - #14   ;
************************;
************************;
************************;
array stajobm (i) stajobm1-stajobm14;
array stajobd (i) stajobd1-stajobd14;
array stajoby (i) stajoby1-stajoby14;
array stojobm (i) stojobm1-stojobm14;
array stojobd (i) stojobd1-stojobd14;
array stojoby (i) stojoby1-stojoby14;
array _stamdy (i) _stamdy1-_stamdy14;
array _stomdy (i) _stomdy1-_stomdy14;

do i = 1 to 14;
    if stajoby=stojoby & stajobm=stojobm & stojobd>15 & stajobd in (-1,-2,-3,0) then stajobd=1;
    if stajoby=stojoby & stajobm=stojobm & stajobd<28 & stojobd in (-1,-2,-3,0) then stojobd=28;
   if stajobm>0 & stajobd>0 & stajoby>0 then _stamdy=mdy(stajobm,stajobd,stajoby);
   if stajobm>0 & stajobd in (-1,-2,-3,0) & stajoby>0 then _stamdy=mdy(stajobm,15,stajoby);
   if stojobm>0 & stojobd>0 & stojoby>0 then _stomdy=mdy(stojobm,stojobd,stojoby);
   if stojobm>0 & stojobd in (-1,-2,-3,0) & stojoby>0 then _stomdy=mdy(stojobm,15,stojoby);
end;

lintmdy=mdy(lint_m,lint_d,lint_y);
array back_reported     (i)     back_reported1-back_reported14;

do i = 1 to 14;
   if stajobm>0 & stajobd>0 & stajoby>0 then _stamdy=mdy(stajobm,stajobd,stajoby);
   if stajobm>0 & stajobd in (-1,-2,-3,0) & stajoby>0 then _stamdy=mdy(stajobm,15,stajoby);
    if _stamdy>0 & _stamdy<lintmdy then back_reported=1;
end;

************************;
************************;
*  compute old jbstwhn  ;
************************;
************************;

array whnstrt (i) whnstrt1-whnstrt14;
array jbstwhn (i) jbstwhn1-jbstwhn14;

do i = 1 to 14;
  whnstrt=-4;
end;

do i = 1 to 14;
  if (stajobm eq -4) then whnstrt=-4;
  else if (stajobm eq lint_m and stajobd eq lint_d and
         stajoby eq lint_y) then whnstrt=2;
  else if (stajoby lt lint_y) then whnstrt =1;
  else if (stajoby gt lint_y) then whnstrt=3;
  else if (stajoby eq lint_y and stajobm lt lint_m)
         then whnstrt=1;
  else if (stajoby eq lint_y and stajobm eq lint_m and
         stajobd lt lint_d) then whnstrt=1;
  else if (stajoby eq lint_y and stajobm gt lint_m)
         then whnstrt=3;
  else if (stajoby eq lint_y and stajobm eq lint_m and
         stajobd gt lint_d) then whnstrt=3;
  else whnstrt=-3;
end;

do i = 1 to 14;
  jbstwhn=whnstrt;
end;

************************;
************************;
*compute reasons for gap;
************************;
************************;
array ynwkg_1c (i) ynwkg11c ynwkg21c ynwkg31c ynwkg41c ynwkg51c ynwkg61c ynwkg71c ynwkg81c ynwkg91c ynwkg101c ynwkg111c ynwkg121c ynwkg131c ynwkg141c;
array ynwkg_2c (i) ynwkg12c ynwkg22c ynwkg32c ynwkg42c ynwkg52c ynwkg62c ynwkg72c ynwkg82c ynwkg92c ynwkg102c ynwkg112c ynwkg122c ynwkg132c ynwkg142c;
array ynwkg_3c (i) ynwkg13c ynwkg23c ynwkg33c ynwkg43c ynwkg53c ynwkg63c ynwkg73c ynwkg83c ynwkg93c ynwkg103c ynwkg113c ynwkg123c ynwkg133c ynwkg143c;
array ynwkg_4c (i) ynwkg14c ynwkg24c ynwkg34c ynwkg44c ynwkg54c ynwkg64c ynwkg74c ynwkg84c ynwkg94c ynwkg104c ynwkg114c ynwkg124c ynwkg134c ynwkg144c;
array ynwkg_11 (i) ynwkg111 ynwkg211 ynwkg311 ynwkg411 ynwkg511 ynwkg611 ynwkg711 ynwkg811 ynwkg911 ynwkg1011 ynwkg1111 ynwkg1211 ynwkg1311 ynwkg1411;
array ynwkg_21 (i) ynwkg121 ynwkg221 ynwkg321 ynwkg421 ynwkg521 ynwkg621 ynwkg721 ynwkg821 ynwkg921 ynwkg1021 ynwkg1121 ynwkg1221 ynwkg1321 ynwkg1421;
array ynwkg_31 (i) ynwkg131 ynwkg231 ynwkg331 ynwkg431 ynwkg531 ynwkg631 ynwkg731 ynwkg831 ynwkg931 ynwkg1031 ynwkg1131 ynwkg1231 ynwkg1331 ynwkg1431;
array ynwkg_41 (i) ynwkg141 ynwkg241 ynwkg341 ynwkg441 ynwkg541 ynwkg641 ynwkg741 ynwkg841 ynwkg941 ynwkg1041 ynwkg1141 ynwkg1241 ynwkg1341 ynwkg1441;

******************************;
*  compute reason for gap #1  ;
******************************;
do i = 1 to 14;
  ynwkg_1c=-4;
end;

do i = 1 to 14;
  if (ynwkg_11 >= -4) then ynwkg_1c=ynwkg_11;
  else ynwkg_1c=-6;
end;

******************************;
*  compute reason for gap #2  ;
******************************;
do i = 1 to 14;
  ynwkg_2c=-4;
end;

do i = 1 to 14;
  if (ynwkg_21 >= -4) then ynwkg_2c=ynwkg_21;
  else ynwkg_2c=-6;
end;

******************************;
*  compute reason for gap #3  ;
******************************;
do i = 1 to 14;
  ynwkg_3c=-4;
end;

do i = 1 to 14;
  if (ynwkg_31 >= -4) then ynwkg_3c=ynwkg_31;
  else ynwkg_3c=-6;
end;

******************************;
*  compute reason for gap #4  ;
******************************;
do i = 1 to 14;
 ynwkg_4c=-4;
end;

do i = 1 to 14;
  if (ynwkg_41 >= -4) then ynwkg_4c=ynwkg_41;
  else ynwkg_4c=-6;
end;

************************;
************************;
*  compute hours worked ;
************************;
************************;
array hrwkuhm (i) hrwkuhm1-hrwkuhm14;
array hrswku  (i) hrswku1-hrswku14;
array crwkemp (i) crwkemp1-crwkemp14;
array jobtyp  (i) jobtyp1-jobtyp14;
array hrswk   (i) hrswk1-hrswk14;
************************;
* hours worked per week ;
************************;
do i = 1 to 14;
  hrswk=-4;
end;

do i = 1 to 14;
  if jobtyp ~=3 then do;
    if (hrwkuhm ~= -4) then hrswk=hrwkuhm;
    else if (hrswku ~= -4) then hrswk=hrswku;
    else if (crwkemp = -4) then hrswk=-4;
    else hrswk=-6;
  end;
end;

*************************************;
*hours worked per week--self-employed;
*************************************;
array hrwkseh (i) hrwkseh1-hrwkseh14;

do i = 1 to 14;
  if jobtyp=3 then do;
    if (hrwkseh ~= -4) then hrswk=hrwkseh;
    else if (crwkemp = -4) then hrswk=-4;
    else hrswk=-6;
  end;
end;

*************************************;
*  hours worked per week--teachers   ;
*************************************;
array tregsc  (i) tregsc1-tregsc14;
array tcspay  (i) tcspay1-tcspay14;
array tadapt  (i) tadapt1-tadapt14;
array thrswk  (i) thrswk1-thrswk14;
array tadwk_1 (i) tadwk11-tadwk141;
array tadwk_2 (i) tadwk12-tadwk142;
array tadwk_3 (i) tadwk13-tadwk143;
array tadhr_1 (i) tadhr11-tadhr141;
array tadhr_2 (i) tadhr12-tadhr142;
array tadhr_3 (i) tadhr13-tadhr143;

do i = 1 to 14;
  if tregsc=1 then do;
    if tcspay in (0,-4) & tadapt=0 & thrswk ~= -4 then hrswk=thrswk;
    if tadapt=1 then do;
       if tadwk_1 >= 0 & tadwk_2 >= 0 & tadwk_3 >= 0 then do;
       hrswk=(((tadwk_1*tadhr_1)+(tadwk_2*tadhr_2)+(tadwk_3*tadhr_3))/52) + thrswk;
       end;
       if tadwk_1 >= 0 & tadwk_2 >= 0 & tadwk_3 < 0 then do;
       hrswk=(((tadwk_1*tadhr_1)+(tadwk_2*tadhr_2))/52) + thrswk;
       end;
       if tadwk_1 >= 0 & tadwk_2 < 0 & tadwk_3 < 0 then do;
       hrswk=((tadwk_1*tadhr_1)/52) + thrswk;
       end;
    end;
    if tcspay=1 & hrswk <= 0 then hrswk=-6;
  end;
end;

***************************************************************************;
*calculation for teacher hours creates decimal values--round to nearest one;
***************************************************************************;
do i = 1 to 14;
  if hrswk>0 then do;
    hrswk=round(hrswk,1);
  end;
end;

*****************************************;
*****************************************;
*why left job?  recodes for self-employed;
*****************************************;
*****************************************;
array ylftsej (i) ylftsej1-ylftsej14;
array ylftjob (i) ylftjob1-ylftjob14;

do i = 1 to 14;
  if jobtyp=3 then do;
    if ylftsej=1 then ylftjob=22;
    if ylftsej=2 then ylftjob=23;
    if ylftsej=3 then ylftjob=24;
    if ylftsej=4 then ylftjob=25;
    if ylftsej in (-1,-2) then ylftjob=ylftsej;
  end;
end;

*****************;
*****************;
* class of worker;
*****************;
*****************;
array cow     (i) cow1-cow14;
array occsmli (i) occsmli1-occsmli14;
array indnwds (i) indnwds1-indnwds14;
array occnwds (i) occnwds1-occnwds14;
array cownew  (i) cownew1-cownew14;
array empnum  (i) empnum1-empnum14;
array ecowcd  (i) e1cowcd e2cowcd e3cowcd e4cowcd e5cowcd e6cowcd e7cowcd e8cowcd e9cowcd e10cowcd e11cowcd e12cowcd e13cowcd e14cowcd;
array e_53b   (i) e_53b_1-e_53b_14;
array e_54b   (i) e_54b_1-e_54b_14;

do i = 1 to 14;
    empnum=-4;
   cow=-4;
end;

do i = 1 to 14;
   if (crwkemp ~= -4 & crwkemp ~= -5) then empnum=i;
   else if (crwkemp = -5) then empnum=-5;
end;

do i = 1 to 14;
   if (empnum > -4 & cownew ~= -4) then cow=cownew; 
   else if (empnum > -4 & ecowcd ~= -4) then cow=ecowcd;
   else if (empnum > -4 & e_53b~=0 & e_54b~=0) then cow=-3;
    if (crwkemp > -4 & (cow = 0|cow = -3) & jobtyp = 3) then cow=4;
end;

*************;
*************;
*  PAYRATES  ;
*************;
*************;
******************;
******************;
* basic payrates  ;
******************;
******************;
array payrate (i)     payrate1-payrate14;
array roptu   (i)     roptu1-roptu14;
array hrrop_1 (i)     hrrop11 hrrop21 hrrop31 hrrop41 hrrop51 hrrop61 hrrop71 hrrop81 hrrop91 hrrop101 hrrop111 hrrop121 hrrop131 hrrop141;
array hrrop_2 (i)     hrrop12 hrrop22 hrrop32 hrrop42 hrrop52 hrrop62 hrrop72 hrrop82 hrrop92 hrrop102 hrrop112 hrrop122 hrrop132 hrrop142;
array hrrop_3 (i)     hrrop13 hrrop23 hrrop33 hrrop43 hrrop53 hrrop63 hrrop73 hrrop83 hrrop93 hrrop103 hrrop113 hrrop123 hrrop133 hrrop143;
array hrrop_4 (i)     hrrop14 hrrop24 hrrop34 hrrop44 hrrop54 hrrop64 hrrop74 hrrop84 hrrop94 hrrop104 hrrop114 hrrop124 hrrop134 hrrop144;
array hrrop_5 (i)     hrrop15 hrrop25 hrrop35 hrrop45 hrrop55 hrrop65 hrrop75 hrrop85 hrrop95 hrrop105 hrrop115 hrrop125 hrrop135 hrrop145;
array wkrop_1 (i)     wkrop11 wkrop21 wkrop31 wkrop41 wkrop51 wkrop61 wkrop71 wkrop81 wkrop91 wkrop101 wkrop111 wkrop121 wkrop131 wkrop141;
array wkrop_2 (i)     wkrop12 wkrop22 wkrop32 wkrop42 wkrop52 wkrop62 wkrop72 wkrop82 wkrop92 wkrop102 wkrop112 wkrop122 wkrop132 wkrop142;
array wkrop_3 (i)     wkrop13 wkrop23 wkrop33 wkrop43 wkrop53 wkrop63 wkrop73 wkrop83 wkrop93 wkrop103 wkrop113 wkrop123 wkrop133 wkrop143;
array wkrop_4 (i)     wkrop14 wkrop24 wkrop34 wkrop44 wkrop54 wkrop64 wkrop74 wkrop84 wkrop94 wkrop104 wkrop114 wkrop124 wkrop134 wkrop144;
array wkrop_5 (i)     wkrop15 wkrop25 wkrop35 wkrop45 wkrop55 wkrop65 wkrop75 wkrop85 wkrop95 wkrop105 wkrop115 wkrop125 wkrop135 wkrop145;
array wkrop_6 (i)     wkrop16 wkrop26 wkrop36 wkrop46 wkrop56 wkrop66 wkrop76 wkrop86 wkrop96 wkrop106 wkrop116 wkrop126 wkrop136 wkrop146;
array morop_1 (i)     morop11 morop21 morop31 morop41 morop51 morop61 morop71 morop81 morop91 morop101 morop111 morop121 morop131 morop141;
array morop_2 (i)     morop12 morop22 morop32 morop42 morop52 morop62 morop72 morop82 morop92 morop102 morop112 morop122 morop132 morop142;
array morop_3 (i)    morop13 morop23 morop33 morop43 morop53 morop63 morop73 morop83 morop93 morop103 morop113 morop123 morop133 morop143;
array morop_4 (i)     morop14 morop24 morop34 morop44 morop54 morop64 morop74 morop84 morop94 morop104 morop114 morop124 morop134 morop144;
array morop_6 (i)    morop16 morop26 morop36 morop46 morop56 morop66 morop76 morop86 morop96 morop106 morop116 morop126 morop136 morop146;
array yrrop_1 (i)     yrrop11 yrrop21 yrrop31 yrrop41 yrrop51 yrrop61 yrrop71 yrrop81 yrrop91 yrrop101 yrrop111 yrrop121 yrrop131 yrrop141;
array yrrop_2 (i)     yrrop12 yrrop22 yrrop32 yrrop42 yrrop52 yrrop62 yrrop72 yrrop82 yrrop92 yrrop102 yrrop112 yrrop122 yrrop132 yrrop142;
array yrrop_3 (i)     yrrop13 yrrop23 yrrop33 yrrop43 yrrop53 yrrop63 yrrop73 yrrop83 yrrop93 yrrop103 yrrop113 yrrop123 yrrop133 yrrop143;
array yrrop_4 (i)     yrrop14 yrrop24 yrrop34 yrrop44 yrrop54 yrrop64 yrrop74 yrrop84 yrrop94 yrrop104 yrrop114 yrrop124 yrrop134 yrrop144;
array yrrop_5 (i)     yrrop15 yrrop25 yrrop35 yrrop45 yrrop55 yrrop65 yrrop75 yrrop85 yrrop95 yrrop105 yrrop115 yrrop125 yrrop135 yrrop145;
array yrrop_6 (i)     yrrop16 yrrop26 yrrop36 yrrop46 yrrop56 yrrop66 yrrop76 yrrop86 yrrop96 yrrop106 yrrop116 yrrop126 yrrop136 yrrop146;
array bwrop_1 (i)     bwrop11 bwrop21 bwrop31 bwrop41 bwrop51 bwrop61 bwrop71 bwrop81 bwrop91 bwrop101 bwrop111 bwrop121 bwrop131 bwrop141;
array bwrop_2 (i)     bwrop12 bwrop22 bwrop32 bwrop42 bwrop52 bwrop62 bwrop72 bwrop82 bwrop92 bwrop102 bwrop112 bwrop122 bwrop132 bwrop132;
array bwrop_3 (i)     bwrop13 bwrop23 bwrop33 bwrop43 bwrop53 bwrop63 bwrop73 bwrop83 bwrop93 bwrop103 bwrop113 bwrop123 bwrop133 bwrop143;
array bwrop_4 (i)     bwrop14 bwrop24 bwrop34 bwrop44 bwrop54 bwrop64 bwrop74 bwrop84 bwrop94 bwrop104 bwrop114 bwrop124 bwrop134 bwrop144;

do i = 1 to 14;
  payrate=-4;
end;

do i = 1 to 14;
  if jobtyp ~= 3 & tregsc ~= 1 then do;
    if (roptu = 1 & hrrop_5 > 0) then payrate=hrrop_5;
    else if (roptu = 1 & hrrop_5 > -4 & hrrop_5 < 0) then payrate=hrrop_5;
    else if (roptu = 1 & hrrop_4 > 0) then payrate=hrrop_4;
    else if (roptu = 1 & hrrop_4 > -4 & hrrop_4 < 0) then payrate=hrrop_4;
    else if (roptu = 1 & hrrop_3 > 0) then payrate=hrrop_3;
    else if (roptu = 1 & hrrop_3 > -4 & hrrop_3 < 0) then payrate=hrrop_3;
    else if (roptu = 1 & hrrop_2 > 0) then payrate=hrrop_2;
    else if (roptu = 1 & hrrop_2 > -4 & hrrop_2 < 0) then payrate=hrrop_2;
    else if (roptu = 1 & hrrop_1 > 0) then payrate=hrrop_1;
    else if (roptu = 1 & hrrop_1 > -4 & hrrop_1 < 0) then payrate=hrrop_1;
    else if (roptu = 1 & hrrop_5 = 0 & hrrop_4 = 0
          & hrrop_3 = 0 & hrrop_2 = 0 & hrrop_1 = 0) then payrate=-4;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_6 > 0)
          then payrate=wkrop_6;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_6 > -4
          & wkrop_6 < 0) then payrate=wkrop_6;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_5 > 0)
          then payrate=wkrop_5;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_5 > -4
          & wkrop_5 < 0) then payrate=wkrop_5;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_4 > 0)
          then payrate=wkrop_4;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_4 > -4
          & wkrop_4 < 0) then payrate=wkrop_4;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_3 > 0)
          then payrate=wkrop_3;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_3 > -4
          & wkrop_3 < 0) then payrate=wkrop_3;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_2 > 0)
          then payrate=wkrop_2;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_2 > -4
          & wkrop_2 < 0) then payrate=wkrop_2;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_1 > 0)
          then payrate=wkrop_1;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_1 > -4
          & wkrop_1 < 0) then payrate=wkrop_1;
    else if ((roptu = 2 | roptu = 3 | roptu = 7) & wkrop_6 = 0
          & wkrop_5 = 0 & wkrop_4 = 0 & wkrop_3 = 0 & wkrop_2 = 0
          & wkrop_1 = 0) then payrate=-4;
    else if ((roptu = 5 | roptu = 8) & morop_6 > 0) then payrate=morop_6;
    else if ((roptu = 5 | roptu = 8) & morop_6 > -4 & morop_6 < 0)
          then payrate=morop_6;
    else if ((roptu = 5 | roptu = 8) & morop_4 > 0) then payrate=morop_4;
    else if ((roptu = 5 | roptu = 8) & morop_4 > -4 & morop_4 < 0)
          then payrate=morop_4;
    else if ((roptu = 5 | roptu = 8) & morop_3 > 0) then payrate=morop_3;
    else if ((roptu = 5 | roptu = 8) & morop_3 > -4 & morop_3 < 0)
          then payrate=morop_3;
    else if ((roptu = 5 | roptu = 8) & morop_2 > 0) then payrate=morop_2;
    else if ((roptu = 5 | roptu = 8) & morop_2 > -4 & morop_2 < 0)
          then payrate=morop_2;
    else if ((roptu = 5 | roptu = 8) & morop_1 > 0) then payrate=morop_1;
    else if ((roptu = 5 | roptu = 8) & morop_1 > -4 & morop_1 < 0)
          then payrate=morop_1;
    else if ((roptu = 5 | roptu = 8) & morop_6 = 0 &
           morop_4 = 0 & morop_3 = 0
          & morop_2 = 0 & morop_1 = 0) then payrate=-4;
    else if ((roptu = 6) & yrrop_6 > -4) then payrate=yrrop_6;
    else if ((roptu = 6) & yrrop_6 > -4 & yrrop_6 < 0) then payrate=yrrop_6;
    else if ((roptu = 6) & yrrop_5 > -4) then payrate=yrrop_5;
    else if ((roptu = 6) & yrrop_5 > -4 & yrrop_5 < 0) then payrate=yrrop_5;
    else if ((roptu = 6) & yrrop_4 > -4) then payrate=yrrop_4;
    else if ((roptu = 6) & yrrop_4 > -4 & yrrop_4 < 0) then payrate=yrrop_4;
    else if ((roptu = 6) & yrrop_3 > -4) then payrate=yrrop_3;
    else if ((roptu = 6) & yrrop_3 > -4 & yrrop_3 < 0) then payrate=yrrop_3;
    else if ((roptu = 6) & yrrop_2 > -4) then payrate=yrrop_2;
    else if ((roptu = 6) & yrrop_2 > -4 & yrrop_2 < 0) then payrate=yrrop_2;
    else if ((roptu = 6) & yrrop_1 > -4) then payrate=yrrop_1;
    else if ((roptu = 6) & yrrop_1 > -4 & yrrop_1 < 0) then payrate=yrrop_1;
    else if ((roptu = 6) & yrrop_6 = 0 & yrrop_5 = 0
          & yrrop_4 = 0 & yrrop_3 = 0 & yrrop_2 = 0 & yrrop_1 = 0)
          then payrate=-4;
    else if ((roptu = 4) & bwrop_4 > -4) then payrate=bwrop_4;
    else if ((roptu = 4) & bwrop_4 > -4 & bwrop_4 < 0) then payrate=bwrop_4;
    else if ((roptu = 4) & bwrop_3 > -4) then payrate=bwrop_3;
    else if ((roptu = 4) & bwrop_3 > -4 & bwrop_3 < 0) then payrate=bwrop_3;
    else if ((roptu = 4) & bwrop_2 > -4) then payrate=bwrop_2;
    else if ((roptu = 4) & bwrop_2 > -4 & bwrop_2 < 0) then payrate=bwrop_2;
    else if ((roptu = 4) & bwrop_1 > -4) then payrate=bwrop_1;
    else if ((roptu = 4) & bwrop_1 > -4 & bwrop_1 < 0) then payrate=bwrop_1;
    else if ((roptu = 4) 
          & bwrop_4 = 0 & bwrop_3 = 0 & bwrop_2 = 0 & bwrop_1 = 0)
          then payrate=-4;
    else if (crwkemp = -4) then payrate=-4;
    else payrate=-3;
  end;
end;

do i = 1 to 14;
    if roptu = 8 & payrate>0 then payrate=payrate/2; 
end;

**************************************************;
**************************************************;
* COMPUTE SELF-EMPLOYMENT RATE OF PAY--YEARLY ONLY;
**************************************************;
**************************************************;
array seyrop  (i) seyrop1-seyrop14;

do i = 1 to 14;
  if jobtyp=3 then do;
    if seyrop > 0 then payrate=(seyrop*100);
    else if -4<seyrop<=0 then payrate=seyrop;
    else if crwkemp=-4 then payrate=-4 ;
    else payrate=-3 ;
    if payrate>-4 then roptu=6;  
  end;
end;

***********************************************************;
***********************************************************;
*       COMPUTE TEACHER RATE OF PAY--YEARLY ONLY           ;
* CANNOT CALCULATE FOR TEACHERS PAID PER COURSE IN ROUND 28;
***********************************************************;
***********************************************************;
array tyrop   (i) tyrop1-tyrop14;
array tapay_1 (i) tapay11 tapay21 tapay31 tapay41 tapay51 tapay61 tapay71 tapay81 tapay91 tapay101 tapay111 tapay121 tapay131 tapay141;
array tapay_2 (i) tapay12 tapay22 tapay32 tapay42 tapay52 tapay62 tapay72 tapay82 tapay92 tapay102 tapay112 tapay122 tapay132 tapay142;
array tapay_3 (i) tapay13 tapay23 tapay33 tapay43 tapay53 tapay63 tapay73 tapay83 tapay93 tapay103 tapay113 tapay123 tapay133 tapay143;
array pay     (i) pay1-pay14;

do i = 1 to 14;
  if tregsc=1 & tcspay ~= 1 then do;
    if tadapt in (-4,0) & tyrop >-4 then payrate=tyrop;
    else if tadapt=1 & tyrop >=0 then do;
      if tapay_1 >= 0 & tapay_2 >= 0 & tapay_3 >= 0 then do;
           payrate=tyrop + tapay_1 + tapay_2 + tapay_3;
      end;
      if tapay_1 >= 0 & tapay_2 >= 0 & tapay_3 < 0 then do;
           payrate=tyrop + tapay_1 + tapay_2;
      end;
      if tapay_1 >= 0 & tapay_2 < 0 & tapay_3 < 0 then do;
           payrate=tyrop + tapay_1;
      end;
      if tapay_1 in (-1,-2,-3) then payrate=tapay_1;
      if tapay_2 in (-1,-2,-3) then payrate=tapay_2;
      if tapay_3 in (-1,-2,-3) then payrate=tapay_3;
    end;
    else if tadapt=1 & tyrop in (-1,-2,-3) then payrate=tyrop;
    else if crwkemp = -4 then payrate=-4;
    else payrate=-3;
    if payrate>-4 then roptu=6;
  end;
end;

do i = 1 to 14;
  if tcspay=1 & payrate <= 0 then do;
    payrate=-3;
    roptu=-3;
  end;
end;

***********************************************************;
***********************************************************;
*  compute non-traditional job rate of pay--monthly only   ;
***********************************************************;
***********************************************************;
array ntmrop  (i)     ntmrop1-ntmrop14;

do i = 1 to 14;
  pay=-4;
end;

do i = 1 to 14;
  if jobtyp=2 then do;
    if ntmrop > -4 then pay=ntmrop;
    else if crwkemp=-4 then pay=-4;
    else pay=-3;
    if pay>0 then do;
      payrate=pay;
      roptu=5;
    end;
  end;
end;

do i = 1 to 14;
    if roptu~=-4 & payrate=-4 then payrate=-3;
end;
*********************************************************************************************;
*********************************************************************************************;
* gaps for non-traditional job holders;
* if number is ge 5, then rs only report longest and most recent gap;
* fill in gap dates in vars for regular job holder gaps--first gap=recent, second gap=longest;
* rs reporting lt 5 gaps go through regular loops;
*********************************************************************************************;
*********************************************************************************************;

array ntsrgd   (i)     ntsrgd1-ntsrgd14;
array ntsrgm   (i)     ntsrgm1-ntsrgm14;
array ntsrgy   (i)     ntsrgy1-ntsrgy14;
array ntergd   (i)     ntergd1-ntergd14;
array ntergm   (i)     ntergm1-ntergm14;
array ntergy   (i)     ntergy1-ntergy14;
array ntslgd   (i)     ntslgd1-ntslgd14;
array ntslgm   (i)     ntslgm1-ntslgm14;
array ntslgy   (i)     ntslgy1-ntslgy14;
array ntelgd   (i)     ntelgd1-ntelgd14;
array ntelgm   (i)     ntelgm1-ntelgm14;
array ntelgy   (i)     ntelgy1-ntelgy14;
array ntngap   (i)     ntngap1-ntngap14;
array stawg_1d (i)     stawg11d stawg21d stawg31d stawg41d stawg51d stawg61d stawg71d stawg81d stawg91d stawg101d stawg111d stawg121d stawg131d stawg141d;
array stawg_1m (i)     stawg11m stawg21m stawg31m stawg41m stawg51m stawg61m stawg71m stawg81m stawg91m stawg101m stawg111m stawg121m stawg131m stawg141m;
array stawg_1y (i)     stawg11y stawg21y stawg31y stawg41y stawg51y stawg61y stawg71y stawg81y stawg91y stawg101y stawg111y stawg121y stawg131y stawg141y;
array stowg_1d (i)     stowg11d stowg21d stowg31d stowg41d stowg51d stowg61d stowg71d stowg81d stowg91d stowg101d stowg111d stowg121d stowg131d stowg141d;
array stowg_1m (i)     stowg11m stowg21m stowg31m stowg41m stowg51m stowg61m stowg71m stowg81m stowg91m stowg101m stowg111m stowg121m stowg131m stowg141m;
array stowg_1y (i)     stowg11y stowg21y stowg31y stowg41y stowg51y stowg61y stowg71y stowg81y stowg91y stowg101y stowg111y stowg121y stowg131y stowg141y;
array stawg_2d (i)     stawg12d stawg22d stawg32d stawg42d stawg52d stawg62d stawg72d stawg82d stawg92d stawg102d stawg112d stawg122d stawg132d stawg142d;
array stawg_2m (i)     stawg12m stawg22m stawg32m stawg42m stawg52m stawg62m stawg72m stawg82m stawg92m stawg102m stawg112m stawg122m stawg132m stawg142m;
array stawg_2y (i)     stawg12y stawg22y stawg32y stawg42y stawg52y stawg62y stawg72y stawg82y stawg92y stawg102y stawg112y stawg122y stawg132y stawg142y;
array stowg_2d (i)     stowg12d stowg22d stowg32d stowg42d stowg52d stowg62d stowg72d stowg82d stowg92d stowg102d stowg112d stowg122d stowg132d stowg142d;
array stowg_2m (i)     stowg12m stowg22m stowg32m stowg42m stowg52m stowg62m stowg72m stowg82m stowg92m stowg102m stowg112m stowg122m stowg132m stowg142m;
array stowg_2y (i)     stowg12y stowg22y stowg32y stowg42y stowg52y stowg62y stowg72y stowg82y stowg92y stowg102y stowg112y stowg122y stowg132y stowg142y;
array stawg_3d (i)     stawg13d stawg23d stawg33d stawg43d stawg53d stawg63d stawg73d stawg83d stawg93d stawg103d stawg113d stawg123d stawg133d stawg143d;
array stawg_3m (i)     stawg13m stawg23m stawg33m stawg43m stawg53m stawg63m stawg73m stawg83m stawg93m stawg103m stawg113m stawg123m stawg133m stawg143m;
array stawg_3y (i)     stawg13y stawg23y stawg33y stawg43y stawg53y stawg63y stawg73y stawg83y stawg93y stawg103y stawg113y stawg123y stawg133y stawg143y;
array stowg_3d (i)     stowg13d stowg23d stowg33d stowg43d stowg53d stowg63d stowg73d stowg83d stowg93d stowg103d stowg113d stowg123d stowg133d stowg143d;
array stowg_3m (i)     stowg13m stowg23m stowg33m stowg43m stowg53m stowg63m stowg73m stowg83m stowg93m stowg103m stowg113m stowg123m stowg133m stowg143m;
array stowg_3y (i)     stowg13y stowg23y stowg33y stowg43y stowg53y stowg63y stowg73y stowg83y stowg93y stowg103y stowg113y stowg123y stowg133y stowg143y;
array stawg_4d (i)     stawg14d stawg24d stawg34d stawg44d stawg54d stawg64d stawg74d stawg84d stawg94d stawg104d stawg114d stawg124d stawg134d stawg144d;
array stawg_4m (i)     stawg14m stawg24m stawg34m stawg44m stawg54m stawg64m stawg74m stawg84m stawg94m stawg104m stawg114m stawg124m stawg134m stawg144m;
array stawg_4y (i)     stawg14y stawg24y stawg34y stawg44y stawg54y stawg64y stawg74y stawg84y stawg94y stawg104y stawg114y stawg124y stawg134y stawg144y;
array stowg_4d (i)     stowg14d stowg24d stowg34d stowg44d stowg54d stowg64d stowg74d stowg84d stowg94d stowg104d stowg114d stowg124d stowg134d stowg144d;
array stowg_4m (i)     stowg14m stowg24m stowg34m stowg44m stowg54m stowg64m stowg74m stowg84m stowg94m stowg104m stowg114m stowg124m stowg134m stowg144m;
array stowg_4y (i)     stowg14y stowg24y stowg34y stowg44y stowg54y stowg64y stowg74y stowg84y stowg94y stowg104y stowg114y stowg124y stowg134y stowg144y;

do i = 1 to 14;
  if ntngap=2 then do;
    stawg_1d=ntsrgd;
    stawg_1m=ntsrgm;
    stawg_1y=ntsrgy;
    stowg_1d=ntergd;
    stowg_1m=ntergm;
    stowg_1y=ntergy;
    stawg_2d=ntslgd;
    stawg_2m=ntslgm;
    stawg_2y=ntslgy;
    stowg_2d=ntelgd;
    stowg_2m=ntelgm;
    stowg_2y=ntelgy;
  end;
end;

*****************************************;
*****************************************;
*FIX CASES WITH PROBLEMATIC SKIP PATTERNS;
*****************************************;
*****************************************;
do i = 1 to 14;
  if tcspay=1 then hrswk=-3;
end;

do i = 1 to 14;
  if tadapt=1 and tapay_1=-4 then payrate=-3;
  if tadapt=1 and tadwk_1=-4 then hrswk=-3;
end;

********************;
********************;
*check teacher hours;
********************;
********************;
array teach   (i)     teach1-teach14;
array thr     (i)     thr1-thr14;
array thrflg  (i)     thrflg1-thrflg14;

do i = 1 to 14;
  thr1=0;
end;

do i = 1 to 14;
  if teach=1 then do;
    if tadapt ~= 1 then do;
      if thrswk>0 & hrwkuhm=thrswk then thr=1;
      if thrswk>0 & hrswku=thrswk then thr=1;
    end;
    if tadapt=1 then do;
      if thrswk>0 & hrwkuhm=hrswk then thr=1;
      if thrswk>0 & hrswku=hrswk then thr=1;
    end;
  end;
end;

do i = 1 to 14;
  thrflg=0;
end;

do i = 1 to 14;
  if thrswk > 0 & tadapt ~= 1 then do;
    if hrwkuhm>0 & hrwkuhm ~= thrswk then thrflg=1;
    if hrwkuhm <= 0 & hrswku ~= thrswk then thrflg=1;
  end;
end;
run;

COW_1994_2022.SAS

Pubid                CASEID
 Norcid            NORCID
1994 variables (1-5)
 previd##1994        EMP##PREVID
 cow##1994            COWALL-EMP.##
 lintday1994            LINTDATE~D
 lintmo1994            LINTDATE~M
 lintyr1994            LINTDATE~Y
1996 variables (1-5)
 previd##1996        EMP##PREVID
 cow##1996            COWALL-EMP.##
 lintday1996            LINTDATE~D
 lintmo1996            LINTDATE~M
 lintyr1996            LINTDATE~Y
1998 variables (1-5)
 lintday1998            LINTDATE~D
 lintmo1998            LINTDATE~M
 lintyr1998            LINTDATE~Y
 previd##1998        EMPPREVID.##
 cow##1998            COWALL-EMP.##
2000 variables (1-5)
 previd##2000        EMPPREVID.##
 cow##2000            COWALL-EMP.##
 lintday2000            LINTDATE~D
 lintmo2000            LINTDATE~M
 lintyr2000            LINTDATE~Y
2002 variables (1-5)
 previd##2002        EMPPREVID.##
 cow##2002            COWALL-EMP.##
 lintday2002            LINTDATE~D
 lintmo2002            LINTDATE~M
 lintyr2002            LINTDATE~Y
2004 variables (1-5)
 previd##2004        EMPPREVID.##
 cow##2004            COWALL-EMP.##
 lintday2004            LINTDATE~D
 lintmo2004            LINTDATE~M
 lintyr2004            LINTDATE~Y
2006 variables (1-5)
 previd##2006        EMPPREVID.##
 cow##2006            COWALL-EMP.##
 lintday2006            LINTDATE~D
 lintmo2006            LINTDATE~M
 lintyr2006            LINTDATE~Y
 cowrev##2006        COWALL-EMP_REVISED.##
2008 variables
 cow##2008            COWALL-EMP.##(1-5)
 lintday2008            LINTDATE~D
 lintmo2008            LINTDATE~M
 lintyr2008            LINTDATE~Y
 previd##2008        EMPLOYER_EMPPREVID.## (1-11)
2010 variables
 lintday2010            LINTDATE~D
 lintmo2010            LINTDATE~M
 lintyr2010            LINTDATE~Y
 cow##2010            COWALL-EMP.## (1-5)
 previd##2010        EMPLOYER_EMPPREVID.## (1-10)
2012 variables
 cow##2012            COWALL-EMP.## (1-5)
 previd##2012        EMPLOYER_EMPPREVID.## (1-9)
 lintday2012            LINTDATE~D
 lintmo2012            LINTDATE~M
 lintyr2012            LINTDATE~Y
2014 variables
 lintday2014            SYMBOL_LINTDATE~D
 lintmo2014            SYMBOL_LINTDATE~M
 lintyr2014            SYMBOL_LINTDATE~Y
 previd#2014            EMPLOYER_EMPPREVID.## (1-7)
2016 variables
 lintday2016            SYMBOL_LINTDATE~D
 lintmo2016            SYMBOL_LINTDATE~M
 lintyr2016            SYMBOL_LINTDATE~Y
 previd##2016        EMPLOYER_EMPPREVID.## (1-8)
2018 variables
 lintday2018            SYMBOL_LINTDATE~D
 lintmo2018            SYMBOL_LINTDATE~M
 lintyr2018            SYMBOL_LINTDATE~Y
 previd##2018        EMPLOYER_EMPPREVID.## (1-9)
2020 variables
 lintday2020            SYMBOL_LINTDATE~D
 lintmo2020            SYMBOL_LINTDATE~M
 lintyr2020            SYMBOL_LINTDATE~Y
 previd##2020        EMPLOYER_EMPPREVID.## (1-6, 13)

array cow     (i) cow1-cow14;
array cowf    (i) cow12022 cow22022 cow32022 cow42022 cow52022 cow62022 cow72022 cow82022 cow92022 cow102022
                  cow112022 cow122022 cow132022 cow142022;
do i = 1 to 14;
   if lintyr2022=. then cow=-5;
   cowf=cow;
end;

lastint2022=0;
if (lintyr2020 > -4) then lastint2022=2020;
else if (lintyr2018 > -4) then lastint2022=2018;
else if (lintyr2016 > -4) then lastint2022=2016;
else if (lintyr2014 > -4) then lastint2022=2014;
else if (lintyr2012 > -4) then lastint2022=2012;
else if (lintyr2010 > -4) then lastint2022=2010;
else if (lintyr2008 > -4) then lastint2022=2008;
else if (lintyr2006 > -4) then lastint2022=2006;
else if (lintyr2004 > -4) then lastint2022=2004;
else if (lintyr2002 > -4) then lastint2022=2002;
else if (lintyr2000 > -4) then lastint2022=2000;
else if (lintyr1998 > -4) then lastint2022=1998;
else if (lintyr1996 > -4) then lastint2022=1996;
else if (lintyr1994 > -4) then lastint2022=1994;
%macro att(yrb);
%do l=1 %to 14;
    %do a=1 %to 13;
        if cow&l.2022 ~= 0 then cow&l.2022_fixed = cow&l.2022;
        else if cow&l.2022 = 0 then do;
            if lastint2022=&yrb & previd&l.2022=&a then do;
                if cow&a&yrb>0|cow&a&yrb=-3|cow&a&yrb=-2|cow&a&yrb=-1 then cow&l.2022_fixed=cow&a&yrb;
                else if cow&a&yrb=0 then cow&l.2022_fixed=-3;
                else if cow&a&yrb=-4 then cow&l.2022_fixed=-4;
            end;
            else if lastint2022=&yrb & previd&l.2022=-4 then cow&l.2022_fixed=-4;
            else if lastint2022=0 then cow&l.2022_fixed=-3;
        end;
    %end;
%end;
%mend att;
%macro rd;
   %do yrb = 2020 %to 1994 %by -2;
       %att(&yrb);
   %end; 
%mend rd;
%rd;
run;

ES_MERGE_2022.SAS

Input from ES_EXTRACT_2022_ORACLE.SAS (see above)

array esallnum         _NUMERIC_;
do over esallnum;
    if missing(esallnum) then esallnum=-4;
end;
array esallchar     _CHARACTER_;
do over esallchar;
    if missing(esallchar) then esallchar=' ';
end;
survyr = 2022;    
q4_12a = -4;
weight22=0;
if INT_D>0 then weight22=1;  
weight=weight22;
if weight = 0 then do;
      q4_c        =-5;
      miloutli    =-5;
      milinli     =-5;
      q4_3        =-5;
      amilcrli    =-5;
      q4_6_m      =-5;
      q4_6_y      =-5;
      miloutd1    =-5;
      miloutm1    =-5;
      milouty1    =-5;
      milsinli    =-5;
      q4_9a_a     =-5;
      mlsinli2    =-5;
      mlsinli3    =-5;
      mlsinli4    =-5;
      mlsinli5    =-5;
      crmlsnli    =-5;
      amilsnli    =-5;
      q4_11a_m    =-5;
      q4_11a_y    =-5;
      milind1     =-5;
      milinm1     =-5;
      miliny1     =-5;
      srvactml    =-5;
      milind2     =-5;
      milinm2     =-5;
      miliny2     =-5;
      milind3     =-5;
      milinm3     =-5;
      miliny3     =-5;
      miloutd2    =-5;
      miloutm2    =-5;
      milouty2    =-5;
      miloutd3    =-5;
      miloutm3    =-5;
      milouty3    =-5;
      q4_28       =-5;
      actmlnow    =-5;
      q7_a        =-5;
      q7_9        =-5;
      stabgpd1    =-5;
      stabgpm1    =-5;
      stabgpy1    =-5;
      stabgpd2    =-5;
      stabgpm2    =-5;
      stabgpy2    =-5;
      stabgpd3    =-5;
      stabgpm3    =-5;
      stabgpy3    =-5;
      stabgpd4    =-5;
      stabgpm4    =-5;
      stabgpy4    =-5;
      stabgpd5    =-5;
      stabgpm5    =-5;
      stabgpy5    =-5;
      stabgpd6    =-5;
      stabgpm6    =-5;
      stabgpy6    =-5;
      stobgpd1    =-5;
      stobgpm1    =-5;
      stobgpy1    =-5;
      stobgpd2    =-5;
      stobgpm2    =-5;
      stobgpy2    =-5;
      stobgpd3    =-5;
      stobgpm3    =-5;
      stobgpy3    =-5;
      stobgpd4    =-5;
      stobgpm4    =-5;
      stobgpy4    =-5;
      stobgpd5    =-5;
      stobgpm5    =-5;
      stobgpy5    =-5;
      stobgpd6    =-5;
      stobgpm6    =-5;
      stobgpy6    =-5;
      wklkbg11    =-5;
      wklkbg21    =-5;
      wklkbg31    =-5;
      wklkbg41    =-5;
      wklkbg51    =-5;
      wklkbg61    =-5;
      q7_15_1     =-5;
      q7_15_2     =-5;
      q7_15_3     =-5;
      q7_15_4     =-5;
      q7_15_5     =-5;
      q7_15_6     =-5;
      wklkbg12    =-5;
      wklkbg22    =-5;
      wklkbg32    =-5;
      wklkbg42    =-5;
      wklkbg52    =-5;
      wklkbg62    =-5;
      q7_17_1     =-5;
      q7_17_2     =-5;
      q7_17_3     =-5;
      q7_17_4     =-5;
      q7_17_5     =-5;
      q7_17_6     =-5;
      ynolkb1g    =-5;
      ynolkb2g    =-5;
      ynolkb3g    =-5;
      ynolkb4g    =-5;
      ynolkb5g    =-5;
      ynolkb6g    =-5;
      JBSTWHN1    =-5;
      JBSTWHN2    =-5;
      JBSTWHN3    =-5;
      JBSTWHN4    =-5;
      JBSTWHN5    =-5;
      JBSTWHN6    =-5;
      JBSTWHN7    =-5;
      JBSTWHN8    =-5;
      JBSTWHN9    =-5;
      JBSTWHN10   =-5;
      JBSTWHN11   =-5;
      JBSTWHN12   =-5;
      JBSTWHN13   =-5;
      JBSTWHN14   =-5;
      MNSB4LI1    =-5;
      MNSB4LI2    =-5;
      MNSB4LI3    =-5;
      MNSB4LI4    =-5;
      MNSB4LI5    =-5;
      MNSB4LI6    =-5;
      MNSB4LI7    =-5;
      MNSB4LI8    =-5;
      MNSB4LI9    =-5;
      MNSB4LI10   =-5;
      MNSB4LI11   =-5;
      MNSB4LI12   =-5;
      MNSB4LI13   =-5;
      MNSB4LI14   =-5;
      CRWKemp1    =-5;
      CRWKemp2    =-5;
      CRWKemp3    =-5;
      CRWKemp4    =-5;
      CRWKemp5    =-5;
      CRWKemp6    =-5;
      CRWKemp7    =-5;
      CRWKemp8    =-5;
      CRWKemp9    =-5;
      CRWKemp10   =-5;
      CRWKemp11   =-5;
      CRWKemp12   =-5;
      CRWKemp13   =-5;
      CRWKemp14   =-5;
      YLFTJOB1    =-5;
      YLFTJOB2    =-5;
      YLFTJOB3    =-5;
      YLFTJOB4    =-5;
      YLFTJOB5    =-5;
      YLFTJOB6    =-5;
      YLFTJOB7    =-5;
      YLFTJOB8    =-5;
      YLFTJOB9    =-5;
      YLFTJOB10   =-5;
      YLFTJOB11   =-5;
      YLFTJOB12   =-5;
      YLFTJOB13   =-5;
      YLFTJOB14   =-5;
      YLFTSEJ1    =-5;
      YLFTSEJ2    =-5;
      YLFTSEJ3    =-5;
      YLFTSEJ4    =-5;
      YLFTSEJ5    =-5;
      YLFTSEJ6    =-5;
      YLFTSEJ7    =-5;
      YLFTSEJ8    =-5;
      YLFTSEJ9    =-5;
      YLFTSEJ10   =-5;
      YLFTSEJ11   =-5;
      YLFTSEJ12   =-5;
      YLFTSEJ13   =-5;
      YLFTSEJ14   =-5;
      ANYWJGP1    =-5;
      ANYWJGP2    =-5;
      ANYWJGP3    =-5;
      ANYWJGP4    =-5;
      ANYWJGP5    =-5;
      ANYWJGP6    =-5;
      ANYWJGP7    =-5;
      ANYWJGP8    =-5;
      ANYWJGP9    =-5;
      ANYWJGP10   =-5;
      ANYWJGP11   =-5;
      ANYWJGP12   =-5;
      ANYWJGP13   =-5;
      ANYWJGP14   =-5;
      STAJOBM1    =-5;
      STAJOBD1    =-5;
      STAJOBY1    =-5;
      STOJOBM1    =-5;
      STOJOBD1    =-5;
      STOJOBY1    =-5;
      STAJOBM2    =-5;
      STAJOBD2    =-5;
      STAJOBY2    =-5;
      STOJOBM2    =-5;
      STOJOBD2    =-5;
      STOJOBY2    =-5;
      STAJOBM3    =-5;
      STAJOBD3    =-5;
      STAJOBY3    =-5;
      STOJOBM3    =-5;
      STOJOBD3    =-5;
      STOJOBY3    =-5;
      STAJOBM4    =-5;
      STAJOBD4    =-5;
      STAJOBY4    =-5;
      STOJOBM4    =-5;
      STOJOBD4    =-5;
      STOJOBY4    =-5;
      STAJOBM5    =-5;
      STAJOBD5    =-5;
      STAJOBY5    =-5;
      STOJOBM5    =-5;
      STOJOBD5    =-5;
      STOJOBY5    =-5;
      STAJOBM6    =-5;
      STAJOBD6    =-5;
      STAJOBY6    =-5;
      STOJOBM6    =-5;
      STOJOBD6    =-5;
      STOJOBY6    =-5;
      STAJOBM7    =-5;
      STAJOBD7    =-5;
      STAJOBY7    =-5;
      STOJOBM7    =-5;
      STOJOBD7    =-5;
      STOJOBY7    =-5;
      STAJOBM8    =-5;
      STAJOBD8    =-5;
      STAJOBY8    =-5;
      STOJOBM8    =-5;
      STOJOBD8    =-5;
      STOJOBY8    =-5;
      STAJOBM9    =-5;
      STAJOBD9    =-5;
      STAJOBY9    =-5;
      STOJOBM9    =-5;
      STOJOBD9    =-5;
      STOJOBY9    =-5;
      STAJOBM10   =-5;
      STAJOBD10   =-5;
      STAJOBY10   =-5;
      STOJOBM10   =-5;
      STOJOBD10   =-5;
      STOJOBY10   =-5;
      STAJOBM11   =-5;
      STAJOBD11   =-5;
      STAJOBY11   =-5;
      STOJOBM11   =-5;
      STOJOBD11   =-5;
      STOJOBY11   =-5;
      STAJOBM12   =-5;
      STAJOBD12   =-5;
      STAJOBY12   =-5;
      STOJOBM12   =-5;
      STOJOBD12   =-5;
      STOJOBY12   =-5;
      STAJOBM13   =-5;
      STAJOBD13   =-5;
      STAJOBY13   =-5;
      STOJOBM13   =-5;
      STOJOBD13   =-5;
      STOJOBY13   =-5;
      STAJOBM14   =-5;
      STAJOBD14   =-5;
      STAJOBY14   =-5;
      STOJOBM14   =-5;
      STOJOBD14   =-5;
      STOJOBY14   =-5;
      STAWG11M    =-5;
      STAWG11D    =-5;
      STAWG11Y    =-5;
      STOWG11M    =-5;
      STOWG11D    =-5;
      STOWG11Y    =-5;
      YNWKG111    =-5;
      YNWKG11C    =-5;
      WKLKG111    =-5;
      WKLKG112    =-5;
      STAWG12M    =-5;
      STAWG12D    =-5;
      STAWG12Y    =-5;
      STOWG12M    =-5;
      STOWG12D    =-5;
      STOWG12Y    =-5;
      YNWKG121    =-5;
      YNWKG12C    =-5;
      WKLKG121    =-5;
      WKLKG122    =-5;
      STAWG13M    =-5;
      STAWG13D    =-5;
      STAWG13Y    =-5;
      STOWG13M    =-5;
      STOWG13D    =-5;
      STOWG13Y    =-5;
      YNWKG131    =-5;
      YNWKG13C    =-5;
      WKLKG131    =-5;
      WKLKG132    =-5;
      STAWG14M    =-5;
      STAWG14D    =-5;
      STAWG14Y    =-5;
      STOWG14M    =-5;
      STOWG14D    =-5;
      STOWG14Y    =-5;
      YNWKG141    =-5;
      YNWKG14C    =-5;
      WKLKG141    =-5;
      WKLKG142    =-5;
      STAWG21D    =-5;
      STAWG21M    =-5;
      STAWG21Y    =-5;
      STOWG21D    =-5;
      STOWG21M    =-5;
      STOWG21Y    =-5;
      YNWKG211    =-5;
      YNWKG21C    =-5;
      WKLKG211    =-5;
      WKLKG212    =-5;
      STAWG22D    =-5;
      STAWG22M    =-5;
      STAWG22Y    =-5;
      STOWG22D    =-5;
      STOWG22M    =-5;
      STOWG22Y    =-5;
      YNWKG221    =-5;
      YNWKG22C    =-5;
      WKLKG221    =-5;
      WKLKG222    =-5;
      STAWG23D    =-5;
      STAWG23M    =-5;
      STAWG23Y    =-5;
      STOWG23D    =-5;
      STOWG23M    =-5;
      STOWG23Y    =-5;
      YNWKG231    =-5;
      YNWKG23C    =-5;
      WKLKG231    =-5;
      WKLKG232    =-5;
      STAWG24D    =-5;
      STAWG24M    =-5;
      STAWG24Y    =-5;
      STOWG24D    =-5;
      STOWG24M    =-5;
      STOWG24Y    =-5;
      YNWKG241    =-5;
      YNWKG24C    =-5;
      WKLKG241    =-5;
      WKLKG242    =-5;
      STAWG31D    =-5;
      STAWG31M    =-5;
      STAWG31Y    =-5;
      STOWG31D    =-5;
      STOWG31M    =-5;
      STOWG31Y    =-5;
      YNWKG311    =-5;
      YNWKG31C    =-5;
      WKLKG311    =-5;
      WKLKG312    =-5;
      STAWG32D    =-5;
      STAWG32M    =-5;
      STAWG32Y    =-5;
      STOWG32D    =-5;
      STOWG32M    =-5;
      STOWG32Y    =-5;
      YNWKG321    =-5;
      YNWKG32C    =-5;
      WKLKG321    =-5;
      WKLKG322    =-5;
      STAWG33D    =-5;
      STAWG33M    =-5;
      STAWG33Y    =-5;
      STOWG33D    =-5;
      STOWG33M    =-5;
      STOWG33Y    =-5;
      YNWKG331    =-5;
      YNWKG33C    =-5;
      WKLKG331    =-5;
      WKLKG332    =-5;
      STAWG34D    =-5;
      STAWG34M    =-5;
      STAWG34Y    =-5;
      STOWG34D    =-5;
      STOWG34M    =-5;
      STOWG34Y    =-5;
      YNWKG341    =-5;
      YNWKG34C    =-5;
      WKLKG341    =-5;
      WKLKG342    =-5;
      STAWG41D    =-5;
      STAWG41M    =-5;
      STAWG41Y    =-5;
      STOWG41D    =-5;
      STOWG41M    =-5;
      STOWG41Y    =-5;
      YNWKG411    =-5;
      YNWKG41C    =-5;
      WKLKG411    =-5;
      WKLKG412    =-5;
      STAWG42D    =-5;
      STAWG42M    =-5;
      STAWG42Y    =-5;
      STOWG42D    =-5;
      STOWG42M    =-5;
      STOWG42Y    =-5;
      YNWKG421    =-5;
      YNWKG42C    =-5;
      WKLKG421    =-5;
      WKLKG422    =-5;
      STAWG43D    =-5;
      STAWG43M    =-5;
      STAWG43Y    =-5;
      STOWG43D    =-5;
      STOWG43M    =-5;
      STOWG43Y    =-5;
      YNWKG431    =-5;
      YNWKG43C    =-5;
      WKLKG431    =-5;
      WKLKG432    =-5;
      STAWG44D    =-5;
      STAWG44M    =-5;
      STAWG44Y    =-5;
      STOWG44D    =-5;
      STOWG44M    =-5;
      STOWG44Y    =-5;
      YNWKG441    =-5;
      YNWKG44C    =-5;
      WKLKG441    =-5;
      WKLKG442    =-5;
      STAWG51D    =-5;
      STAWG51M    =-5;
      STAWG51Y    =-5;
      STOWG51D    =-5;
      STOWG51M    =-5;
      STOWG51Y    =-5;
      YNWKG511    =-5;
      YNWKG51C    =-5;
      WKLKG511    =-5;
      WKLKG512    =-5;
      STAWG52D    =-5;
      STAWG52M    =-5;
      STAWG52Y    =-5;
      STOWG52D    =-5;
      STOWG52M    =-5;
      STOWG52Y    =-5;
      YNWKG521    =-5;
      YNWKG52C    =-5;
      WKLKG521    =-5;
      WKLKG522    =-5;
      STAWG53D    =-5;
      STAWG53M    =-5;
      STAWG53Y    =-5;
      STOWG53D    =-5;
      STOWG53M    =-5;
      STOWG53Y    =-5;
      YNWKG531    =-5;
      YNWKG53C    =-5;
      WKLKG531    =-5;
      WKLKG532    =-5;
      STAWG54D    =-5;
      STAWG54M    =-5;
      STAWG54Y    =-5;
      STOWG54D    =-5;
      STOWG54M    =-5;
      STOWG54Y    =-5;
      YNWKG541    =-5;
      YNWKG54C    =-5;
      WKLKG541    =-5;
      WKLKG542    =-5;
      STAWG61D    =-5;
      STAWG61M    =-5;
      STAWG61Y    =-5;
      STOWG61D    =-5;
      STOWG61M    =-5;
      STOWG61Y    =-5;
      YNWKG611    =-5;
      YNWKG61C    =-5;
      WKLKG611    =-5;
      WKLKG612    =-5;
      STAWG62D    =-5;
      STAWG62M    =-5;
      STAWG62Y    =-5;
      STOWG62D    =-5;
      STOWG62M    =-5;
      STOWG62Y    =-5;
      YNWKG621    =-5;
      YNWKG62C    =-5;
      WKLKG621    =-5;
      WKLKG622    =-5;
      STAWG63D    =-5;
      STAWG63M    =-5;
      STAWG63Y    =-5;
      STOWG63D    =-5;
      STOWG63M    =-5;
      STOWG63Y    =-5;
      YNWKG631    =-5;
      YNWKG63C    =-5;
      WKLKG631    =-5;
      WKLKG632    =-5;
      STAWG64D    =-5;
      STAWG64M    =-5;
      STAWG64Y    =-5;
      STOWG64D    =-5;
      STOWG64M    =-5;
      STOWG64Y    =-5;
      YNWKG641    =-5;
      YNWKG64C    =-5;
      WKLKG641    =-5;
      WKLKG642    =-5;
      STAWG71D    =-5;
      STAWG71M    =-5;
      STAWG71Y    =-5;
      STOWG71D    =-5;
      STOWG71M    =-5;
      STOWG71Y    =-5;
      YNWKG711    =-5;
      YNWKG71C    =-5;
      WKLKG711    =-5;
      WKLKG712    =-5;
      STAWG72D    =-5;
      STAWG72M    =-5;
      STAWG72Y    =-5;
      STOWG72D    =-5;
      STOWG72M    =-5;
      STOWG72Y    =-5;
      YNWKG721    =-5;
      YNWKG72C    =-5;
      WKLKG721    =-5;
      WKLKG722    =-5;
      STAWG73D    =-5;
      STAWG73M    =-5;
      STAWG73Y    =-5;
      STOWG73D    =-5;
      STOWG73M    =-5;
      STOWG73Y    =-5;
      YNWKG731    =-5;
      YNWKG73C    =-5;
      WKLKG731    =-5;
      WKLKG732    =-5;
      STAWG74D    =-5;
      STAWG74M    =-5;
      STAWG74Y    =-5;
      STOWG74D    =-5;
      STOWG74M    =-5;
      STOWG74Y    =-5;
      YNWKG741    =-5;
      YNWKG74C    =-5;
      WKLKG741    =-5;
      WKLKG742    =-5;
      STAWG81D    =-5;
      STAWG81M    =-5;
      STAWG81Y    =-5;
      STOWG81D    =-5;
      STOWG81M    =-5;
      STOWG81Y    =-5;
      YNWKG811    =-5;
      YNWKG81C    =-5;
      WKLKG811    =-5;
      WKLKG812    =-5;
      STAWG82D    =-5;
      STAWG82M    =-5;
      STAWG82Y    =-5;
      STOWG82D    =-5;
      STOWG82M    =-5;
      STOWG82Y    =-5;
      YNWKG821    =-5;
      YNWKG82C    =-5;
      WKLKG821    =-5;
      WKLKG822    =-5;
      STAWG83D    =-5;
      STAWG83M    =-5;
      STAWG83Y    =-5;
      STOWG83D    =-5;
      STOWG83M    =-5;
      STOWG83Y    =-5;
      YNWKG831    =-5;
      YNWKG83C    =-5;
      WKLKG831    =-5;
      WKLKG832    =-5;
      STAWG84D    =-5;
      STAWG84M    =-5;
      STAWG84Y    =-5;
      STOWG84D    =-5;
      STOWG84M    =-5;
      STOWG84Y    =-5;
      YNWKG841    =-5;
      YNWKG84C    =-5;
      WKLKG841    =-5;
      WKLKG842    =-5;
      STAWG91D    =-5;
      STAWG91M    =-5;
      STAWG91Y    =-5;
      STOWG91D    =-5;
      STOWG91M    =-5;
      STOWG91Y    =-5;
      YNWKG911    =-5;
      YNWKG91C    =-5;
      WKLKG911    =-5;
      WKLKG912    =-5;
      STAWG92D    =-5;
      STAWG92M    =-5;
      STAWG92Y    =-5;
      STOWG92D    =-5;
      STOWG92M    =-5;
      STOWG92Y    =-5;
      YNWKG921    =-5;
      YNWKG92C    =-5;
      WKLKG921    =-5;
      WKLKG922    =-5;
      STAWG93D    =-5;
      STAWG93M    =-5;
      STAWG93Y    =-5;
      STOWG93D    =-5;
      STOWG93M    =-5;
      STOWG93Y    =-5;
      YNWKG931    =-5;
      YNWKG93C    =-5;
      WKLKG931    =-5;
      WKLKG932    =-5;
      STAWG94D    =-5;
      STAWG94M    =-5;
      STAWG94Y    =-5;
      STOWG94D    =-5;
      STOWG94M    =-5;
      STOWG94Y    =-5;
      YNWKG941    =-5;
      YNWKG94C    =-5;
      WKLKG941    =-5;
      WKLKG942    =-5;
      STAWG101D   =-5;
      STAWG101M   =-5;
      STAWG101Y   =-5;
      STOWG101D   =-5;
      STOWG101M   =-5;
      STOWG101Y   =-5;
      YNWKG1011   =-5;
      YNWKG101C   =-5;
      WKLKG1011   =-5;
      WKLKG1012   =-5;
      STAWG102D   =-5;
      STAWG102M   =-5;
      STAWG102Y   =-5;
      STOWG102D   =-5;
      STOWG102M   =-5;
      STOWG102Y   =-5;
      YNWKG1021   =-5;
      YNWKG102C   =-5;
      WKLKG1021   =-5;
      WKLKG1022   =-5;
      STAWG103D   =-5;
      STAWG103M   =-5;
      STAWG103Y   =-5;
      STOWG103D   =-5;
      STOWG103M   =-5;
      STOWG103Y   =-5;
      YNWKG1031   =-5;
      YNWKG103C   =-5;
      WKLKG1031   =-5;
      WKLKG1032   =-5;
      STAWG104D   =-5;
      STAWG104M   =-5;
      STAWG104Y   =-5;
      STOWG104D   =-5;
      STOWG104M   =-5;
      STOWG104Y   =-5;
      YNWKG1041   =-5;
      YNWKG104C   =-5;
      WKLKG1041   =-5;
      WKLKG1042   =-5;
      STAWG111D   =-5;
      STAWG111M   =-5;
      STAWG111Y   =-5;
      STOWG111D   =-5;
      STOWG111M   =-5;
      STOWG111Y   =-5;
      YNWKG1111   =-5;
      YNWKG111C   =-5;
      WKLKG1111   =-5;
      WKLKG1112   =-5;
      STAWG112D   =-5;
      STAWG112M   =-5;
      STAWG112Y   =-5;
      STOWG112D   =-5;
      STOWG112M   =-5;
      STOWG112Y   =-5;
      YNWKG1121   =-5;
      YNWKG112C   =-5;
      WKLKG1121   =-5;
      WKLKG1122   =-5;
      STAWG113D   =-5;
      STAWG113M   =-5;
      STAWG113Y   =-5;
      STOWG113D   =-5;
      STOWG113M   =-5;
      STOWG113Y   =-5;
      YNWKG1131   =-5;
      YNWKG113C   =-5;
      WKLKG1131   =-5;
      WKLKG1132   =-5;
      STAWG114D   =-5;
      STAWG114M   =-5;
      STAWG114Y   =-5;
      STOWG114D   =-5;
      STOWG114M   =-5;
      STOWG114Y   =-5;
      YNWKG1141   =-5;
      YNWKG114C   =-5;
      WKLKG1141   =-5;
      WKLKG1142   =-5;
      STAWG121D   =-5;
      STAWG121M   =-5;
      STAWG121Y   =-5;
      STOWG121D   =-5;
      STOWG121M   =-5;
      STOWG121Y   =-5;
      YNWKG1211   =-5;
      YNWKG121C   =-5;
      WKLKG1211   =-5;
      WKLKG1212   =-5;
      STAWG122D   =-5;
      STAWG122M   =-5;
      STAWG122Y   =-5;
      STOWG122D   =-5;
      STOWG122M   =-5;
      STOWG122Y   =-5;
      YNWKG1221   =-5;
      YNWKG122C   =-5;
      WKLKG1221   =-5;
      WKLKG1222   =-5;
      STAWG123D   =-5;
      STAWG123M   =-5;
      STAWG123Y   =-5;
      STOWG123D   =-5;
      STOWG123M   =-5;
      STOWG123Y   =-5;
      YNWKG1231   =-5;
      YNWKG123C   =-5;
      WKLKG1231   =-5;
      WKLKG1232   =-5;
      STAWG124D   =-5;
      STAWG124M   =-5;
      STAWG124Y   =-5;
      STOWG124D   =-5;
      STOWG124M   =-5;
      STOWG124Y   =-5;
      YNWKG1241   =-5;
      YNWKG124C   =-5;
      WKLKG1241   =-5;
      WKLKG1242   =-5;
      STAWG131D   =-5;
      STAWG131M   =-5;
      STAWG131Y   =-5;
      STOWG131D   =-5;
      STOWG131M   =-5;
      STOWG131Y   =-5;
      YNWKG1311   =-5;
      YNWKG131C   =-5;
      WKLKG1311   =-5;
      WKLKG1312   =-5;
      STAWG132D   =-5;
      STAWG132M   =-5;
      STAWG132Y   =-5;
      STOWG132D   =-5;
      STOWG132M   =-5;
      STOWG132Y   =-5;
      YNWKG1321   =-5;
      YNWKG132C   =-5;
      WKLKG1321   =-5;
      WKLKG1322   =-5;
      STAWG133D   =-5;
      STAWG133M   =-5;
      STAWG133Y   =-5;
      STOWG133D   =-5;
      STOWG133M   =-5;
      STOWG133Y   =-5;
      YNWKG1331   =-5;
      YNWKG133C   =-5;
      WKLKG1331   =-5;
      WKLKG1332   =-5;
      STAWG134D   =-5;
      STAWG134M   =-5;
      STAWG134Y   =-5;
      STOWG134D   =-5;
      STOWG134M   =-5;
      STOWG134Y   =-5;
      YNWKG1341   =-5;
      YNWKG134C   =-5;
      WKLKG1341   =-5;
      WKLKG1342   =-5;
      STAWG141D   =-5;
      STAWG141M   =-5;
      STAWG141Y   =-5;
      STOWG141D   =-5;
      STOWG141M   =-5;
      STOWG141Y   =-5;
      YNWKG1411   =-5;
      YNWKG141C   =-5;
      WKLKG1411   =-5;
      WKLKG1412   =-5;
      STAWG142D   =-5;
      STAWG142M   =-5;
      STAWG142Y   =-5;
      STOWG142D   =-5;
      STOWG142M   =-5;
      STOWG142Y   =-5;
      YNWKG1421   =-5;
      YNWKG142C   =-5;
      WKLKG1421   =-5;
      WKLKG1422   =-5;
      STAWG143D   =-5;
      STAWG143M   =-5;
      STAWG143Y   =-5;
      STOWG143D   =-5;
      STOWG143M   =-5;
      STOWG143Y   =-5;
      YNWKG1431   =-5;
      YNWKG143C   =-5;
      WKLKG1431   =-5;
      WKLKG1432   =-5;
      STAWG144D   =-5;
      STAWG144M   =-5;
      STAWG144Y   =-5;
      STOWG144D   =-5;
      STOWG144M   =-5;
      STOWG144Y   =-5;
      YNWKG1441   =-5;
      YNWKG144C   =-5;
      WKLKG1441   =-5;
      WKLKG1442   =-5;
      HRSDAYU1    =-5;
      HRSWKU1     =-5;
      HRWKUHM1    =-5;
      HRWKSEH1    =-5;
      HRSWK1      =-5;
      e_53b_1     =-5;
      e_54b_1     =-5;
      OCCSMLI1    =-5;
      COWNEW1     =-5;
      E1COWCD     =-5;
      HRSDAYU2    =-5;
      HRSWKU2     =-5;
      HRWKUHM2    =-5;
      HRWKSEH2    =-5;
      HRSWK2      =-5;
      e_53b_2     =-5;
      e_54b_2     =-5;
      OCCSMLI2    =-5;
      COWNEW2     =-5;
      E2COWCD     =-5;
      HRSDAYU3    =-5;
      HRSWKU3     =-5;
      HRWKUHM3    =-5;
      HRWKSEH3    =-5;
      HRSWK3      =-5;
      e_53b_3     =-5;
      e_54b_3     =-5;
      OCCSMLI3    =-5;
      COWNEW3     =-5;
      E3COWCD     =-5;
      HRSDAYU4    =-5;
      HRSWKU4     =-5;
      HRWKUHM4    =-5;
      HRWKSEH4    =-5;
      HRSWK4      =-5;
      e_53b_4     =-5;
      e_54b_4     =-5;
      OCCSMLI4    =-5;
      COWNEW4     =-5;
      E4COWCD     =-5;
      HRSDAYU5    =-5;
      HRSWKU5     =-5;
      HRWKUHM5    =-5;
      HRWKSEH5    =-5;
      HRSWK5      =-5;
      e_53b_5     =-5;
      e_54b_5     =-5;
      OCCSMLI5    =-5;
      COWNEW5     =-5;
      E5COWCD     =-5;
      HRSDAYU6    =-5;
      HRSWKU6     =-5;
      HRWKUHM6    =-5;
      HRWKSEH6    =-5;
      HRSWK6      =-5;
      e_53b_6     =-5;
      e_54b_6     =-5;
      OCCSMLI6    =-5;
      COWNEW6     =-5;
      E6COWCD     =-5;
      HRSDAYU7    =-5;
      HRSWKU7     =-5;
      HRWKUHM7    =-5;
      HRWKSEH7    =-5;
      HRSWK7      =-5;
      e_53b_7     =-5;
      e_54b_7     =-5;
      OCCSMLI7    =-5;
      COWNEW7     =-5;
      E7COWCD     =-5;
      HRSDAYU8    =-5;
      HRSWKU8     =-5;
      HRWKUHM8    =-5;
      HRWKSEH8    =-5;
      HRSWK8      =-5;
      e_53b_8     =-5;
      e_54b_8     =-5;
      OCCSMLI8    =-5;
      COWNEW8     =-5;
      E8COWCD     =-5;
      HRSDAYU9    =-5;
      HRSWKU9     =-5;
      HRWKUHM9    =-5;
      HRWKSEH9    =-5;
      HRSWK9      =-5;
      e_53b_9     =-5;
      e_54b_9     =-5;
      OCCSMLI9    =-5;
      COWNEW9     =-5;
      E9COWCD     =-5;
      HRSDAYU10   =-5;
      HRSWKU10    =-5;
      HRWKUHM10   =-5;
      HRWKSEH10   =-5;
      HRSWK10     =-5;
      e_53b_10    =-5;
      e_54b_10    =-5;
      OCCSMLI10   =-5;
      COWNEW10    =-5;
      E10COWCD    =-5;
      HRSDAYU11   =-5;
      HRSWKU11    =-5;
      HRWKUHM11   =-5;
      HRWKSEH11   =-5;
      HRSWK11     =-5;
      e_53b_11    =-5;
      e_54b_11    =-5;
      OCCSMLI11   =-5;
      COWNEW11    =-5;
      E11COWCD    =-5;
      HRSDAYU12   =-5;
      HRSWKU12    =-5;
      HRWKUHM12   =-5;
      HRWKSEH12   =-5;
      HRSWK12     =-5;
      e_53b_12    =-5;
      e_54b_12    =-5;
      OCCSMLI12   =-5;
      COWNEW12    =-5;
      E12COWCD    =-5;
      HRSDAYU13   =-5;
      HRSWKU13    =-5;
      HRWKUHM13   =-5;
      HRWKSEH13   =-5;
      HRSWK13     =-5;
      e_53b_13    =-5;
      e_54b_13    =-5;
      OCCSMLI13   =-5;
      COWNEW13    =-5;
      E13COWCD    =-5;
      HRSDAYU14   =-5;
      HRSWKU14    =-5;
      HRWKUHM14   =-5;
      HRWKSEH14   =-5;
      HRSWK14     =-5;
      e_53b_14    =-5;
      e_54b_14    =-5;
      OCCSMLI14   =-5;
      COWNEW14    =-5;
      E14COWCD    =-5;
      ROPTU1      =-5;
      SEYROP1     =-5;
      TADAPT1     =-5;
      TYROP1      =-5;
      TCSPAY1     =-5;
      TCSROP1     =-5;
      TCSWKS1     =-5;
      TCSHRW1     =-5;
      TCSNUM1     =-5;
      TPEROP1     =-5;
      THRSWK1     =-5;
      TAPAY11     =-5;
      TAPAY12     =-5;
      TAPAY13     =-5;
      TADWK11     =-5;
      TADWK12     =-5;
      TADWK13     =-5;
      TADHR11     =-5;
      TADHR12     =-5;
      TADHR13     =-5;
      NTMROP1     =-5;
      NTNGAP1     =-5;
      NTSRGD1     =-5;
      NTSRGM1     =-5;
      NTSRGY1     =-5;
      NTERGD1     =-5;
      NTERGM1     =-5;
      NTERGY1     =-5;
      NTSLGD1     =-5;
      NTSLGM1     =-5;
      NTSLGY1     =-5;
      NTELGD1     =-5;
      NTELGM1     =-5;
      NTELGY1     =-5;
      HRROP11     =-5;
      HRROP12     =-5;
      HRROP13     =-5;
      HRROP14     =-5;
      HRROP15     =-5;
      WKROP11     =-5;
      WKROP12     =-5;
      WKROP13     =-5;
      WKROP14     =-5;
      WKROP15     =-5;
      WKROP16     =-5;
      MOROP11     =-5;
      MOROP12     =-5;
      MOROP13     =-5;
      MOROP14     =-5;
      MOROP16     =-5;
      YRROP11     =-5;
      YRROP12     =-5;
      YRROP13     =-5;
      YRROP14     =-5;
      YRROP15     =-5;
      YRROP16     =-5;
      BWROP11     =-5;
      BWROP12     =-5;
      BWROP13     =-5;
      BWROP14     =-5;
      PAYRATE1    =-5;
      ROPTU2      =-5;
      SEYROP2     =-5;
      TADAPT2     =-5;
      TYROP2      =-5;
      TCSPAY2     =-5;
      TCSROP2     =-5;
      TCSWKS2     =-5;
      TCSHRW2     =-5;
      TCSNUM2     =-5;
      TPEROP2     =-5;
      THRSWK2     =-5;
      TAPAY21     =-5;
      TAPAY22     =-5;
      TAPAY23     =-5;
      TADWK21     =-5;
      TADWK22     =-5;
      TADWK23     =-5;
      TADHR21     =-5;
      TADHR22     =-5;
      TADHR23     =-5;
      NTMROP2     =-5;
      NTNGAP2     =-5;
      NTSRGD2     =-5;
      NTSRGM2     =-5;
      NTSRGY2     =-5;
      NTERGD2     =-5;
      NTERGM2     =-5;
      NTERGY2     =-5;
      NTSLGD2     =-5;
      NTSLGM2     =-5;
      NTSLGY2     =-5;
      NTELGD2     =-5;
      NTELGM2     =-5;
      NTELGY2     =-5;
      HRROP21     =-5;
      HRROP22     =-5;
      HRROP23     =-5;
      HRROP24     =-5;
      HRROP25     =-5;
      WKROP21     =-5;
      WKROP22     =-5;
      WKROP23     =-5;
      WKROP24     =-5;
      WKROP25     =-5;
      WKROP26     =-5;
      MOROP21     =-5;
      MOROP22     =-5;
      MOROP23     =-5;
      MOROP24     =-5;
      MOROP26     =-5;
      YRROP21     =-5;
      YRROP22     =-5;
      YRROP23     =-5;
      YRROP24     =-5;
      YRROP25     =-5;
      YRROP26     =-5;
      BWROP21     =-5;
      BWROP22     =-5;
      BWROP23     =-5;
      BWROP24     =-5;
      PAYRATE2    =-5;
      ROPTU3      =-5;
      SEYROP3     =-5;
      TADAPT3     =-5;
      TYROP3      =-5;
      TCSPAY3     =-5;
      TCSROP3     =-5;
      TCSWKS3     =-5;
      TCSHRW3     =-5;
      TCSNUM3     =-5;
      TPEROP3     =-5;
      THRSWK3     =-5;
      TAPAY31     =-5;
      TAPAY32     =-5;
      TAPAY33     =-5;
      TADWK31     =-5;
      TADWK32     =-5;
      TADWK33     =-5;
      TADHR31     =-5;
      TADHR32     =-5;
      TADHR33     =-5;
      NTMROP3     =-5;
      NTNGAP3     =-5;
      NTSRGD3     =-5;
      NTSRGM3     =-5;
      NTSRGY3     =-5;
      NTERGD3     =-5;
      NTERGM3     =-5;
      NTERGY3     =-5;
      NTSLGD3     =-5;
      NTSLGM3     =-5;
      NTSLGY3     =-5;
      NTELGD3     =-5;
      NTELGM3     =-5;
      NTELGY3     =-5;
      HRROP31     =-5;
      HRROP32     =-5;
      HRROP33     =-5;
      HRROP34     =-5;
      HRROP35     =-5;
      WKROP31     =-5;
      WKROP32     =-5;
      WKROP33     =-5;
      WKROP34     =-5;
      WKROP35     =-5;
      WKROP36     =-5;
      MOROP31     =-5;
      MOROP32     =-5;
      MOROP33     =-5;
      MOROP34     =-5;
      MOROP36     =-5;
      YRROP31     =-5;
      YRROP32     =-5;
      YRROP33     =-5;
      YRROP34     =-5;
      YRROP35     =-5;
      YRROP36     =-5;
      BWROP31     =-5;
      BWROP32     =-5;
      BWROP33     =-5;
      BWROP34     =-5;
      PAYRATE3    =-5;
      ROPTU4      =-5;
      SEYROP4     =-5;
      TADAPT4     =-5;
      TYROP4      =-5;
      TCSPAY4     =-5;
      TCSROP4     =-5;
      TCSWKS4     =-5;
      TCSHRW4     =-5;
      TCSNUM4     =-5;
      TPEROP4     =-5;
      THRSWK4     =-5;
      TAPAY41     =-5;
      TAPAY42     =-5;
      TAPAY43     =-5;
      TADWK41     =-5;
      TADWK42     =-5;
      TADWK43     =-5;
      TADHR41     =-5;
      TADHR42     =-5;
      TADHR43     =-5;
      NTMROP4     =-5;
      NTNGAP4     =-5;
      NTSRGD4     =-5;
      NTSRGM4     =-5;
      NTSRGY4     =-5;
      NTERGD4     =-5;
      NTERGM4     =-5;
      NTERGY4     =-5;
      NTSLGD4     =-5;
      NTSLGM4     =-5;
      NTSLGY4     =-5;
      NTELGD4     =-5;
      NTELGM4     =-5;
      NTELGY4     =-5;
      HRROP41     =-5;
      HRROP42     =-5;
      HRROP43     =-5;
      HRROP44     =-5;
      HRROP45     =-5;
      WKROP41     =-5;
      WKROP42     =-5;
      WKROP43     =-5;
      WKROP44     =-5;
      WKROP45     =-5;
      WKROP46     =-5;
      MOROP41     =-5;
      MOROP42     =-5;
      MOROP43     =-5;
      MOROP44     =-5;
      MOROP46     =-5;
      YRROP41     =-5;
      YRROP42     =-5;
      YRROP43     =-5;
      YRROP44     =-5;
      YRROP45     =-5;
      YRROP46     =-5;
      BWROP41     =-5;
      BWROP42     =-5;
      BWROP43     =-5;
      BWROP44     =-5;
      PAYRATE4    =-5;
      ROPTU5      =-5;
      SEYROP5     =-5;
      TADAPT5     =-5;
      TYROP5      =-5;
      TCSPAY5     =-5;
      TCSROP5     =-5;
      TCSWKS5     =-5;
      TCSHRW5     =-5;
      TCSNUM5     =-5;
      TPEROP5     =-5;
      THRSWK5     =-5;
      TAPAY51     =-5;
      TAPAY52     =-5;
      TAPAY53     =-5;
      TADWK51     =-5;
      TADWK52     =-5;
      TADWK53     =-5;
      TADHR51     =-5;
      TADHR52     =-5;
      TADHR53     =-5;
      NTMROP5     =-5;
      NTNGAP5     =-5;
      NTSRGD5     =-5;
      NTSRGM5     =-5;
      NTSRGY5     =-5;
      NTERGD5     =-5;
      NTERGM5     =-5;
      NTERGY5     =-5;
      NTSLGD5     =-5;
      NTSLGM5     =-5;
      NTSLGY5     =-5;
      NTELGD5     =-5;
      NTELGM5     =-5;
      NTELGY5     =-5;
      HRROP51     =-5;
      HRROP52     =-5;
      HRROP53     =-5;
      HRROP54     =-5;
      HRROP55     =-5;
      WKROP51     =-5;
      WKROP52     =-5;
      WKROP53     =-5;
      WKROP54     =-5;
      WKROP55     =-5;
      WKROP56     =-5;
      MOROP51     =-5;
      MOROP52     =-5;
      MOROP53     =-5;
      MOROP54     =-5;
      MOROP56     =-5;
      YRROP51     =-5;
      YRROP52     =-5;
      YRROP53     =-5;
      YRROP54     =-5;
      YRROP55     =-5;
      YRROP56     =-5;
      BWROP51     =-5;
      BWROP52     =-5;
      BWROP53     =-5;
      BWROP54     =-5;
      PAYRATE5    =-5;
      ROPTU6      =-5;
      SEYROP6     =-5;
      TADAPT6     =-5;
      TYROP6      =-5;
      TCSPAY6     =-5;
      TCSROP6     =-5;
      TCSWKS6     =-5;
      TCSHRW6     =-5;
      TCSNUM6     =-5;
      TPEROP6     =-5;
      THRSWK6     =-5;
      TAPAY61     =-5;
      TAPAY62     =-5;
      TAPAY63     =-5;
      TADWK61     =-5;
      TADWK62     =-5;
      TADWK63     =-5;
      TADHR61     =-5;
      TADHR62     =-5;
      TADHR63     =-5;
      NTMROP6     =-5;
      NTNGAP6     =-5;
      NTSRGD6     =-5;
      NTSRGM6     =-5;
      NTSRGY6     =-5;
      NTERGD6     =-5;
      NTERGM6     =-5;
      NTERGY6     =-5;
      NTSLGD6     =-5;
      NTSLGM6     =-5;
      NTSLGY6     =-5;
      NTELGD6     =-5;
      NTELGM6     =-5;
      NTELGY6     =-5;
      HRROP61     =-5;
      HRROP62     =-5;
      HRROP63     =-5;
      HRROP64     =-5;
      HRROP65     =-5;
      WKROP61     =-5;
      WKROP62     =-5;
      WKROP63     =-5;
      WKROP64     =-5;
      WKROP65     =-5;
      WKROP66     =-5;
      MOROP61     =-5;
      MOROP62     =-5;
      MOROP63     =-5;
      MOROP64     =-5;
      MOROP66     =-5;
      YRROP61     =-5;
      YRROP62     =-5;
      YRROP63     =-5;
      YRROP64     =-5;
      YRROP65     =-5;
      YRROP66     =-5;
      BWROP61     =-5;
      BWROP62     =-5;
      BWROP63     =-5;
      BWROP64     =-5;
      PAYRATE6    =-5;
      ROPTU7      =-5;
      SEYROP7     =-5;
      TADAPT7     =-5;
      TYROP7      =-5;
      TCSPAY7     =-5;
      TCSROP7     =-5;
      TCSWKS7     =-5;
      TCSHRW7     =-5;
      TCSNUM7     =-5;
      TPEROP7     =-5;
      THRSWK7     =-5;
      TAPAY71     =-5;
      TAPAY72     =-5;
      TAPAY73     =-5;
      TADWK71     =-5;
      TADWK72     =-5;
      TADWK73     =-5;
      TADHR71     =-5;
      TADHR72     =-5;
      TADHR73     =-5;
      NTMROP7     =-5;
      NTNGAP7     =-5;
      NTSRGD7     =-5;
      NTSRGM7     =-5;
      NTSRGY7     =-5;
      NTERGD7     =-5;
      NTERGM7     =-5;
      NTERGY7     =-5;
      NTSLGD7     =-5;
      NTSLGM7     =-5;
      NTSLGY7     =-5;
      NTELGD7     =-5;
      NTELGM7     =-5;
      NTELGY7     =-5;
      HRROP71     =-5;
      HRROP72     =-5;
      HRROP73     =-5;
      HRROP74     =-5;
      HRROP75     =-5;
      WKROP71     =-5;
      WKROP72     =-5;
      WKROP73     =-5;
      WKROP74     =-5;
      WKROP75     =-5;
      WKROP76     =-5;
      MOROP71     =-5;
      MOROP72     =-5;
      MOROP73     =-5;
      MOROP74     =-5;
      MOROP76     =-5;
      YRROP71     =-5;
      YRROP72     =-5;
      YRROP73     =-5;
      YRROP74     =-5;
      YRROP75     =-5;
      YRROP76     =-5;
      BWROP71     =-5;
      BWROP72     =-5;
      BWROP73     =-5;
      BWROP74     =-5;
      PAYRATE7    =-5;
      ROPTU8      =-5;
      SEYROP8     =-5;
      TADAPT8     =-5;
      TYROP8      =-5;
      TCSPAY8     =-5;
      TCSROP8     =-5;
      TCSWKS8     =-5;
      TCSHRW8     =-5;
      TCSNUM8     =-5;
      TPEROP8     =-5;
      THRSWK8     =-5;
      TAPAY81     =-5;
      TAPAY82     =-5;
      TAPAY83     =-5;
      TADWK81     =-5;
      TADWK82     =-5;
      TADWK83     =-5;
      TADHR81     =-5;
      TADHR82     =-5;
      TADHR83     =-5;
      NTMROP8     =-5;
      NTNGAP8     =-5;
      NTSRGD8     =-5;
      NTSRGM8     =-5;
      NTSRGY8     =-5;
      NTERGD8     =-5;
      NTERGM8     =-5;
      NTERGY8     =-5;
      NTSLGD8     =-5;
      NTSLGM8     =-5;
      NTSLGY8     =-5;
      NTELGD8     =-5;
      NTELGM8     =-5;
      NTELGY8     =-5;
      HRROP81     =-5;
      HRROP82     =-5;
      HRROP83     =-5;
      HRROP84     =-5;
      HRROP85     =-5;
      WKROP81     =-5;
      WKROP82     =-5;
      WKROP83     =-5;
      WKROP84     =-5;
      WKROP85     =-5;
      WKROP86     =-5;
      MOROP81     =-5;
      MOROP82     =-5;
      MOROP83     =-5;
      MOROP84     =-5;
      MOROP86     =-5;
      YRROP81     =-5;
      YRROP82     =-5;
      YRROP83     =-5;
      YRROP84     =-5;
      YRROP85     =-5;
      YRROP86     =-5;
      BWROP81     =-5;
      BWROP82     =-5;
      BWROP83     =-5;
      BWROP84     =-5;
      PAYRATE8    =-5;
      ROPTU9      =-5;
      SEYROP9     =-5;
      TADAPT9     =-5;
      TYROP9      =-5;
      TCSPAY9     =-5;
      TCSROP9     =-5;
      TCSWKS9     =-5;
      TCSHRW9     =-5;
      TCSNUM9     =-5;
      TPEROP9     =-5;
      THRSWK9     =-5;
      TAPAY91     =-5;
      TAPAY92     =-5;
      TAPAY93     =-5;
      TADWK91     =-5;
      TADWK92     =-5;
      TADWK93     =-5;
      TADHR91     =-5;
      TADHR92     =-5;
      TADHR93     =-5;
      NTMROP9     =-5;
      NTNGAP9     =-5;
      NTSRGD9     =-5;
      NTSRGM9     =-5;
      NTSRGY9     =-5;
      NTERGD9     =-5;
      NTERGM9     =-5;
      NTERGY9     =-5;
      NTSLGD9     =-5;
      NTSLGM9     =-5;
      NTSLGY9     =-5;
      NTELGD9     =-5;
      NTELGM9     =-5;
      NTELGY9     =-5;
      HRROP91     =-5;
      HRROP92     =-5;
      HRROP93     =-5;
      HRROP94     =-5;
      HRROP95     =-5;
      WKROP91     =-5;
      WKROP92     =-5;
      WKROP93     =-5;
      WKROP94     =-5;
      WKROP95     =-5;
      WKROP96     =-5;
      MOROP91     =-5;
      MOROP92     =-5;
      MOROP93     =-5;
      MOROP94     =-5;
      MOROP96     =-5;
      YRROP91     =-5;
      YRROP92     =-5;
      YRROP93     =-5;
      YRROP94     =-5;
      YRROP95     =-5;
      YRROP96     =-5;
      BWROP91     =-5;
      BWROP92     =-5;
      BWROP93     =-5;
      BWROP94     =-5;
      PAYRATE9    =-5;
      ROPTU10     =-5;
      SEYROP10    =-5;
      TADAPT10    =-5;
      TYROP10     =-5;
      TCSPAY10    =-5;
      TCSROP10    =-5;
      TCSWKS10    =-5;
      TCSHRW10    =-5;
      TCSNUM10    =-5;
      TPEROP10    =-5;
      THRSWK10    =-5;
      TAPAY101    =-5;
      TAPAY102    =-5;
      TAPAY103    =-5;
      TADWK101    =-5;
      TADWK102    =-5;
      TADWK103    =-5;
      TADHR101    =-5;
      TADHR102    =-5;
      TADHR103    =-5;
      NTMROP10    =-5;
      NTNGAP10    =-5;
      NTSRGD10    =-5;
      NTSRGM10    =-5;
      NTSRGY10    =-5;
      NTERGD10    =-5;
      NTERGM10    =-5;
      NTERGY10    =-5;
      NTSLGD10    =-5;
      NTSLGM10    =-5;
      NTSLGY10    =-5;
      NTELGD10    =-5;
      NTELGM10    =-5;
      NTELGY10    =-5;
      HRROP101    =-5;
      HRROP102    =-5;
      HRROP103    =-5;
      HRROP104    =-5;
      HRROP105    =-5;
      WKROP101    =-5;
      WKROP102    =-5;
      WKROP103    =-5;
      WKROP104    =-5;
      WKROP105    =-5;
      WKROP106    =-5;
      MOROP101    =-5;
      MOROP102    =-5;
      MOROP103    =-5;
      MOROP104    =-5;
      MOROP106    =-5;
      YRROP101    =-5;
      YRROP102    =-5;
      YRROP103    =-5;
      YRROP104    =-5;
      YRROP105    =-5;
      YRROP106    =-5;
      BWROP101    =-5;
      BWROP102    =-5;
      BWROP103    =-5;
      BWROP104    =-5;
      PAYRATE10   =-5;
      ROPTU11     =-5;
      SEYROP11    =-5;
      TADAPT11    =-5;
      TYROP11     =-5;
      TCSPAY11    =-5;
      TCSROP11    =-5;
      TCSWKS11    =-5;
      TCSHRW11    =-5;
      TCSNUM11    =-5;
      TPEROP11    =-5;
      THRSWK11    =-5;
      TAPAY111    =-5;
      TAPAY112    =-5;
      TAPAY113    =-5;
      TADWK111    =-5;
      TADWK112    =-5;
      TADWK113    =-5;
      TADHR111    =-5;
      TADHR112    =-5;
      TADHR113    =-5;
      NTMROP11    =-5;
      NTNGAP11    =-5;
      NTSRGD11    =-5;
      NTSRGM11    =-5;
      NTSRGY11    =-5;
      NTERGD11    =-5;
      NTERGM11    =-5;
      NTERGY11    =-5;
      NTSLGD11    =-5;
      NTSLGM11    =-5;
      NTSLGY11    =-5;
      NTELGD11    =-5;
      NTELGM11    =-5;
      NTELGY11    =-5;
      HRROP111    =-5;
      HRROP112    =-5;
      HRROP113    =-5;
      HRROP114    =-5;
      HRROP115    =-5;
      WKROP111    =-5;
      WKROP112    =-5;
      WKROP113    =-5;
      WKROP114    =-5;
      WKROP115    =-5;
      WKROP116    =-5;
      MOROP111    =-5;
      MOROP112    =-5;
      MOROP113    =-5;
      MOROP114    =-5;
      MOROP116    =-5;
      YRROP111    =-5;
      YRROP112    =-5;
      YRROP113    =-5;
      YRROP114    =-5;
      YRROP115    =-5;
      YRROP116    =-5;
      BWROP111    =-5;
      BWROP112    =-5;
      BWROP113    =-5;
      BWROP114    =-5;
      PAYRATE11   =-5;
      ROPTU12     =-5;
      SEYROP12    =-5;
      TADAPT12    =-5;
      TYROP12     =-5;
      TCSPAY12    =-5;
      TCSROP12    =-5;
      TCSWKS12    =-5;
      TCSHRW12    =-5;
      TCSNUM12    =-5;
      TPEROP12    =-5;
      THRSWK12    =-5;
      TAPAY121    =-5;
      TAPAY122    =-5;
      TAPAY123    =-5;
      TADWK121    =-5;
      TADWK122    =-5;
      TADWK123    =-5;
      TADHR121    =-5;
      TADHR122    =-5;
      TADHR123    =-5;
      NTMROP12    =-5;
      NTNGAP12    =-5;
      NTSRGD12    =-5;
      NTSRGM12    =-5;
      NTSRGY12    =-5;
      NTERGD12    =-5;
      NTERGM12    =-5;
      NTERGY12    =-5;
      NTSLGD12    =-5;
      NTSLGM12    =-5;
      NTSLGY12    =-5;
      NTELGD12    =-5;
      NTELGM12    =-5;
      NTELGY12    =-5;
      HRROP121    =-5;
      HRROP122    =-5;
      HRROP123    =-5;
      HRROP124    =-5;
      HRROP125    =-5;
      WKROP121    =-5;
      WKROP122    =-5;
      WKROP123    =-5;
      WKROP124    =-5;
      WKROP125    =-5;
      WKROP126    =-5;
      MOROP121    =-5;
      MOROP122    =-5;
      MOROP123    =-5;
      MOROP124    =-5;
      MOROP126    =-5;
      YRROP121    =-5;
      YRROP122    =-5;
      YRROP123    =-5;
      YRROP124    =-5;
      YRROP125    =-5;
      YRROP126    =-5;
      BWROP121    =-5;
      BWROP122    =-5;
      BWROP123    =-5;
      BWROP124    =-5;
      PAYRATE12   =-5;
      ROPTU13     =-5;
      SEYROP13    =-5;
      TADAPT13    =-5;
      TYROP13     =-5;
      TCSPAY13    =-5;
      TCSROP13    =-5;
      TCSWKS13    =-5;
      TCSHRW13    =-5;
      TCSNUM13    =-5;
      TPEROP13    =-5;
      THRSWK13    =-5;
      TAPAY131    =-5;
      TAPAY132    =-5;
      TAPAY133    =-5;
      TADWK131    =-5;
      TADWK132    =-5;
      TADWK133    =-5;
      TADHR131    =-5;
      TADHR132    =-5;
      TADHR133    =-5;
      NTMROP13    =-5;
      NTNGAP13    =-5;
      NTSRGD13    =-5;
      NTSRGM13    =-5;
      NTSRGY13    =-5;
      NTERGD13    =-5;
      NTERGM13    =-5;
      NTERGY13    =-5;
      NTSLGD13    =-5;
      NTSLGM13    =-5;
      NTSLGY13    =-5;
      NTELGD13    =-5;
      NTELGM13    =-5;
      NTELGY13    =-5;
      HRROP131    =-5;
      HRROP132    =-5;
      HRROP133    =-5;
      HRROP134    =-5;
      HRROP135    =-5;
      WKROP131    =-5;
      WKROP132    =-5;
      WKROP133    =-5;
      WKROP134    =-5;
      WKROP135    =-5;
      WKROP136    =-5;
      MOROP131    =-5;
      MOROP132    =-5;
      MOROP133    =-5;
      MOROP134    =-5;
      MOROP136    =-5;
      YRROP131    =-5;
      YRROP132    =-5;
      YRROP133    =-5;
      YRROP134    =-5;
      YRROP135    =-5;
      YRROP136    =-5;
      BWROP131    =-5;
      BWROP132    =-5;
      BWROP133    =-5;
      BWROP134    =-5;
      PAYRATE13   =-5;
      ROPTU14     =-5;
      SEYROP14    =-5;
      TADAPT14    =-5;
      TYROP14     =-5;
      TCSPAY14    =-5;
      TCSROP14    =-5;
      TCSWKS14    =-5;
      TCSHRW14    =-5;
      TCSNUM14    =-5;
      TPEROP14    =-5;
      THRSWK14    =-5;
      TAPAY141    =-5;
      TAPAY142    =-5;
      TAPAY143    =-5;
      TADWK141    =-5;
      TADWK142    =-5;
      TADWK143    =-5;
      TADHR141    =-5;
      TADHR142    =-5;
      TADHR143    =-5;
      NTMROP14    =-5;
      NTNGAP14    =-5;
      NTSRGD14    =-5;
      NTSRGM14    =-5;
      NTSRGY14    =-5;
      NTERGD14    =-5;
      NTERGM14    =-5;
      NTERGY14    =-5;
      NTSLGD14    =-5;
      NTSLGM14    =-5;
      NTSLGY14    =-5;
      NTELGD14    =-5;
      NTELGM14    =-5;
      NTELGY14    =-5;
      HRROP141    =-5;
      HRROP142    =-5;
      HRROP143    =-5;
      HRROP144    =-5;
      HRROP145    =-5;
      WKROP141    =-5;
      WKROP142    =-5;
      WKROP143    =-5;
      WKROP144    =-5;
      WKROP145    =-5;
      WKROP146    =-5;
      MOROP141    =-5;
      MOROP142    =-5;
      MOROP143    =-5;
      MOROP144    =-5;
      MOROP146    =-5;
      YRROP141    =-5;
      YRROP142    =-5;
      YRROP143    =-5;
      YRROP144    =-5;
      YRROP145    =-5;
      YRROP146    =-5;
      BWROP141    =-5;
      BWROP142    =-5;
      BWROP143    =-5;
      BWROP144    =-5;
      PAYRATE14   =-5;
      UNIONJB1    =-5;
      UNIONJB2    =-5;
      UNIONJB3    =-5;
      UNIONJB4    =-5;
      UNIONJB5    =-5;
      UNIONJB6    =-5;
      UNIONJB7    =-5;
      UNIONJB8    =-5;
      UNIONJB9    =-5;
      UNIONJB10   =-5;
      UNIONJB11   =-5;
      UNIONJB12   =-5;
      UNIONJB13   =-5;
      UNIONJB14   =-5;
      TEACH1      =-5;
      TEACH2      =-5;
      TEACH3      =-5;
      TEACH4      =-5;
      TEACH5      =-5;
      TEACH6      =-5;
      TEACH7      =-5;
      TEACH8      =-5;
      TEACH9      =-5;
      TEACH10     =-5;
      TEACH11     =-5;
      TEACH12     =-5;
      TEACH13     =-5;
      TEACH14     =-5;
      TREGSC1     =-5;
      TREGSC2     =-5;
      TREGSC3     =-5;
      TREGSC4     =-5;
      TREGSC5     =-5;
      TREGSC6     =-5;
      TREGSC7     =-5;
      TREGSC8     =-5;
      TREGSC9     =-5;
      TREGSC10    =-5;
      TREGSC11    =-5;
      TREGSC12    =-5;
      TREGSC13    =-5;
      TREGSC14    =-5;
      PREVID1     =-5;
      PREVID2     =-5;
      PREVID3     =-5;
      PREVID4     =-5;
      PREVID5     =-5;
      PREVID6     =-5;
      PREVID7     =-5;
      PREVID8     =-5;
      PREVID9     =-5;
      PREVID10    =-5;
      PREVID11    =-5;
      PREVID12    =-5;
      PREVID13    =-5;
      PREVID14    =-5;
      JOBTYP1     =-5;
      JOBTYP2     =-5;
      JOBTYP3     =-5;
      JOBTYP4     =-5;
      JOBTYP5     =-5;
      JOBTYP6     =-5;
      JOBTYP7     =-5;
      JOBTYP8     =-5;
      JOBTYP9     =-5;
      JOBTYP10    =-5;
      JOBTYP11    =-5;
      JOBTYP12    =-5;
      JOBTYP13    =-5;
      JOBTYP14    =-5;
      milact      =-5;
      omilcode    =-5;
      INT_D       =-5;
      INT_M       =-5;
      INT_Y       =-5;
      LINT_D      =-5;
      LINT_M      =-5;
      LINT_Y      =-5;
      empnum1     =-5;
      empnum2     =-5;
      empnum3     =-5;
      empnum4     =-5;
      empnum5     =-5;
      empnum6     =-5;
      empnum7     =-5;
      empnum8     =-5;
      empnum9     =-5;
      empnum10    =-5;
      empnum11    =-5;
      empnum12    =-5;
      empnum13    =-5;                      
      empnum14    =-5;                      
end;

array empnum  (i)     empnum1-empnum14;
array jobtyp  (i)     jobtyp1-jobtyp14;
array roptu   (i)     roptu1-roptu14;
array crwkemp (i)     crwkemp1-crwkemp14;
array cow     (i)     cow1-cow14;
array payrate  (i)     payrate1-payrate14;
array hrswk    (i)     hrswk1-hrswk14;
array stajoby  (i)     stajoby1-stajoby14;
array stojoby  (i)     stojoby1-stojoby14;
array check    (i)     check1-check14;
do i = 1 to 14;
    if (jobtyp = 3) then roptu = 6;
    if empnum>=1 then do;
        if jobtyp=-4 then jobtyp=-3;
        if roptu=-4 then roptu=-3;
        if payrate=-4 then payrate=-3;
        if crwkemp=-4 then crwkemp=-3;
        if hrswk=-4 then hrswk=-3;
    end;
    if empnum<1 & stajoby>-4 then check=1;
end;
if weight = 0 then do;
    indf01=-5;
    occf01=-5;
    indf02=-5;
    occf02=-5;
    indf03=-5;
    occf03=-5;
    indf04=-5;
    occf04=-5;
    indf05=-5;
    occf05=-5;
    indf06=-5;
    occf06=-5;
    indf07=-5;
    occf07=-5;
    indf08=-5;
    occf08=-5;
    indf09=-5;
    occf09=-5;
    indf10=-5;
    occf10=-5;
    MOROP15=-5;
    BWROP15=-5;
    BWROP16=-5;
    MOROP25=-5;
    BWROP25=-5;
    BWROP26=-5;
    MOROP35=-5;
    BWROP35=-5;
    BWROP36=-5;
    MOROP45=-5;
    BWROP45=-5;
    BWROP46=-5;
    MOROP55=-5;
    BWROP55=-5;
    BWROP56=-5;
    MOROP65=-5;
    BWROP65=-5;
    BWROP66=-5;
    MOROP75=-5;
    BWROP75=-5;
    BWROP76=-5;
    MOROP85=-5;
    BWROP85=-5;
    BWROP86=-5;
    MOROP95=-5;
    BWROP95=-5;
    BWROP96=-5;
    MOROP105=-5;
    BWROP105=-5;
    BWROP106=-5;
end;
else if weight > 0 then do;
    indf01=-4;
    occf01=-4;
    indf02=-4;
    occf02=-4;
    indf03=-4;
    occf03=-4;
    indf04=-4;
    occf04=-4;
    indf05=-4;
    occf05=-4;
    indf06=-4;
    occf06=-4;
    indf07=-4;
    occf07=-4;
    indf08=-4;
    occf08=-4;
    indf09=-4;
    occf09=-4;
    indf10=-4;
    occf10=-4;
    MOROP15=-4;
    BWROP15=-4;
    BWROP16=-4;
    MOROP25=-4;
    BWROP25=-4;
    BWROP26=-4;
    MOROP35=-4;
    BWROP35=-4;
    BWROP36=-4;
    MOROP45=-4;
    BWROP45=-4;
    BWROP46=-4;
    MOROP55=-4;
    BWROP55=-4;
    BWROP56=-4;
    MOROP65=-4;
    BWROP65=-4;
    BWROP66=-4;
    MOROP75=-4;
    BWROP75=-4;
    BWROP76=-4;
    MOROP85=-4;
    BWROP85=-4;
    BWROP86=-4;
    MOROP95=-4;
    BWROP95=-4;
    BWROP96=-4;
    MOROP105=-4;
    BWROP105=-4;
    BWROP106=-4;
end;

R30_IANDO_MERGEFINAL.SAS

Variable Names in program      Variable Names in data release
emp_ind_01   =                 'EMPLOYER_IND.01'n         ;
emp_ind_02   =                 'EMPLOYER_IND.02'n         ;
emp_ind_03   =                 'EMPLOYER_IND.03'n         ;
emp_ind_04   =                 'EMPLOYER_IND.04'n         ;
emp_ind_05   =                 'EMPLOYER_IND.05'n         ;
emp_ind_06   =                 'EMPLOYER_IND.06'n         ;
emp_ind_07   =                 'EMPLOYER_IND.07'n         ;
empnam1      =                 'EMPLOYER_NAME.01'n        ;
empnam2      =                 'EMPLOYER_NAME.02'n        ;
empnam3      =                 'EMPLOYER_NAME.03'n        ;
empnam4      =                 'EMPLOYER_NAME.04'n        ;
empnam5      =                 'EMPLOYER_NAME.05'n        ;
empnam6      =                 'EMPLOYER_NAME.06'n        ;
empnam7      =                 'EMPLOYER_NAME.07'n        ;
empnam8      =                 'EMPLOYER_NAME.08'n        ;
empnam9      =                 'EMPLOYER_NAME.09'n        ;
empnam10      =                'EMPLOYER_NAME.10'n        ;
empnam11      =                'EMPLOYER_NAME.11'n        ;
empnam12      =                'EMPLOYER_NAME.12'n        ;
empnam13      =                'EMPLOYER_NAME.13'n        ;
empnam14      =                'EMPLOYER_NAME.14'n        ;
emp_occ1_01  =                 'EMPLOYER_OCC1.01'n        ;
emp_occ1_02  =                 'EMPLOYER_OCC1.02'n        ;
emp_occ1_03  =                 'EMPLOYER_OCC1.03'n        ;
emp_occ1_04  =                 'EMPLOYER_OCC1.04'n        ;
emp_occ1_05  =                 'EMPLOYER_OCC1.05'n        ;
emp_occ1_06  =                 'EMPLOYER_OCC1.06'n        ;
emp_occ1_07  =                 'EMPLOYER_OCC1.07'n        ;
emp_occ2_01  =                 'EMPLOYER_OCC2.01'n        ;
emp_occ2_02  =                 'EMPLOYER_OCC2.02'n        ;
emp_occ2_03  =                 'EMPLOYER_OCC2.03'n        ;
emp_occ2_04  =                 'EMPLOYER_OCC2.04'n        ;
emp_occ2_05  =                 'EMPLOYER_OCC2.05'n        ;
emp_occ2_06  =                 'EMPLOYER_OCC2.06'n        ;
emp_occ2_07  =                 'EMPLOYER_OCC2.07'n        ;
emp_uid_01   =                 'EMPLOYER_UID.01'n         ;
emp_uid_02   =                 'EMPLOYER_UID.02'n         ;
emp_uid_03   =                 'EMPLOYER_UID.03'n         ;
emp_uid_04   =                 'EMPLOYER_UID.04'n         ;
emp_uid_05   =                 'EMPLOYER_UID.05'n         ;
emp_uid_06   =                 'EMPLOYER_UID.06'n         ;
emp_uid_07   =                 'EMPLOYER_UID.07'n         ;
emp_uid_08   =                 'EMPLOYER_UID.08'n         ;
emp_uid_09   =                 'EMPLOYER_UID.09'n         ;
emp_uid_10   =                 'EMPLOYER_UID.10'n         ;
emp_uid_11   =                 'EMPLOYER_UID.11'n         ;
emp_uid_12   =                 'EMPLOYER_UID.12'n         ;
emp_uid_13   =                 'EMPLOYER_UID.13'n         ;
emp_uid_14   =                 'EMPLOYER_UID.14'n         ;
spoccchg1    =                 'OCCSP-55C'n                 ;
spoccchg2    =                 'OCCSP-55DA'n                ;
occspr30     =                 'OCCSP-55H'n                 ;
occspr30_2   =                 'OCCSP-55H_1'n               ;
spocc1       =                 'OCCSP-55I'n                 ;
spocc2       =                 'OCCSP-55J'n                 ;
cps_hrs_chk1 =                 'QES-53A.01'n              ;
cps_hrs_chk2 =                 'QES-53A.02'n              ;
cps_hrs_chk3 =                 'QES-53A.03'n              ;
cps_hrs_chk4 =                 'QES-53A.04'n              ;
cps_hrs_chk5 =                 'QES-53A.05'n              ;
cps_hrs_chk6 =                 'QES-53A.06'n              ;
cps_hrs_chk7 =                 'QES-53A.07'n              ;
cps_hrs_chk8 =                 'QES-53A.08'n              ;
cps_hrs_chk9 =                 'QES-53A.09'n              ;
cps_hrs_chk10 =                'QES-53A.10'n              ;
cps_hrs_chk11 =                'QES-53A.11'n              ;
cps_hrs_chk12 =                'QES-53A.12'n              ;
cps_hrs_chk13 =                'QES-53A.13'n              ;
cps_hrs_chk14 =                'QES-53A.14'n              ;
cps_wks_chk1 =                 'QES-54B.01'n              ;
cps_wks_chk2 =                 'QES-54B.02'n              ;
cps_wks_chk3 =                 'QES-54B.03'n              ;
cps_wks_chk4 =                 'QES-54B.04'n              ;
cps_wks_chk5 =                 'QES-54B.05'n              ;
cps_wks_chk6 =                 'QES-54B.06'n              ;
cps_wks_chk7 =                 'QES-54B.07'n              ;
cps_wks_chk8 =                 'QES-54B.08'n              ;
cps_wks_chk9 =                 'QES-54B.09'n              ;
cps_wks_chk10=                 'QES-54B.10'n              ;
cps_wks_chk11=                 'QES-54B.11'n              ;
cps_wks_chk12=                 'QES-54B.12'n              ;
cps_wks_chk13=                 'QES-54B.13'n              ;
cps_wks_chk14=                 'QES-54B.14'n              ;
ind1         =                 'QES-55E.01'n              ;
ind2         =                 'QES-55E.02'n              ;
ind3         =                 'QES-55E.03'n              ;
ind4         =                 'QES-55E.04'n              ;
ind5         =                 'QES-55E.05'n              ;
ind6         =                 'QES-55E.06'n              ;
ind7         =                 'QES-55E.07'n              ;
ind8         =                 'QES-55E.08'n              ;
ind9         =                 'QES-55E.09'n              ;
ind10         =                'QES-55E.10'n              ;
ind11         =                'QES-55E.11'n              ;
ind14         =                'QES-55E.14'n              ;
occ11        =                 'QES-55H.01'n              ;
occ12        =                 'QES-55H.02'n              ;
occ13        =                 'QES-55H.03'n              ;
occ14        =                 'QES-55H.04'n              ;
occ15        =                 'QES-55H.05'n              ;
occ16        =                 'QES-55H.06'n              ;
occ17        =                 'QES-55H.07'n              ;
occ18        =                 'QES-55H.08'n              ;
occ19        =                 'QES-55H.09'n              ;
occ110       =                 'QES-55H.10'n              ;
occ111       =                 'QES-55H.11'n              ;
occ114       =                 'QES-55H.14'n              ;
occ21        =                 'QES-55J.01'n              ;
occ22        =                 'QES-55J.02'n              ;
occ23        =                 'QES-55J.03'n              ;
occ24        =                 'QES-55J.04'n              ;
occ25        =                 'QES-55J.05'n              ;
occ26        =                 'QES-55J.06'n              ;
occ27        =                 'QES-55J.07'n              ;
occ28        =                 'QES-55J.08'n              ;
occ29        =                 'QES-55J.09'n              ;
occ210       =                 'QES-55J.10'n              ;
occ211       =                 'QES-55J.11'n              ;
occ214       =                 'QES-55J.14'n              ;
spoc1dli     =                 'SYMBOL_SPAR_OCC1DLI'n     ;
spoc2dli     =                 'SYMBOL_SPAR_OCC2DLI'n     ;
totemp2      =                 'SYMBOL_TOTEMP'n           ;
samesp       =                 'OCCSP-0A'n           ;
newsp        =                 'OCCSP-0B'n           ;
newsp        =                 'OCCSP-0B'n           ;
div_wid      =                 'Q2-11'n           ;

r30_flag=1;
totemp = 0;
if (totemp2 > -4) then totemp = totemp2;
jobtyp1=0;
if (ind1 ~= ' ' or occ11 ~= ' ' or occ21 ~= ' ') then jobtyp1=1;
jobtyp2=0;
if (ind2 ~= ' ' or occ12 ~= ' ' or occ22 ~= ' ') then jobtyp2=2;
jobtyp3=0;
if (ind3 ~= ' ' or occ13 ~= ' ' or occ23 ~= ' ') then jobtyp3=3;
jobtyp4=0;
if (ind4 ~= ' ' or occ14 ~= ' ' or occ24 ~= ' ') then jobtyp4=4;
jobtyp5=0;
if (ind5 ~= ' ' or occ15 ~= ' ' or occ25 ~= ' ') then jobtyp5=5;
jobtyp6=0;
if (ind6 ~= ' ' or occ16 ~= ' ' or occ26 ~= ' ') then jobtyp6=6;
jobtyp7=0;
if (ind7 ~= ' ' or occ17 ~= ' ' or occ27 ~= ' ') then jobtyp7=7;
jobtyp8=0;
if (ind8 ~= ' ' or occ18 ~= ' ' or occ28 ~= ' ') then jobtyp8=8;
jobtyp9=0;
if (ind9 ~= ' ' or occ19 ~= ' ' or occ29 ~= ' ') then jobtyp9=9;
jobtyp10=0;
if (ind10 ~= ' ' or occ110 ~= ' ' or occ210 ~= ' ') then jobtyp10=10;
jobtyp11=0;
if (ind11 ~= ' ' or occ111 ~= ' ' or occ211 ~= ' ') then jobtyp11=11;
jobtyp14=0;
if (ind14 ~= ' ' or occ114 ~= ' ' or occ214 ~= ' ') then jobtyp14=14;
jobtyps=0;
if (spocc1 ~= ' ' or spocc2 ~= ' ') then jobtyps=21;

jbtyp1a=0;
if (ind1 = ' ' & occ11 = ' ' & occ21 = ' ' & empnam1 ~= ' '
   & empnam1 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp1a=1;
jbtyp2a=0;
if (ind2 = ' ' & occ12 = ' ' & occ22 = ' ' & empnam2 ~= ' '
   & empnam2 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp2a=2;
jbtyp3a=0;
if (ind3 = ' ' & occ13 = ' ' & occ23 = ' ' & empnam3 ~= ' '
   & empnam3 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp3a=3;
jbtyp4a=0;
if (ind4 = ' ' & occ14 = ' ' & occ24 = ' ' & empnam4 ~= ' '
   & empnam4 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp4a=4;
jbtyp5a=0;
if (ind5 = ' ' & occ15 = ' ' & occ25 = ' ' & empnam5 ~= ' '
   & empnam5 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp5a=5;
jbtyp6a=0;
if (ind6 = ' ' & occ16 = ' ' & occ26 = ' ' & empnam6 ~= ' '
   & empnam6 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp6a=6;
jbtyp7a=0;
if (ind7 = ' ' & occ17 = ' ' & occ27 = ' ' & empnam7 ~= ' '
   & empnam7 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp7a=7;
jbtyp8a=0;
if (ind8 = ' ' & occ18 = ' ' & occ28 = ' ' & empnam8 ~= ' '
   & empnam8 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp8a=8;
jbtyp9a=0;
if (ind9 = ' ' & occ19 = ' ' & occ29 = ' ' & empnam9 ~= ' '
   & empnam9 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp9a=9;
jbtyp10a=0;
if (ind10 = ' ' & occ110 = ' ' & occ210 = ' ' & empnam10 ~= ' '
   & empnam10 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp10a=10;
jbtyp11a=0;
if (ind11 = ' ' & occ111 = ' ' & occ211 = ' ' & empnam11 ~= ' '
   & empnam11 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp11a=11;
jbtyp14a=0;
if (ind14 = ' ' & occ114 = ' ' & occ214 = ' ' & empnam14 ~= ' '
   & empnam14 ~= 'NO EMPLOYER MATCH' & totemp > 0) then jbtyp14a=14;
jbtypsa1=0;
if (spocc1 = ' ' & spocc2 = ' ' & (spoccchg1 = 1 | spoccchg2 = 1)) then jbtypsa1=21;
jbtypsa2=0;
if (spocc1 = ' ' & spocc2 = ' ' & (occspr30 = -4 | occspr30 = 2 | occspr30 = 3)) then jbtypsa2=22;
array    indd    (i) $    ind1-ind14;
array    indc    (i)        ind_code_c1-ind_code_c14;
array    occd1    (i)    $    occ11-occ19 occ110-occ114;
array    occd2    (i)    $    occ21-occ29 occ210-occ214;
array    occc    (i)        occ_code_c1-occ_code_c14;
do i=1 to 14;
    if indd~=' ' & indc=. then indc=-3;
    if (occd1~=' ' or occd2~=' ') & occc=. then occc=-3;
end;

array     emp_uid     (i)    emp_uid_01-emp_uid_14;
array     check     (i)    check_01-check_14;
do i=1 to 14;
    if emp_uid>0 & (indc=-3|occc=-3) then check=1;
    else if emp_uid>0 & (indc=.|occc=.) then check=2;
    else if emp_uid=. & (indc>=-3|occc>=-3) then check=3;
end;
rename
 R0000100 = pubid        
 R0000110 = norcid       
 R6552700 = previd20001  
 R6552800 = previd20002  
 R6552900 = previd20003  
 R6553000 = previd20004  
 R6553100 = previd20005  
 R6963402 = lintyr2000   
 R7178900 = previd20021  
 R7179000 = previd20022  
 R7179100 = previd20023  
 R7179200 = previd20024  
 R7179300 = previd20025  
 R7656402 = lintyr2002   
 R7864600 = previd20041  
 R7864700 = previd20042  
 R7864800 = previd20043  
 R7864900 = previd20044  
 R7865000 = previd20045  
 R8423302 = lintyr2004   
 T0107100 = previd20061  
 T0107200 = previd20062  
 T0107300 = previd20063  
 T0107400 = previd20064  
 T0107500 = previd20065  
 T0967402 = lintyr2006   
 T2190602 = lintyr2008   
 T2226100 = previd20081  
 T2226200 = previd20082  
 T2226300 = previd20083  
 T2226400 = previd20084  
 T2226500 = previd20085  
 T2226600 = previd20086  
 T2226700 = previd20087  
 T2226800 = previd20088  
 T2226900 = previd20089  
 T2227000 = previd200810 
 T2227100 = previd200811 
 T3101802 = lintyr2010   
 T3187000 = previd20101  
 T3187100 = previd20102  
 T3187200 = previd20103  
 T3187300 = previd20104  
 T3187400 = previd20105  
 T3187500 = previd20106  
 T3187600 = previd20107  
 T3187700 = previd20108  
 T3187800 = previd20109  
 T3187900 = previd201010 
 T4127300 = previd20121  
 T4127400 = previd20122  
 T4127500 = previd20123  
 T4127600 = previd20124  
 T4127700 = previd20125  
 T4127800 = previd20126  
 T4127900 = previd20127  
 T4128000 = previd20128  
 T4128100 = previd20129  
 T4160502 = lintyr2012   
 T5014702 = lintyr2014   
 T5053900 = previd20141  
 T5054000 = previd20142  
 T5054100 = previd20143  
 T5054200 = previd20144  
 T5054300 = previd20145  
 T5054400 = previd20146  
 T5054500 = previd20147  
 T5790702 = lintyr2016  
 T5805600 = previd20161 
 T5805700 = previd20162 
 T5805800 = previd20163 
 T5805900 = previd20164 
 T5806000 = previd20165 
 T5806100 = previd20166 
 T5806200 = previd20167 
 T5806300 = previd20168 
 T8240402 = lintyr2018  
 T8260200 = previd20181 
 T8260300 = previd20182 
 T8260400 = previd20183 
 T8260500 = previd20184 
 T8260600 = previd20185 
 T8260700 = previd20186 
 T8260800 = previd20187 
 T8260900 = previd20188 
 T8261000 = previd20189  
 T8809302 = lintyr2020        
 T8828200 = previd20201      
 T8828300 = previd20202      
 T8828400 = previd20203      
 T8828500 = previd20204      
 T8828600 = previd20205      
 T8828700 = previd20206      
 T8828800 = previd202013      
 T9322902 = lintyr2022          
 T9355400 = previd20221    
 T9355500 = previd20222    
 T9355600 = previd20223    
 T9355700 = previd20224    
 T9355800 = previd20225    
 T9355900 = previd20226    
 T9356000 = previd20227    
 T9356100 = previd20228
 T9356200 = previd202214    
;
 pubid      /*'CASEID_1979'n*/
 norcid     /*'NORCID_1979'n*/
 ind20001   /*'INDALL-EMP.01_2000'n*/
 ind20002   /*'INDALL-EMP.02_2000'n*/
 ind20003   /*'INDALL-EMP.03_2000'n*/
 ind20004   /*'INDALL-EMP.04_2000'n*/
 ind20005   /*'INDALL-EMP.05_2000'n*/
 occ20001   /*'OCCALL-EMP.01_2000'n*/
 occ20002   /*'OCCALL-EMP.02_2000'n*/
 occ20003   /*'OCCALL-EMP.03_2000'n*/
 occ20004   /*'OCCALL-EMP.04_2000'n*/
 occ20005   /*'OCCALL-EMP.05_2000'n*/
 spocc2000   /*'OCCSP-55I_CODE_2000'n*/
 ind20021   /*'INDALL-EMP.01_2002'n*/
 ind20022   /*'INDALL-EMP.02_2002'n*/
 ind20023   /*'INDALL-EMP.03_2002'n*/
 ind20024   /*'INDALL-EMP.04_2002'n*/
 ind20025   /*'INDALL-EMP.05_2002'n*/
 occ20021   /*'OCCALL-EMP.01_2002'n*/
 occ20022   /*'OCCALL-EMP.02_2002'n*/
 occ20023   /*'OCCALL-EMP.03_2002'n*/
 occ20024   /*'OCCALL-EMP.04_2002'n*/
 occ20025   /*'OCCALL-EMP.05_2002'n*/
 spocc2002   /*'OCCSP-55I_CODE_2002'n*/
 ind20041   /*'INDALL-EMP.01_2004'n*/
 ind20042   /*'INDALL-EMP.02_2004'n*/
 ind20043   /*'INDALL-EMP.03_2004'n*/
 ind20044   /*'INDALL-EMP.04_2004'n*/
 ind20045   /*'INDALL-EMP.05_2004'n*/
 occ20041   /*'OCCALL-EMP.01_2004'n*/
 occ20042   /*'OCCALL-EMP.02_2004'n*/
 occ20043   /*'OCCALL-EMP.03_2004'n*/
 occ20044   /*'OCCALL-EMP.04_2004'n*/
 occ20045   /*'OCCALL-EMP.05_2004'n*/
 spocc2004   /*'OCCSP-55I_CODE_2004'n*/
 ind20061   /*'INDALL-EMP.01_2006'n*/
 ind20062   /*'INDALL-EMP.02_2006'n*/
 ind20063   /*'INDALL-EMP.03_2006'n*/
 ind20064   /*'INDALL-EMP.04_2006'n*/
 ind20065   /*'INDALL-EMP.05_2006'n*/
 occ20061   /*'OCCALL-EMP.01_2006'n*/
 occ20062   /*'OCCALL-EMP.02_2006'n*/
 occ20063   /*'OCCALL-EMP.03_2006'n*/
 occ20064   /*'OCCALL-EMP.04_2006'n*/
 occ20065   /*'OCCALL-EMP.05_2006'n*/
 spocc2006   /*'OCCSP-55I_CODE_2006'n*/
 ind20081   /*'INDALL-EMP.01_2008'n*/
 ind20082   /*'INDALL-EMP.02_2008'n*/
 ind20083   /*'INDALL-EMP.03_2008'n*/
 ind20084   /*'INDALL-EMP.04_2008'n*/
 ind20085   /*'INDALL-EMP.05_2008'n*/
 occ20081   /*'OCCALL-EMP.01_2008'n*/
 occ20082   /*'OCCALL-EMP.02_2008'n*/
 occ20083   /*'OCCALL-EMP.03_2008'n*/
 occ20084   /*'OCCALL-EMP.04_2008'n*/
 occ20085   /*'OCCALL-EMP.05_2008'n*/
 spocc2008   /*'OCCSP-55I_CODE_2008'n*/
 ind20101   /*'INDALL-EMP.01_2010'n*/
 ind20102   /*'INDALL-EMP.02_2010'n*/
 ind20103   /*'INDALL-EMP.03_2010'n*/
 ind20104   /*'INDALL-EMP.04_2010'n*/
 ind20105   /*'INDALL-EMP.05_2010'n*/
 occ20101   /*'OCCALL-EMP.01_2010'n*/
 occ20102   /*'OCCALL-EMP.02_2010'n*/
 occ20103   /*'OCCALL-EMP.03_2010'n*/
 occ20104   /*'OCCALL-EMP.04_2010'n*/
 occ20105   /*'OCCALL-EMP.05_2010'n*/
 spocc2010   /*'OCCSP-55I_CODE_2010'n*/
 ind20121   /*'INDALL-EMP.01_2012'n*/
 ind20122   /*'INDALL-EMP.02_2012'n*/
 ind20123   /*'INDALL-EMP.03_2012'n*/
 ind20124   /*'INDALL-EMP.04_2012'n*/
 ind20125   /*'INDALL-EMP.05_2012'n*/
 occ20121   /*'OCCALL-EMP.01_2012'n*/
 occ20122   /*'OCCALL-EMP.02_2012'n*/
 occ20123   /*'OCCALL-EMP.03_2012'n*/
 occ20124   /*'OCCALL-EMP.04_2012'n*/
 occ20125   /*'OCCALL-EMP.05_2012'n*/
 spocc2012   /*'OCCSP-55I_CODE_2012'n*/

lastint2022=0;
if (lintyr2020 > -4) then lastint2022=2020;
else if (lintyr2018 > -4) then lastint2022=2018;
else if (lintyr2016 > -4) then lastint2022=2016;
else if (lintyr2014 > -4) then lastint2022=2014;
else if (lintyr2012 > -4) then lastint2022=2012;
else if (lintyr2010 > -4) then lastint2022=2010;
else if (lintyr2008 > -4) then lastint2022=2008;
else if (lintyr2006 > -4) then lastint2022=2006;
else if (lintyr2004 > -4) then lastint2022=2004;
else if (lintyr2002 > -4) then lastint2022=2002;
else if (lintyr2000 > -4) then lastint2022=2000;
%macro att(yrb);
%do l=1 %to 14;
    %do a=1 %to 10;
        if ind_code_c&l > 0 & ind_code_c&l~=9990 then indf2022&l = ind_code_c&l;
        else if lastint2022=&yrb & previd2022&l=&a & ind&yrb&a>=-3 then indf2022&l=ind&yrb&a;
        else if indf2022&l =. & ind_code_c&l=9990 then indf2022&l =ind_code_c&l;
        if occ_code_c&l > 0 & occ_code_c&l~=9990 then occf2022&l = occ_code_c&l;
        else if lastint2022=&yrb & previd2022&l=&a & occ&yrb&a>=-3 then occf2022&l=occ&yrb&a;
        else if occf2022&l =. & occ_code_c&l=9990 then occf2022&l = occ_code_c&l;
    %end;
%end;
%mend att;
%macro rd;
   %do yrb = 2020 %to 2002 %by -2;
       %att(&yrb);
   %end; 
%mend rd;
%rd;
if ind_code_c1=. & lastint2022=2002 & previd20221>0 & indf20221>0 then indf20221=indf20221*10;
if ind_code_c2=. & lastint2022=2002 & previd20222>0 & indf20222>0 then indf20222=indf20222*10;
if ind_code_c3=. & lastint2022=2002 & previd20223>0 & indf20223>0 then indf20223=indf20223*10;
if ind_code_c4=. & lastint2022=2002 & previd20224>0 & indf20224>0 then indf20224=indf20224*10;
if ind_code_c5=. & lastint2022=2002 & previd20225>0 & indf20225>0 then indf20225=indf20225*10;
if ind_code_c6=. & lastint2022=2002 & previd20226>0 & indf20226>0 then indf20226=indf20226*10;
if ind_code_c7=. & lastint2022=2002 & previd20227>0 & indf20227>0 then indf20227=indf20227*10;
if ind_code_c8=. & lastint2022=2002 & previd20228>0 & indf20228>0 then indf20228=indf20228*10;
if ind_code_c9=. & lastint2022=2002 & previd20229>0 & indf20229>0 then indf20229=indf20229*10;
if ind_code_c10=. & lastint2022=2002 & previd202210>0 & indf202210>0 then indf202210=indf202210*10;
if ind_code_c11=. & lastint2022=2002 & previd202211>0 & indf202211>0 then indf202211=indf202211*10;
if ind_code_c12=. & lastint2022=2002 & previd202212>0 & indf202212>0 then indf202212=indf202212*10;
if ind_code_c13=. & lastint2022=2002 & previd202213>0 & indf202213>0 then indf202213=indf202213*10;
if ind_code_c14=. & lastint2022=2002 & previd202214>0 & indf202214>0 then indf202214=indf202214*10;
if occ_code_c1=. & lastint2022=2002 & previd20221>0 & occf20221>0 then occf20221=occf20221*10;
if occ_code_c2=. & lastint2022=2002 & previd20222>0 & occf20222>0 then occf20222=occf20222*10;
if occ_code_c3=. & lastint2022=2002 & previd20223>0 & occf20223>0 then occf20223=occf20223*10;
if occ_code_c4=. & lastint2022=2002 & previd20224>0 & occf20224>0 then occf20224=occf20224*10;
if occ_code_c5=. & lastint2022=2002 & previd20225>0 & occf20225>0 then occf20225=occf20225*10;
if occ_code_c6=. & lastint2022=2002 & previd20226>0 & occf20226>0 then occf20226=occf20226*10;
if occ_code_c7=. & lastint2022=2002 & previd20227>0 & occf20227>0 then occf20227=occf20227*10;
if occ_code_c8=. & lastint2022=2002 & previd20228>0 & occf20228>0 then occf20228=occf20228*10;
if occ_code_c9=. & lastint2022=2002 & previd20229>0 & occf20229>0 then occf20229=occf20229*10;
if occ_code_c10=. & lastint2022=2002 & previd202210>0 & occf202210>0 then occf202210=occf202210*10;
if occ_code_c11=. & lastint2022=2002 & previd202211>0 & occf202211>0 then occf202211=occf202211*10;
if occ_code_c12=. & lastint2022=2002 & previd202212>0 & occf202212>0 then occf202212=occf202212*10;
if occ_code_c13=. & lastint2022=2002 & previd202213>0 & occf202213>0 then occf202213=occf202213*10;
if occ_code_c14=. & lastint2022=2002 & previd202214>0 & occf202214>0 then occf202214=occf202214*10;

Users should be aware that not all of the variables listed in the programs above appear in the NLSY79 public release data file. Variables with no valid data for any respondent, jobs 6-10, within-job gap 4, and between-job gaps 5-6 are not currently included in the main file.

End notes

[Note 1] All week number references in this program are relative to 1/1/78 and end with the most recent interview date. A week #0 is included at the beginning of the week-by-week array structures to indicate time prior to 1/1/78. Users are discouraged from incorporating data contained in this week in analysis. Researchers should instead use information from the 1979 interview concerning labor force activity prior to 1/1/78 in order to construct event histories of a more thorough nature. (Some information concerning labor force activity for respondents prior to the time frame of the initial 1979 interview is asked on an age restricted basis for respondents still in their teens at the time of interview.)

[Note 2] All variables have standard missing value codes unless otherwise noted.

[Note 3] The final 2022 (round 30) interviews were conducted in September 2023. Therefore, valid data are only present through variables for week #2384 in the current data set. The maximum week number variable in the Dual Job [#] arrays is week #2348, as no one reported multiple jobs in weeks #2249-2384.

NLSY79 Appendix 17: Interviewer Characteristics Data

Interviewer characteristics data and data review

Many researchers are interested in knowing if or how much interviewers affect respondents' answers. To enable researchers to investigate these questions, NLSY79 data releases since 1988 have contained information on interviewers' characteristics.

Constructing the Interviewer Characteristics ID and Interview Attribute variables

The key variable, which links the NLSY data set with the interviewer characteristics data set, is INTCHARS_INT_ID. This ID variable is often similar but not necessarily identical to the Interviewer ID variable, which is entered in the questionnaire and can be found on the NLSY79 public use data set for many years. INTCHARS_INT_ID is a constructed longitudinal variable that allows identification of cases interviewed by the same person over time. While some interviewers were assigned multiple IDs during their tenure, it was possible to successfully connect the records of most interviewers through their active years.

Each round, new IDs are assigned to new interviewers who do not have a longitudinal ID. From 1979-2000, information on the characteristics of NLSY79 interviewers primarily comes from NORC's interviewer personnel files. Data from the 2002-present surveys come from forms filled in by interviewers during their NLSY79 training program. Collecting this information directly from interviewers before each round ensures that the interviewer characteristics data is up to date at the start of data collection. Users should note that not all interviewers have filled out this demographic survey in the survey years that they worked. 

The variables that document Interviewer-specific traits are found in the “Interviewer Characteristics” Area of Interest:

  • INTCHARS_YRSINTR: Interviewer Count (available 1979 - 2014)
    • This counts the number of years the interviewer has interviewed the respondent, including the current survey year. Note that as telephone interviews become more prevalent, the number of first-time interviews expands considerably, as most interviewers are not assigned to specific cases year after year.
  • INTCHARS_RACE: Interviewer Race (available all years)
    • 1 = WHITE
    • 2 = BLACK
    • 3 = HISPANIC
    • 4 = ASIAN
    • 5 = AMERICAN INDIAN
    • 6 = MULTICULTURAL (available beginning in 2016)
    • 7 = OTHER (available beginning in 2018)
    • -3 = missing
  • INTCHARS_SEX: Interviewer Sex (available all years)
    • 1 = MALE
    • 2 = FEMALE
    • -3 = missing
  • INTCHARS_AGE: Interviewer Age (available 1979-2014)
    • Age of the interviewer in the interview year, calculated as ([survey year]-[interviewer’s year of birth])
    • -3 = missing
  • INTCHARS_EDUCATION: Interviewer Education (available all years)
    • 1 = Grade 0-8
    • 2 = Grade 9-11
    • 3 = High School Graduate
    • 4 = Vocational degree
    • 5 = Some College
    • 6 = College Graduate
    • 7 = Graduate School
    • 8 = Masters Degree
    • 9 = Professional Degree
    • 0 = Other
  • INTCHARS_FI_EXP: Interviewer Experience (available 2016-current round)
    • Interviewer experience in years, from < 1 – 17+ years
    • -3 = missing
  • INTCHARS_HISPANIC: Interviewer of Hispanic Ethnicity (available 2016-current round)
    • 0 = Non-Hispanic
    • 1 = Hispanic
    • -3 = missing
  • INTCHARS_DEM: Interviewer Demographic Data Released (available 2018-current round)
    • Indicates if the interviewer provided permission to release demographic data.
    • 1 = Yes
    • 0 = No
  • INTCHARS_HPC: Hours Per Case (available 2018-current round)
    • Interviewer average hours per case as percentage of project hours per case in the first 8 weeks of fielding.
    • -3 = missing
  • INTCHARS_POS: Interviewer Position (available 2018-current round)
    • 1 = Field Interviewer
    • 2 = Field Manager
  • INTCHARS_SPANISH_SPEAK: Interviewer Position (available 2018-current round)
    • 1 = Yes
    • 2 = No
  • INTCHARS_OCC: Interviewer Occupation (available 2018-current round)
    Open-ended response that asks interviewers to describe their previous or other current occupation(s) besides interviewing. These responses are coded in the following occupation categories:
    • 0 = Not employed
    • 1 = Interviewer
    • 2 = Teaching
    • 3 = Sales and customer service
    • 4 = Administrative assistant, secretarial, clerical & accounts
    • 5 = Medical/health care administrator
    • 6 = Nursing, social work, mental health practitioner, pharmacists & medical    assistants
    • 7 = Insurance, real estate & travel agent
    • 8 = Small business owner
    • 9 = Self-employed & other occupations
    • 10 = Other (professional)
    • 11 = Manager, Supervisor, Director
    • 12 = Social worker, Counselor, Non-profit
    • 13 = Government

Other variables found in the “Survey Methodology” Area of Interest document the interviewers time with the project.

  • R##_FI_START~[M/Y]: Interviewer Start Date (available 2018-current round)
    Month/year interviewer started working on current NLSY79 round.
  • R##_FI_END~[M/Y]: Interviewer End Date (available 2018-current round)
    Date Interviewer stopped working on current NLSY79 round.
  • R##_FI_FIRST_DAY: Interviewer First Work Day (available 2018- current round)
    First day of field period that interviewer worked on current NLSY79 round.
  • R##_FI_LAST_DAY: Interviewer Last Work Day (available 2018- current round)
    Last day of field period that interviewer worked on current NLSY79 round.

Constructing the Interview Characteristics variables

Variables that summarize interactions with respondents, survey characteristics, and field activities are found in the “Survey Methodology” Area of Interest.

A portion of interviews each survey round are reviewed by a human coder to evaluate interview quality as part of the NLSY computer audio recorded interview (CARI) monitoring process and select variables summarize the review. During the CARI process, portions of recorded interviews are reviewed for data quality to provide feedback to the interviewer. The audio review outcome variable provides the results of these reviews at an individual case level. Note that not all cases are reviewed, so many interviews will not have an audio review outcome.

  • R##_REVIEW_OUTCOME: Audio Review Outcome (available 2016-current round)
    Results of review of audio recordings for this interview for data quality assurance.
    • 1 = High quality
    • 2 = Case had minor quality issues
    • 3 = Not reviewed

Interviewers are also categorized into quality tiers based on the aggregate results of all CARI reviews of their cases. The FI quality tier variable records this information, where cases are linked to interviewers using the process described above for interviewer characteristics variables. 

  • R##_FI_QUALITY_TIER: FI Quality Tier (available 2016-current round)
    Indicates the final quality assessment of the field interviewer completing the interview, not necessarily quality of the specific interview.
    • 1 = Confirmed High Quality
    • 2 = Partially Confirmed High Quality
    • 3 = Some Issues, Quality Acceptable
    • 4 = Significant Issues

Variables for locating, case disposition, attempts, outreach, and case refusals are constructed from NORC’s case management system that records all contacts with a case. Starting in 2018, an outreach attempts variable was also included to distinguish between all effort spent on a case and outreach that represented a direct attempt to contact a case. These outreach attempts are a subset of the total attempts variable.

  • R##_LOCATING: Case to Locating (available 2016-current round)
    Indicates if the case was every assigned to locating during the data collection round.
    • 0 = Not assigned to locating
    • 1 = Assigned to locating
  • R##_DISP_DATE: Disposition Date (available 2016-current round)
    Date case disposition assigned.
  • R##_FIRST_ATTEMPT: Field Day 1st Attempt (available 2016-current round)
    Sequential day of the field period when first contact was made with case.
  • R##_LAST_ATTEMPT: Field Day Last Attempt (available 2016-current round)
    Sequential day of the field period when last attempt at contact with case was made.
  • R##_PEOPLE_WORKING: People Working (available 2018- current round)
    Total number of interviewers that worked on the case.
  • R##_OUTREACH_ATTEMPTS: Interviewer Outreach Attempts (available 2018- current round)
    The number of times a project staff member attempted to reach the case. This number includes only attempts to reach the case and other individuals who might be helpful in completing the interview (including locating for outreach) and omits comments and case review notes by interviewers.
  • R##_IN_PERSON_OUTREACH: In-Person Outreach (available 2016-current round)
    • 0 = No in-person outreach made
    • 1 = In-person outreach made
  • R##_REFUSED: R Ever Refused Interview (available 2016-current round)
    Indicates if the case ever refused to participate during various contact attempts in the round. Interview may eventually have been completed.
    • 1 = R refused at least once to participate in interview
    • 0 = R never refused to participate in interview
  • R##_ATTEMPTS: Number of Total Attempts Across Round (available 2018-current round)
    Number of times project staff tried to contact case (all types of contact)
  • R##_ATTEMPTS_EB: Interviewer Attempts Early Bird (available 2016-current round)
    Number of contact attempts during Early Bird phase (first 4 weeks after case released for interview).
  • R##_ATTEMPTS_OUTBOUND: Interviewer Attempts Outbound (available 2016-2020)
    Number of contact attempts after Early Bird phase, during outbound dialing phase.
  • R##_ATTEMPTS_CASE_MANAGED: Interviewer Attempts Case Managed (available 2016-current round)
    Number of contact attempts during case-managed phase of field period, after outbound dialing phase.
  • R##_EB_COMPLETE: EB Complete (available 2016 only)
    • 1 = Yes
    • 0 = No

A replicate group variable is included starting in 2016, which is assigned based on the likelihood that a case will complete that round. The definitions of these groups can vary by round, but in all rounds are constructed based on the likelihood that a respondent will complete, which is then used in targeting outreach to respondents throughout the round.

  • R##_REPGROUP: Replicate Group (available 2016-current round)
    • 1 = High response probability
    • 2 = Middle response probability
    • 3 = Low response probability

Variables on eligibility for incentives are constructed based on eligibility rules for a given round. All variables measuring the receipt of incentives are constructed from records of incentives that were paid to cases following completion of the interview. 

  • R##_INCENTIVE_AMT: Incentives (available 2016-current round)
    Total incentive amount paid, including Early Bird, Missed Interview and Final Push Incentives
  • R##_EB_BONUS_AMOUNT: Early Bird Bonus Amount (available 2018- current round)
    • 0 = Did not receive
    • 30 = Received
  • R##_EB_ADJACENT: Early Bird Adjacent (available 2018-current round)
    Because of operational issues (e.g., weather, mailing delays, government shutdowns, etc.), the early bird window can be expanded for some cases. This flag indicates cases that received these “adjacent” early bird payments outside of the traditional early bird window.
    • 0 = Did not receive
    • 30 = Received
  • R##_MISSED_NIR_BONUS: Missed NIR Bonus (available 2018- current round)
    • 1 = Not eligible
    • 2 = 1 round missed
    • 3 = 2 rounds missed
    • 4 = 3 or more rounds missed
  • R##_MISSED_NIR_BONUS_AMOUNT: Missed NIR Bonus Amount (available 2018- current round)
    • 0 = Completed last round
    • 20 = Missed last round
    • 30 = Missed two rounds
    • 40 = Missed three or more rounds
  • R##_ENHANCED_FINAL_PUSH: Enhanced Final Push (available 2018- current round)
    • 1 = Eligible
    • 2 = Ineligible, does not meet criteria for enhanced final push eligibility
    • 3 = Ineligible, in demographic group offered enhanced final push, but completed prior to start of enhanced final push period
  • R##_ENHANCED_FINAL_PUSH_AMOUNT: Enhanced Final Push Amount (available 2018- current round)
    • 0 = Did not receive
    • 20 = Received
  • R##_FINAL_PUSH: Final Push (available 2018- current round)
    • 1 = Eligible
    • 2 = Ineligible
  • R##_FINAL_PUSH_AMOUNT: Final Push Amount (available 2018- current round)
    • 0 = Did not receive
    • 30 = Received

In Round 29, an experiment was run on the final push incentive that randomly assigned cases into one of two groups. The first group received final push around the traditional time, whereas the second group received final push 6 weeks later. The R29_FINAL_PUSH_EXPERIMENT and R29_FINAL_PUSH_EXPERIMENT_COMPLETION variables measure the eligibility and outcome of this experiment.

  • R29_FINAL_PUSH_EXPERIMENT: R29 Final Push Experiment (available 2020 only)
    • 1 = Eligible for Phase I (Treatment Group)
    • 2 = Eligible for Phase II (Control Group)
    • 3 = Ineligible because completed/NIR prior to start of experiment
  • R29_FINAL_PUSH_EXPERIMENT_COMPLETION: R29 Final Push Experiment Completion (available 2020 only)
    • 1 = Completed during Phase I
    • 2 = Completed during Phase II
    • 3 = Completed/NIR prior to start of experiment

A small set of variables also summarizes the number of responses and the percentage of invalid responses.

  • R##_RESPONSES: R Responses (available 2016-current round)
    Total Number of Responses Provided by Case
  • R##_PCT_DK: Percent Don’t Know Responses Current Round (available 2004-current round)
    Actual percent DK responses.
  • R##_PCT_REF: Percent Refusal Responses Current Round (available 2004-current round)
    Actual percent REF responses.

Beginning in 2018, interviewer characteristics were included for all respondents who were fielded, but not interviewed, as well as interviewed respondents. For non-interviewed respondents, characteristics for the most recent interviewer assigned to the case are contained in the data where available. 

Table 1. Interviewers identified in NORC database by survey year
Year Number of Respondents Interviewed Number of Interviewers Matched Percentage Not Matched
1979 12686 9838 22.4%
1980 12141 11200 7.8%
1981 12195 11850 2.8%
1982 12123 11736 3.2%
1983 12221 11980 2.0%
1984 12069 11585 4.0%
1985 10894 10850 0.4%
1986 10655 10560 1.0%
1987 10485 10485 0.0%
1988 10465 10386 10.2%
1989 10605 9906 6.6%
1990 10436 9321 10.7%
1991 9018 8933 1.0%
1992 9016 8947 0.3%
1993 9011 8933 1.0%
1994 8891 8701 2.1%
1996 8636 8050 6.8%
1998 8399 8302 1.2%
2000 8033 7814 2.7%
2002 7726 7723 0.0%
2004 7661 6851 10.6%
2006 7654 7328 4.3%
2008 7757 7742 0.1%
2010 7565 7559 0.0%
2012 7301 7293 0.1%
2014 7071 6977 1.3%
2016 6913 6913 0.0%
2018 6878 6878 0.0%
2020 6535 6535 0.0%
2022 6413 6413 0.0%
Subscribe to NLSY79