(: OBSOLETED! date: 27-August-2010 author: Gary Lewis note: The procedure for verifying data moved to staging and the warehouse is now generalized so it does not require variable specific XQuery programs. See: freq_1var_stgPop_by_year.xq freq_1var_stg2whPop_by_year.xq freq_1var_whPop_by_year.xq :) (: file: rControl_freq.xq date: 06-August-2010 author: Gary Lewis purpose: Frequency distribution by year for the variable rControl in the warehouse XML whPop.xml. usage: Run from path where program is located. example: zorba -f -q rControl_freq.xq -o rControl_freq.xml -z indent=yes :) { for $i in fn:doc("../xml/warehouse/whPop.xml")/whPop/survey let $year := $i/@year order by $year descending return { for $j in $i/inst let $unitid := $j/@unitid, $rControl := xs:integer($j/@rControl) group by $rControl order by $rControl ascending return } }