<?xml version="1.0" encoding="UTF-8"?>
<FragmentInstance xmlns="ddi:instance:3_3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xhtml="http://www.w3.org/1999/xhtml" 
    xsi:schemaLocation="ddi:instance:3_3 https://ddialliance.org/Specification/DDI-Lifecycle/3.3/XMLSchema/instance.xsd">
  <Fragment>
      <Variable xmlns="ddi:logicalproduct:3_3">
          <Agency xmlns="ddi:reusable:3_3">DDIAlliance</Agency>
          <ID xmlns="ddi:reusable:3_3">V17</ID>
          <Version xmlns="ddi:reusable:3_3">1</Version>
          <VariableName>
              <String xmlns="ddi:reusable:3_3">reg2</String>
          </VariableName>
          <Label xmlns="ddi:reusable:3_3">
              <Content>REGION</Content>
          </Label>
          <SourceVariableReference xmlns="ddi:reusable:3_3">
              <Agency>DDIAlliance</Agency>
              <ID>V8</ID>
              <Version>1</Version>
              <TypeOfObject>Variable</TypeOfObject>
          </SourceVariableReference>
      </Variable>
    </Fragment>
    <Fragment>
        <GenerationInstruction xmlns="ddi:datacollection:3_3">
            <Agency xmlns="ddi:reusable:3_3">DDIAlliance</Agency>
            <ID xmlns="ddi:reusable:3_3">GI1</ID>
            <Version xmlns="ddi:reusable:3_3">1</Version>
            <InputVariableReference>
                <Agency xmlns="ddi:reusable:3_3">DDIAlliance</Agency>
                <ID xmlns="ddi:reusable:3_3">V17</ID>
                <Version xmlns="ddi:reusable:3_3">1</Version>
                <TypeOfObject xmlns="ddi:reusable:3_3">Variable</TypeOfObject>
            </InputVariableReference>
            <Description xmlns="ddi:reusable:3_3">
                <Content><xhtml:div>reg2 to REGION</xhtml:div>
                <xhtml:div>Recode these variables: reg2 into reg2\n\t .
                    13. 12 replace with 11\n\t .
                    22 replace with 21\n\t .
                    32. 33 replace with 31\n\t .
                    42 replace with 41</xhtml:div>
                <xhtml:div>
                    Label the values of reg2 to \n\t
                    label 11 as "Northeast".\n\t
                    label 21 as "Midwest".\n\t
                    label 31 as "South".\n\t
                    label 41 as "West"
                </xhtml:div>
               <xhtml:div>
                   Set the description of reg2 to "REGION"</xhtml:div>
               </Content>              
            </Description>
            <CommandCode xmlns="ddi:reusable:3_3">
                <Command>
                    <ProgramLanguage>sdtl-pojo</ProgramLanguage>
                    <CommandContent>
                        {
                        "$type" : "Compute",
                        "command" : "compute",
                        "sourceInformation" : {
                        "lineNumberStart" : 9,
                        "lineNumberEnd" : 9,
                        "originalSourceText" : "compute reg2 = REGION."    },
                        "variable" : {   "$type" : "VariableSymbolExpression",
                        "variableName" : "reg2"    },
                        "expression" : {  "$type" : "VariableSymbolExpression",
                        "variableName" : "REGION"   }  } 
                    </CommandContent>
                </Command> 
                <Command>
                    <ProgramLanguage>sdtl-pojo</ProgramLanguage>
                    <CommandContent>
                        {
                        "$type" : "Recode",
                        "command" : "recode",
                        "sourceInformation" : {
                        "lineNumberStart" : 11,
                        "lineNumberEnd" : 11,
                        "originalSourceText" : "recode reg2 (13 12=11) (22=21) (32 33 = 31)  (42=41)." },
                        "recodedVariables" : [ {
                        "source" : "reg2",
                        "target" : "reg2"   } ],
                        "rules" : [ 
                        {"fromValue" : [ {
                        "$type" : "NumericConstantExpression", "value" : "13"      }, {
                        "$type" : "NumericConstantExpression", "value" : "12"     } ],
                        "to" : "11"            }, 
                        {"fromValue" : [ {
                        "$type" : "NumericConstantExpression",
                        "value" : "22"    } ],
                        "to" : "21"  }, 
                        {"fromValue" : [ {
                        "$type" : "NumericConstantExpression", "value" : "32"    }, {
                        "$type" : "NumericConstantExpression", "value" : "33"      } ],
                        "to" : "31"  }, 
                        {"fromValue" : [ {
                        "$type" : "NumericConstantExpression", "value" : "42"    } ],
                        "to" : "41"  } ]
                        }
                    </CommandContent>
                </Command>
            </CommandCode>
        </GenerationInstruction>
    </Fragment>
</FragmentInstance>