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

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

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:  QODATASETS.SDDL -->
<!-- -->
<!--  Purpose:      This SDDL file defines the qodatasets relation.-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       PR      Who                       Reason-->
<!--  - - - -    - - - -   - -   - - - - - - - - - - - - - - - - - - - - - -->
<!--  05/09/96   31365     JJB  Original implementation-->
<lm>  07/03/03   48821     CTB   Converted to XML format </lm> <!-- last mod -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

    <record name="QODATA_TYPE"> 
 
            <description>This relation is used to provide OPUS with the counts
                       of the number of datasets for a particular SMS_ID 
                       (used for support schedule generation identified by
                       its CCL name) for a PI for a program_id. The values 
                       will be set into support schedule keywords. </description>

 
            <field name="sms_id">
                    <type>C9</type>
                    <description><![CDATA[The C&C list is a major data structure within SPSS that 
		    contains information on 'candidates' and the 'calendar'.

		    The candidate data, often referred to as the candidate
		    pool, are scheduling units and their associated 
		    observation set, alignment, and target data.  

		    The calendar is a timeline of activities that are laid 
		    down by the SPSS scheduling utilities.  Example 
		    activities include slews, PCS aquisitions, small angle 
		    maneuvers, science, TDRS contacts, tape recordings, 
		    science instrument reconfigurations, and others.

		    When a C&C List is saved in SPSS (via the cclist -save 
		    comand) it receives an identifier.  The identifier can
		    be up to 9 characters long.  Within operations, the C&C
		    list naming convention is:    yydddnxx 

		    where          yy  = last two digits of the year
				   ddd = day of year of start of calendar
				     n = length of calendar in days (usually 7)
				    xx = unique identifier within above info.
                                    ]]> </description>

            </field>

            <field name="program_id">
                    <type>C3</type>
                    <units>BASE_36</units>
                    <description>When a proposal is accepted into the PMDB by SPSS it must
		    be assigned a unique 3 character base 36 program identifier.
		    This is done by the pmdb -accept_prop command or -pmdb -load.
                    This program 
		    identifier is tagged as 'program_id' in most PMDB relations.
                    It is used for identification of proposals by spacecraft 
                    and PODPS software. It is also used in the PODPS and DADS 
                    rootname for all archived science data files. 
                    Because of flight design software, program_id must be
                    three characters.</description>
            </field>

            <field name="ndatasets">
	            <type>I2</type>
	            <description>Number of datasets for exposures and association 
                         products to be sent to the proposal PI. Exposure 
                         datasets already included in products and not 
                         redundantly sent to the PI are not counted. </description>
            </field>

            <field name="last_obs_time">
                    <type>C17</type>
                    <units>UTC</units>
	            <description>Last pred_strt_tm for all QOBSERVATION records for
                     this sms_id and program_id. This is in the standard SOGS
                     format - yyyy.ddd:hh:mm:ss
		     where yyyy = year
			    ddd = day of year
			     hh = hours
			     mm = minutes
			     ss = seconds</description>
            </field>

    </record>

    <relation name="qodatasets">
 
        <type>QODATA_TYPE</type>

        <description>Program Datasets Relation</description>

        <subsystem_using>OPUS</subsystem_using>

        <index name="qodatasets_1">
            <type>unique clustered</type>
            <field name="sms_id"/>
            <field name="program_id"/>
        </index>

    </relation>
</sddl>
