(: file: check_ipedsVars_freq.xq date: 10-June-2010 author: Gary Lewis purpose: Returns a frequency distribution showing the number of variables by the number of years they are represented in the IPEDS directory data files. use: Run program from its path location. example: zorba -f -q check_ipedsVars_freq.xq -z indent=yes :) { let $tmp := for $i in fn:doc("../xml/metadata/ipedsVars.xml")/variables/var let $name := $i/@name, $year := $i/@year group by $name return return let $tmp2 := for $j in $tmp let $name := $j/@name, $years := $j/@years group by $years return return for $k in $tmp2 order by xs:integer($k/@years) return $k }