<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:sdtl="https://rdf-vocabulary.ddialliance.org/sdtl#" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="https://rdf-vocabulary.ddialliance.org/sdtl#" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import schemaLocation="xml.xsd" namespace="http://www.w3.org/XML/1998/namespace" />
    <xs:annotation>
        <xs:documentation>This schema describes Structured Data Transform Language, version 2.0.0, authored by C2Metadata Contributors and DDI Alliance.

A model for describing data transformations

Copyright (c) 2026 C2Metadata Contributors and DDI Alliance.</xs:documentation>
    </xs:annotation>
    <xs:simpleType name="long">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:long restricted to integers from -9007199254740991 through 9007199254740991, inclusive.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:long">
            <xs:minInclusive value="-9007199254740991" />
            <xs:maxInclusive value="9007199254740991" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="unsignedLong">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:unsignedLong restricted to integers from 0 through 9007199254740991, inclusive.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:unsignedLong">
            <xs:minInclusive value="0" />
            <xs:maxInclusive value="9007199254740991" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="positiveInteger">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:positiveInteger restricted to integers from 1 through 9007199254740991, inclusive.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:positiveInteger">
            <xs:minInclusive value="1" />
            <xs:maxInclusive value="9007199254740991" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="negativeInteger">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:negativeInteger restricted to integers from -9007199254740991 through -1, inclusive.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:negativeInteger">
            <xs:minInclusive value="-9007199254740991" />
            <xs:maxInclusive value="-1" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="nonPositiveInteger">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:nonPositiveInteger restricted to integers from -9007199254740991 through 0, inclusive.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:nonPositiveInteger">
            <xs:minInclusive value="-9007199254740991" />
            <xs:maxInclusive value="0" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="nonNegativeInteger">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:nonNegativeInteger restricted to integers from 0 through 9007199254740991, inclusive.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:nonNegativeInteger">
            <xs:minInclusive value="0" />
            <xs:maxInclusive value="9007199254740991" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="decimal">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:decimal with at most 29 total digits and 28 fractional digits, between -79228162514264337593543950335 and 79228162514264337593543950335, inclusive. Exact interchange additionally requires an unsigned 96-bit coefficient with scale 0 through 28 and an unchanged decimal value after JavaScript JSON parsing and writing; application validation must enforce these additional conditions.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:decimal">
            <xs:totalDigits value="29" />
            <xs:fractionDigits value="28" />
            <xs:minInclusive value="-79228162514264337593543950335" />
            <xs:maxInclusive value="79228162514264337593543950335" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="float">
        <xs:annotation>
            <xs:documentation xml:lang="en">A finite IEEE 754 binary32 value, between -3.4028234663852886E38 and 3.4028234663852886E38, inclusive. Accepts xs:float decimal and scientific notation, including subnormal values; excludes NaN and infinities.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:float">
            <xs:minInclusive value="-3.4028234663852886E38" />
            <xs:maxInclusive value="3.4028234663852886E38" />
            <xs:pattern value="[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][+-]?[0-9]+)?" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="double">
        <xs:annotation>
            <xs:documentation xml:lang="en">A finite IEEE 754 binary64 value, between -1.7976931348623157E308 and 1.7976931348623157E308, inclusive. Accepts xs:double decimal and scientific notation, including subnormal values; excludes NaN and infinities.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:double">
            <xs:minInclusive value="-1.7976931348623157E308" />
            <xs:maxInclusive value="1.7976931348623157E308" />
            <xs:pattern value="[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][+-]?[0-9]+)?" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="dateTime">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:dateTime with a required timezone and whole-millisecond precision, from 0001-01-01T00:00:00Z through 9999-12-31T23:59:59.999Z, inclusive. Timezone offsets are permitted; the bounds apply to the equivalent UTC instant.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:dateTime">
            <xs:minInclusive value="0001-01-01T00:00:00Z" />
            <xs:maxInclusive value="9999-12-31T23:59:59.999Z" />
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3}0*)?(Z|[+-][0-9]{2}:[0-9]{2})" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="date">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:date representing a local calendar date in years 0001 through 9999, without a timezone.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:date">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="time">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:time representing a local time without a timezone, at microsecond precision. The end-of-day value 24:00:00 is equivalent to 00:00:00.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:time">
            <xs:pattern value="[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,6}0*)?" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="duration">
        <xs:annotation>
            <xs:documentation xml:lang="en">An xs:duration representing elapsed whole milliseconds from -922337203685477 through 922337203685477, inclusive. Accepts positive and negative durations expressed in days, hours, minutes and seconds; year and month components are excluded.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:duration">
            <xs:minInclusive value="-P10675199DT2H48M5.477S" />
            <xs:maxInclusive value="P10675199DT2H48M5.477S" />
            <xs:pattern value="-?P([0-9]+D)?(T([0-9]+H)?([0-9]+M)?(([0-9]+(\.[0-9]{0,3}0*)?|\.[0-9]{1,3}0*)S)?)?" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="cogsDate">
        <xs:annotation>
            <xs:documentation xml:lang="en">A union of dateTime, date, gYearMonth, gYear, and duration.</xs:documentation>
        </xs:annotation>
        <xs:union memberTypes="sdtl:dateTime sdtl:date xs:gYearMonth xs:gYear sdtl:duration" />
    </xs:simpleType>
    <xs:complexType name="LangString">
        <xs:annotation>
            <xs:documentation xml:lang="en">A string paired with a required BCP 47 xml:lang value.</xs:documentation>
        </xs:annotation>
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute ref="xml:lang" use="required" />
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <xs:simpleType name="language">
        <xs:annotation>
            <xs:documentation xml:lang="en">A BCP 47 language tag. Instance validation applies the complete grammar, including grandfathered tags.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:language">
            <xs:pattern value="((([A-Za-z]{2,3}(-[A-Za-z]{3}){0,3}|[A-Za-z]{4}|[A-Za-z]{5,8})(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+)*(-[xX](-[A-Za-z0-9]{1,8})+)?|[xX](-[A-Za-z0-9]{1,8})+)|[eE][nN]-[gG][bB]-[oO][eE][dD]|[iI]-[aA][mM][iI]|[iI]-[bB][nN][nN]|[iI]-[dD][eE][fF][aA][uU][lL][tT]|[iI]-[eE][nN][oO][cC][hH][iI][aA][nN]|[iI]-[hH][aA][kK]|[iI]-[kK][lL][iI][nN][gG][oO][nN]|[iI]-[lL][uU][xX]|[iI]-[mM][iI][nN][gG][oO]|[iI]-[nN][aA][vV][aA][jJ][oO]|[iI]-[pP][wW][nN]|[iI]-[tT][aA][oO]|[iI]-[tT][aA][yY]|[iI]-[tT][sS][uU]|[sS][gG][nN]-[bB][eE]-[fF][rR]|[sS][gG][nN]-[bB][eE]-[nN][lL]|[sS][gG][nN]-[cC][hH]-[dD][eE]|[aA][rR][tT]-[lL][oO][jJ][bB][aA][nN]|[cC][eE][lL]-[gG][aA][uU][lL][iI][sS][hH]|[nN][oO]-[bB][oO][kK]|[nN][oO]-[nN][yY][nN]|[zZ][hH]-[gG][uU][oO][yY][uU]|[zZ][hH]-[hH][aA][kK][kK][aA]|[zZ][hH]-[mM][iI][nN]|[zZ][hH]-[mM][iI][nN]-[nN][aA][nN]|[zZ][hH]-[xX][iI][aA][nN][gG])" />
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="anyURI">
        <xs:annotation>
            <xs:documentation xml:lang="en">An RFC 3986 URI reference. Instance validation additionally checks scheme, fragment, and bracket structure.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:anyURI">
            <xs:pattern value="([A-Za-z0-9._~:/?#\[\]@!$&amp;'()*+,;=-]|%[0-9A-Fa-f]{2})*" />
        </xs:restriction>
    </xs:simpleType>
    <xs:group name="IdentificationGroup">
        <xs:annotation>
            <xs:documentation xml:lang="en">The ordered identification fields shared by all item references. Full item definitions declare their identification fields as normal properties.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="ID" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">ID of the object being referenced.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:group>
    <xs:complexType name="Program">
        <xs:annotation>
            <xs:documentation xml:lang="en">The program represents a list of commands from a statistical package.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="ID" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">ID of the object being referenced.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceFileName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of the file containing the source code.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceLanguage" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The language of the source code.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="ScriptMD5" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The MD5 hash of the contents of the file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="ScriptSHA1" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The SHA-1 hash of the contents of the file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceFileLastUpdate" type="sdtl:dateTime">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The date and time the file was last updated.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceFileSize" type="sdtl:long">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The size of the file in bytes.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="LineCount" type="xs:int">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The number of lines in the source file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="CommandCount" type="xs:int">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The number of commands detected in the source file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" block="extension restriction" name="Messages" type="sdtl:Message">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Messages related to the parsing of the source file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="Parser" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of the parser used to generate the SDTL.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="ParserVersion" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The version of the parser used to generate the SDTL.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="ModelVersion" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The version of the SDTL model.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="ModelCreatedTime" type="sdtl:dateTime">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The date and time the SDTL was generated.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="Commands" type="sdtl:CommandBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The list of commands that make up the program.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Aggregate">
        <xs:annotation>
            <xs:documentation xml:lang="en">An aggregation summarizes data using aggregation functions applied to data that may be grouped
by one or more variables. The resulting summary data is added to each row of the
existing dataset.  See the aggregation functions in the Function Library.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="GroupByVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables used as keys to identify groups.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" block="extension restriction" name="AggregateVariables" type="sdtl:Compute">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The expressions that compute the aggregations. An aggregation function should be used.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" block="extension restriction" name="Weighting" type="sdtl:Weight">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Description of the weights to be used</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="AllNumericVariablesExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">An expression that represents all numeric variables in the dataset, similar to `_all` in SPSS or Stata.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="AllTextVariablesExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">An expression that represents all text variables in the dataset, similar to `_all` in SPSS or Stata.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="AllVariablesExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">An expression that represents all variables in the dataset, similar to `_all` in SPSS or Stata.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Analysis">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes an analysis command. An analysis command does not result in any data transformation.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:InformBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="AppendDatasets">
        <xs:annotation>
            <xs:documentation xml:lang="en">Combines datasets by concatenation for datasets with the same or overlapping variables.  
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="AppendFiles" type="sdtl:AppendFileDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Description of files to be appended</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="AppendFlagVariable" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Creates a new variable identifying the source dataframe for a row with the variable name given in the value of the property</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="AppendFileDescription">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes files used in an AppendDatasets command.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="FileName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Name of the file being appended.  May be the name of an active dataframe.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="RenameVariables" type="sdtl:RenamePair">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Variables to be renamed</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="KeepVariables" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">List of variables to keep</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="DropVariables" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">List of variables to drop</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="KeepCasesCondition" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Logical condition for keeping rows.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="DropCasesCondition" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Logical condition for dropping rows.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="Software" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The software package that works with the file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="FileFormat">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of a file format</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="csv" />
                        <xs:enumeration value="txt" />
                        <xs:enumeration value="dat" />
                        <xs:enumeration value="xls" />
                        <xs:enumeration value="xlsx" />
                        <xs:enumeration value="sav" />
                        <xs:enumeration value="dta" />
                        <xs:enumeration value="sas7bdat" />
                        <xs:enumeration value="rds" />
                        <xs:enumeration value="rdata" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="IsCompressed" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Indicates whether the file format is compressed.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="BooleanConstantExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">BooleanConstantExpression takes values of TRUE and FALSE.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="BooleanValue" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Values of TRUE and FALSE are used in logical expressions.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Collapse">
        <xs:annotation>
            <xs:documentation xml:lang="en">A collapse command summarizes data using aggregation functions applied to data
that may be grouped by one or more variables. The resulting summary data is
represented in a new dataset.  See the collapse functions in the Function Library.   
   
The details of implementation of caseWise and columnWise exclusion vary in each statistical package.  The source language is indicated in this property for reference.   </xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="OutputDatasetName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of a new, aggregated dataset to be created.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="GroupByVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables used as keys to identify groups.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" block="extension restriction" name="AggregateVariables" type="sdtl:Compute">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The expressions that compute the aggregations. An aggregation function should be used.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" block="extension restriction" name="Weighting" type="sdtl:Weight">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Description of the weights to be used</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="CaseWise">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Observations are not included if any variable  is missing</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="Stata" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="ColumnWise">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables are not included if any value in a column is missing</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="SPSS" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="CommandBase" abstract="true">
        <xs:annotation>
            <xs:documentation xml:lang="en">CommandBase defines general properties available to all commands.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="Command" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The type of command</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" block="extension restriction" name="SourceInformation" type="sdtl:SourceInformation">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Information about the source of the command.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="MessageText" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Adds a message that can be displayed with the command.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Comment">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes a source code comment.  Comments should not include special characters.  
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:InformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="CommentText" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The text of the source code comment.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="CompositeVariableNameExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A composite variable name is used to describe a variable name that is computed.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="ComputedVariableName" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">An expression that evaluates to the constructed variable name.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Compute">
        <xs:annotation>
            <xs:documentation xml:lang="en">Assigns the value of an expression to a variable.  </xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Variable" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variable that is computed.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="Expression" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The expression used to compute the value of the variable(s)</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="DataframeDescription">
        <xs:annotation>
            <xs:documentation xml:lang="en">Provides a name for the dataframe and an ordered list of variables (optional).   
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="DataframeName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Name of the dataframe.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="VariableInventory" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Variables in the dataframe in order</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="RowDimensions" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">An ordered list of variables used as hierarchical dimensions in a data cube or multi-index</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="ColumnDimensions" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">An ordered list of variables used as colum indexes in a multi-index</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="DateTimeConstant">
        <xs:annotation>
            <xs:documentation xml:lang="en">A date-time constant expressed in ISO 8601 format.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="DateTimeValue" type="sdtl:dateTime">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A specific instance of time in ISO 8601 format</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="DoIf">
        <xs:annotation>
            <xs:documentation xml:lang="en">A set of commands that are performed when a logical expression is true.  May also include ElseCommands to be performed if the logical expression is false.  The commands in DoIf are performed once, and it expects a logical condition that applies to the entire dataframe.  Use IfRows for commands that are performed on each row depending upon values on those rows. 
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Condition" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A logical expression</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="ThenCommands" type="sdtl:CommandBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Commands to be performed if the condition is true.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="ElseCommands" type="sdtl:CommandBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Commands to be performed if the condition is false.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="DropCases">
        <xs:annotation>
            <xs:documentation xml:lang="en">Rows that match the selection condition are deleted from the dataset.  
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Condition" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">If the logical expresion is true, the case (row) will be deleted from the working dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="DropVariables">
        <xs:annotation>
            <xs:documentation xml:lang="en">Deletes variables from the data.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variables to be dropped.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Execute">
        <xs:annotation>
            <xs:documentation xml:lang="en">This command causes the system to execute preceding commands before continuing to process the command script.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ExpressionBase" abstract="true">
        <xs:annotation>
            <xs:documentation xml:lang="en">The SDTL types in  ExpressionBase are used in expressions, which may be numeric, text or logical. 
</xs:documentation>
        </xs:annotation>
        <xs:sequence />
    </xs:complexType>
    <xs:complexType name="FunctionArgument">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes the arguments in a function as specified in the SDTL Function Library.   
Notes:
1. The argumentName property must always be present.   
2. The argumentValue property is required, and it must be a single object.  When the argumentValue is a list of items in the source language, the ValueListExpression or VariableListExpression should be used. </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="ArgumentName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of the parameter.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" name="ArgumentValue" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The value of the parameter.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="FunctionCallExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">An expression evaluated by reference to the Function Library.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Function" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of the function being called.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="IsSdtlName" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">When true, the Function property contains the name of a function from the SDTL function library. When false, the Function property contains the name of a system-specific or user-defined function.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="Arguments" type="sdtl:FunctionArgument">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A list of parameters to the function.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="GroupedExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A group of expressions to be evaluated before expressions outside of the group.  Used to control the order of operations in a formula.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Expression" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Expression to be evaluated.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="IfRows">
        <xs:annotation>
            <xs:documentation xml:lang="en">A set of commands that are performed on each row in the dataframe when a logical expression is true for that row.  May also include ElseCommands to be performed if the logical expression is false.  Use DoIf for a logical condition that applies to the entire dataframe and commands that are performed once.  
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Condition" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A logical expression that is evaluated separately for every row in the dataframe.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="ThenCommands" type="sdtl:CommandBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Commands to be performed if the condition is true.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="ElseCommands" type="sdtl:CommandBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Commands to be performed if the condition is false.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="InformBase" abstract="true">
        <xs:annotation>
            <xs:documentation xml:lang="en">InformBase includes information elements that do not transform data.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:CommandBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Invalid">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes an invalid command. A command is invalid if it uses incorrect syntax, or is otherwise not allowed by the executing system.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:InformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="ProblemDescription" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A message describing the issue with the invalid command.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="IteratorDescription">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes an iteration process consisting of an IteratorSymbolExpression and a list of values it takes.  
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" block="extension restriction" name="IteratorSymbolName" type="sdtl:IteratorSymbolExpression">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name used in  IteratorCommands  for the index variable that changes value in the loop.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="unbounded" name="IteratorValues" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Describes the values that are substituted for the index variable that changes value in the loop.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="IteratorSymbolExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">The name of an iterator symbol used as an index in describing the actions of 
a loop.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Name" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A name used for the index variable that takes different values inside a loop.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="KeepCases">
        <xs:annotation>
            <xs:documentation xml:lang="en">Rows that match the selection condition are retained in the dataset.  Other rows are deleted.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="Condition" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The logical expresion that must be true for a case to remain in the working dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="KeepVariables">
        <xs:annotation>
            <xs:documentation xml:lang="en">Variables to be retained in the dataset. Variables not on the list are deleted.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variables to be kept in the dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Load">
        <xs:annotation>
            <xs:documentation xml:lang="en">Load data from a file.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="FileName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of the file to be loaded.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="Software" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The software package that works with the file.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="FileFormat">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of a file format</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="csv" />
                                <xs:enumeration value="txt" />
                                <xs:enumeration value="dat" />
                                <xs:enumeration value="xls" />
                                <xs:enumeration value="xlsx" />
                                <xs:enumeration value="sav" />
                                <xs:enumeration value="dta" />
                                <xs:enumeration value="sas7bdat" />
                                <xs:enumeration value="rds" />
                                <xs:enumeration value="rdata" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="IsCompressed" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Indicates whether the file format is compressed.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="LoopOverList">
        <xs:annotation>
            <xs:documentation xml:lang="en">A loop creates multiple versions of a set of commands by iterating over a list of variables, numbers, or strings.  
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Iterators" type="sdtl:IteratorDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Describes one or more iteration processes in this loop.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Commands" type="sdtl:CommandBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Commands generated by the loop expanded by replacing tokens representing variables, numbers, or strings with their values.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="Updated" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">When TRUE, the loop has been expanded into separate commands.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="LoopWhile">
        <xs:annotation>
            <xs:documentation xml:lang="en">LoopWhile iterates over a set of commands under the control of one or more logical expressions.  Since the logical conditions typically depend upon values in the data, commands executed in a LoopWhile cannot be anticipated and expanded in SDTL.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="Condition" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Describes a condition required for the next iteration to begin.  </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="EndCondition" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Describes a condition that ends interation.  </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Commands" type="sdtl:CommandBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Commands within the loop.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="Updated" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">When TRUE, the loop has been expanded into separate commands.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="MergeDatasets">
        <xs:annotation>
            <xs:documentation xml:lang="en">Merges datasets holding overlapping cases but different variables.  The merge may be controlled by keys or grouping variables.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="2" maxOccurs="unbounded" name="MergeFiles" type="sdtl:MergeFileDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Description of files to be merged.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="MergeByVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A variable or list of variables that acts as the unique case identifier across datasets.  If MergeByVariables is absent, MergeType must be "sequential" on all files.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="FirstVariable" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of a variable set to 1 for the first row of each group of cases with the same value for the MergeByVariables variables and set to  0 for all other rows.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="LastVariable" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of a variable set to 1 for the last row of each group of cases with the same value for the MergeByVariables variables and set to  0 for all other rows.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="MergeFileDescription">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes files used in a MergeData command.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="FileName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Name of the file being merged.  May be the name of an active dataframe.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" name="MergeType">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Describes the type of merge performed. </xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Sequential" />
                        <xs:enumeration value="OneToOne" />
                        <xs:enumeration value="ManyToOne" />
                        <xs:enumeration value="OneToMany" />
                        <xs:enumeration value="Cartesian" />
                        <xs:enumeration value="Unmatched" />
                        <xs:enumeration value="SASmatchMerge" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="MergeFlagVariable" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Name of a new variable indicating whether the row came from this file or a different input file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="RenameVariables" type="sdtl:RenamePair">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Variables to be renamed</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" name="Update">
                <xs:annotation>
                    <xs:documentation xml:lang="en">When the same variables exist in more than one dataframe. values in the "Master" dataframe can be replaced by values from a different dataframe. "Master" is the default value.  "Ignore" means values in this dataframe are never used.  "FillNew" is used on rows not found in the "Master" dataframe.  "UpdateMissing" replaces missing values in the "Master" dataframe. "Replace" changes all values in the "Master" dataframe."</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Master" />
                        <xs:enumeration value="Ignore" />
                        <xs:enumeration value="FillNew" />
                        <xs:enumeration value="UpdateMissing" />
                        <xs:enumeration value="Replace" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" name="NewRow" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation xml:lang="en">When TRUE,  generate new row when not matched to other files</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="KeepVariables" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">List of variables to keep</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="DropVariables" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">List of variables to drop</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="KeepCasesCondition" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Logical condition for keeping rows.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="DropCasesCondition" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Logical condition for dropping rows.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="MergeByNames" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">An ordered list of variables used as keys  in this file to be matched to the variables in the mergeByVariables property of the MergeDatasets command.  This property is only used when the key variables in this file have different names than the variable names listed in the MergeDatasets command.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="Software" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The software package that works with the file.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="FileFormat">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of a file format</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="csv" />
                        <xs:enumeration value="txt" />
                        <xs:enumeration value="dat" />
                        <xs:enumeration value="xls" />
                        <xs:enumeration value="xlsx" />
                        <xs:enumeration value="sav" />
                        <xs:enumeration value="dta" />
                        <xs:enumeration value="sas7bdat" />
                        <xs:enumeration value="rds" />
                        <xs:enumeration value="rdata" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="IsCompressed" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Indicates whether the file format is compressed.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Message">
        <xs:annotation>
            <xs:documentation xml:lang="en">Inserts message text in the SDTL file.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:InformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="Severity" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Information, Warning, Error</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="LineNumber" type="xs:int">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The line number of the source that the messages is related to, if relevant.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="CharacterPosition" type="xs:int">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The character position of the source that the message is related to, if relevant.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="MissingValueConstantExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A missing value constant.  Some languages allow multiple missing value constants.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="Value" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The missing value as it appears in the system (e.g., .a, .b, .c).  If Null, this is the system missing value.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="NewDataframe">
        <xs:annotation>
            <xs:documentation xml:lang="en">The NewDataframe command copies or creates a new dataframe.  It can be used in two ways.    
    
An existing dataframe can be copied to a new dataframe by using the consumesDataframe and producesDataframe properties of NewDataframe.  The new dataframe will be a "deep" copy in the sense used in R and Python.      
   
NewDataframe can also be used to create an empty dataframe of a specific size.  In Stata, the "set obs #" command will create a dataframe with a user-defined number of rows.  All values are assumed to be missing.  This may be used in simulations to preset a number of simulated observations, which are then filled with randomly generated data.



</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="NumberOfRows" type="xs:int">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Number of rows in new dataframe</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="NumberOfColumns" type="xs:int">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Number of columns in new dataframe</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="NoTransformOp">
        <xs:annotation>
            <xs:documentation xml:lang="en">NoTransformOp is used for a command in the original script that provides important information but does not have a function in SDTL.  For example, “library()” in R loads a package of R functions.  Since the Parser detects the library, the SDTL will reflect the library that is used, and commands derived from the library will be translated in the SDTL script.  However, it is useful to know which library is active for auditing the R script, even if it does not perform any data transformations.  
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:InformBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="NumberRangeExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">Defines a range of numeric values.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="NumberRangeStart" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Starting value for range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="NumberRangeEnd" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Ending value for range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="NumberRangeIncrement" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Increment for stepping through range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="NumericConstantExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A numeric constant.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Value" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A number</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="NumericType">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Type of the number</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="Integer" />
                                <xs:enumeration value="Real" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="NumericMaximumValueExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">Represents the largest numeric value supported by a system.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="NumericMinimumValueExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">Represents the smallest numeric value supported by a system.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Recode">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes recoding values in one or more variables according to a specified mapping.

The Recode command can either describe a recoding of one or more individual variables,
or a range of variables. When one or more individual variables are described, a new
variable name can be specified. In this case, the original variable is left alone, and
a new variable is created with the recoded values.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" block="extension restriction" name="RecodedVariables" type="sdtl:RecodeVariable">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variables that will have their values recoded. The resulting values may be either stored in the same variable, or a newly created destination variable</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" block="extension restriction" name="RecodedVariableRange" type="sdtl:VariableRangeExpression">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A range of variables to which the recode rules are applied. The resulting values are stored in the same variable.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="unbounded" block="extension restriction" name="Rules" type="sdtl:RecodeRule">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A mapping describing which values will be recoded to which new values</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RecodeRule">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes how values will be recoded.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="FromValue" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The values to be recoded.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="To" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The new value</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="Label" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">A value label for the new recoded value, if appropriate</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="RecodeVariable">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes a variable that will have its values recoded.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="Source" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of the variable which will have its values recoded</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="Target" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The name of the new variable into which the recoded values are inserted. This may be the same as the source variable if values are recoded in place.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Rename">
        <xs:annotation>
            <xs:documentation xml:lang="en">Rename changes the names of variables.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" block="extension restriction" name="Renames" type="sdtl:RenamePair">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A list of variable rename objects, which includes the old name and the new name.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RenamePair">
        <xs:annotation>
            <xs:documentation xml:lang="en">Variable names before and after a variable is renamed.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" block="extension restriction" name="OldVariable" type="sdtl:VariableSymbolExpression">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The old name of the variable.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" block="extension restriction" name="NewVariable" type="sdtl:VariableSymbolExpression">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The new name of the variable.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ReshapeItemDescription">
        <xs:annotation>
            <xs:documentation xml:lang="en">Descripbes a new variable created by reshaping a dataset from wide to long or vice versa.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="TargetVariableName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Name of new variable created by this command.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="TargetVariableLabel" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Label for new variable created by this command.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceVariables" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Source variables in the original dataset used to create this variable.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="Stub" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The stub is a string used in the names of variables in the wide dataset.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="IndexValues" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">A list of values that produce new rows (long) or columns (wide) for this variable.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="IndexVariableName" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Name of the variable that will contain the value of the index for this row.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="IndexVariableLabel" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Label for the variable in IndexVariableName.</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ReshapeLong">
        <xs:annotation>
            <xs:documentation xml:lang="en">Creates a new dataset with multiple rows per case by assigning a set of variables in the original dataset to a single variable in the new dataset.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="MakeItems" type="sdtl:ReshapeItemDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">New variables created by this command.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="CaseNumberVariable" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">New variable identifying the case number in the wide data that created this row.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="IDVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">One or more variables identifying unique rows in the wide data.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="DropVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables to be dropped from the new dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="KeepVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables to be kept in the new dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="KeepNullCases" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">When set to TRUE, rows in which all constructed variables are missing are not deleted.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="CountByID" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">New variable with the number of cases in the long dataset that were created from the source row in the wide dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="CountByIDLabel" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Label for the CountByID variable.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ReshapeWide">
        <xs:annotation>
            <xs:documentation xml:lang="en">ReshapeWide is not supported in the current version of SDTL, because it depends on values in the data.  However, it may be useful when values of the index variable are available in the metadata file or the data can be processed.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="MakeItems" type="sdtl:ReshapeItemDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">New variables created by this command.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="IDVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">One or more variables identifying unique rows in the wide data.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="DropVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables to be dropped from the new dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="KeepVariables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Variables to be kept in the new dataset.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Save">
        <xs:annotation>
            <xs:documentation xml:lang="en">Writes a dataset to a file.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="1" name="FileName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of the file to be saved.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="Software" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The software package that works with the file.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="FileFormat">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of a file format</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="csv" />
                                <xs:enumeration value="txt" />
                                <xs:enumeration value="dat" />
                                <xs:enumeration value="xls" />
                                <xs:enumeration value="xlsx" />
                                <xs:enumeration value="sav" />
                                <xs:enumeration value="dta" />
                                <xs:enumeration value="sas7bdat" />
                                <xs:enumeration value="rds" />
                                <xs:enumeration value="rdata" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="IsCompressed" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Indicates whether the file format is compressed.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SetDataType">
        <xs:annotation>
            <xs:documentation xml:lang="en">Sets the data type of a variable.   
Examples:   

```
"dataType": "Text",
"subTypeSchema": "Stata 15.1",
"subType": "str1"
```

```
"dataType": "Numeric",
"subTypeSchema": "https://www.ddialliance.org/Specification/DDI-CV/DataType_1.0.html" ,
"subType": "Int"
```


</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variables that will have their type set</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="DataType">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">General type of a variable,  e.g.  "Text" or "Numeric".</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="Text" />
                                <xs:enumeration value="Numeric" />
                                <xs:enumeration value="Boolean" />
                                <xs:enumeration value="Date-Time" />
                                <xs:enumeration value="Factor" />
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="SubTypeSchema" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A vendor or standards body with a controlled vocabulary.  The value can be a URL.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="SubType" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name used in the associated schema.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SetDatasetProperty">
        <xs:annotation>
            <xs:documentation xml:lang="en">Changes a property of a dataframe.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="PropertyName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of the property to be set (for example, 'Title' or 'Subtitle').</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="Value" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The value of the property.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SetDisplayFormat">
        <xs:annotation>
            <xs:documentation xml:lang="en">Sets the display or output format for a variable.    
Examples:   
```
"displayFormatSchema": "SAS"
"displayFormatName": "DOLLAR6.2"
```

```
"displayFormatSchema": "Stata 15.1"
"displayFormatName": "%tcDDmonCCYY_HH:MM:SS"
```
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variables that will have their format set</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="DisplayFormatSchema" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A vendor or standards body with a controlled vocabulary.  The value can be a URL.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="DisplayFormatName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name used in the associated schema.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SetMissingValues">
        <xs:annotation>
            <xs:documentation xml:lang="en">Defines values that are treated as missing values for a list of variables.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The list of variables to which the missing values are assigned</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Values" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The values to be considered as missing values</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SetValueLabels">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes the assignment of labels to categorical values.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The variables to which a label will be assigned</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="unbounded" block="extension restriction" name="Labels" type="sdtl:ValueLabel">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The label to be assigned to the variables</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SetVariableLabel">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes the assignment of a label to a variable.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Variable" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of the variable to which a label will be assigned</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="Label" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The label to be assigned to the variable</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SortCases">
        <xs:annotation>
            <xs:documentation xml:lang="en">Sorts rows in the dataframe in a specified order.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:TransformBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" block="extension restriction" name="SortCriteria" type="sdtl:SortCriterion">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Describes how cases are sorted.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="SortCriterion">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes a criterion by which cases are sorted, including the variable name and whether to sort ascending or descending.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="Variable" type="sdtl:VariableReferenceBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The variable used to sort.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" name="SortDirection">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The direction in which to sort.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Ascending" />
                        <xs:enumeration value="Descending" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SourceInformation">
        <xs:annotation>
            <xs:documentation xml:lang="en">SourceInformation defines information about the original source of a data transform.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="LineNumberStart" type="xs:int">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The line number of the beginning of the transform code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="LineNumberEnd" type="xs:int">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The line number of the end of the transform code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceStartIndex" type="xs:int">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The character index of the beginning of the transform code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="SourceStopIndex" type="xs:int">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The character index of the end of the transform code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="OriginalSourceText" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The original source code of the data transform code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="ProcessedSourceText" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The source code of the data transform code after processing macros or loops</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="StringConstantExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A text string.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="Value" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A string</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="StringRangeExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">Defines a range of string values, such as "A to N".
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="RangeStart" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Starting value for range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="RangeEnd" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Ending value for range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="TimeDurationConstant">
        <xs:annotation>
            <xs:documentation xml:lang="en">A time duration constant expressed in ISO 8601 format.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="TimeDurationValue" type="sdtl:duration">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">A duration of time in ISO 8601 format</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="TransformBase" abstract="true">
        <xs:annotation>
            <xs:documentation xml:lang="en">TransformBase defines properties available for transform commands.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:CommandBase">
                <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" block="extension restriction" name="ProducesDataframe" type="sdtl:DataframeDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Signify the dataframe which this transform produces.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="unbounded" block="extension restriction" name="ConsumesDataframe" type="sdtl:DataframeDescription">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Signify the dataframe which this transform acts upon.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="UnhandledValuesExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">Represents any values not previously handled (for example, in a set of recode rules).
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Unsupported">
        <xs:annotation>
            <xs:documentation xml:lang="en">Describes an unsupported command. An unsupported command is valid syntax, but not supported by the parsing application.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:InformBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ValueLabel">
        <xs:annotation>
            <xs:documentation xml:lang="en">Associates a label with a  value in a categorical variable.
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="Value" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The value to which a label is assigned</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="1" maxOccurs="1" name="Label" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The label to be assigned to the value</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ValueListExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">Wraps a list of other expressions.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Values" type="sdtl:ExpressionBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The list of expressions.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="VariableListExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A list of variables which may include variable names (VariableSymbolExpression, CompositeVariableNameExpression), variable ranges (VariableRangeExpression), and variable lists.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Variables" type="sdtl:VariableReferenceBase">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">An array of variables and/or variable ranges</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="VariableRangeExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A list of variables in adjacent columns defined by the variable names of first and last columns.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="First" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Lowest variable name in range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="1" maxOccurs="1" name="Last" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Highest variable name in range</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="VariableReferenceBase" abstract="true">
        <xs:annotation>
            <xs:documentation xml:lang="en">Types used to describe variables in expressions.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:ExpressionBase">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="VariableSymbolExpression">
        <xs:annotation>
            <xs:documentation xml:lang="en">A reference to a variable.
</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="sdtl:VariableReferenceBase">
                <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="1" name="VariableName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">The name of a variable</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="Weight">
        <xs:annotation>
            <xs:documentation xml:lang="en">Weight describes the type of weight to apply and variables holding weights.   
</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="WeightVariable" type="sdtl:ExpressionBase">
                <xs:annotation>
                    <xs:documentation xml:lang="en">The variable used as a weight in the operation.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element minOccurs="0" maxOccurs="1" name="WeightType">
                <xs:annotation>
                    <xs:documentation xml:lang="en">Type of weight to use</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="frequency" />
                        <xs:enumeration value="probability" />
                        <xs:enumeration value="Stata_aweight" />
                        <xs:enumeration value="Stata_iweight" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ReferenceType">
        <xs:annotation>
            <xs:documentation xml:lang="en">An identification-only reference to any concrete item.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:group ref="sdtl:IdentificationGroup" />
            <xs:element minOccurs="1" maxOccurs="1" name="TypeOfObject">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Program" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
        <xs:attribute fixed="true" name="isReference" type="xs:boolean" />
    </xs:complexType>
    <xs:complexType name="ItemContainerType">
        <xs:annotation>
            <xs:documentation xml:lang="en">A sequence of top-level references followed by concrete item definitions.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="TopLevelReference" type="sdtl:ReferenceType" />
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="Program" type="sdtl:Program" />
            </xs:choice>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="ItemContainer" type="sdtl:ItemContainerType">
        <xs:annotation>
            <xs:documentation xml:lang="en">The root element for XML instances, containing the item type instances.</xs:documentation>
        </xs:annotation>
    </xs:element>
</xs:schema>