<?xml version="1.0" encoding="UTF-8"?>

<!-- <!DOCTYPE sddlschema SYSTEM "sddlschema.xsd">-->

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:  PRODUCT_CODE.SDDL -->
<!-- -->
<!--  Purpose:      This SDDL file defines the product_code relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       PR      Who                       Reason-->
<!--  - - - -    - - - -   - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  03/11/97   33526     Baum  Initial implementation-->
<lm>  07/03/03   48821     CTB   Converted to XML format </lm> <!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

    <record name="PRODCODE_TYPE"> 
 
 
            <description>This relation is used to provide the tool, UPDATE_QODATA,
                       with a mechanism to assign a product_id and member_name
                       (of a product) for NICMOS or any that has multiple 
                       products. The product_id is correlated with the unique
                       value of EXP_TYPE in qeassociation table. This is a one
                       character product_id that supercedes the last character
                       of the association_id to form the member-name of a 
                       product.</description>

 
            <field name="si_name">
                    <type>C4</type>
                    <description>This is the identifier type for a Science Instrument (SI).
		     The current SI list for qeassociation candidates are:

			NIC  - NICMOS - Near IR Camera - Multi-Object Spectr.
			STIS - Space Telescope Infrared Spectrograph

                     STIS only has one product_id but many exp_type values and
                     will not appear in this table.</description>
            </field>

            <field name="exp_type">
                    <type>C12</type>
                    <description>This field describes the role of the exposure in the
                         association.  Valid values for NICMOS exposures are
                         (EXP-TARG, EXP-BCK1, EXP-BCK2, ..., EXP-BCK8)."  </description>
            </field>

            <field name="product_id">
                    <type>C1</type>
                    <description>This is the last character of an member_id of a
                         product. The first eight characters of the id are the
                         same as the association_id. The first product_id is 0
                         which forms a member_name that is the same as the 
                         association_id.</description>
            </field>

        <relation name="product_code">
 
            <type>PRODCODE_TYPE</type>

            <description>Assign product_id by exp_type.</description>

            <subsystem_using>OPUS</subsystem_using>

            <index name="product_code_1">
                <type>unique clustered</type>
                <field name="si_name"/>
                <field name="exp_type"/>
                <field name="product_id"/>
            </index>

        </relation>
    </record>
</sddl>
