(: file: freq_1var_1year.xq date: 26-July-2010 11:12am GMT-03:00 author: Program created by dyn_freq_1var_1year.xq purpose: Outputs a frequency distribution for the variable stabbr in survey year 1984. usage: Run this program from its path location. example: zorba -f -q freq_1var_1year.xq -o freq_stabbr_1984.xml -z indent=yes :) { let $x := fn:doc("../xml/metadata/ipedsData.xml")/data/file[@year = "1984"][@type = "xml"], $fileName := $x/@name, $path := $x/@path, $xmlFile := concat($path, $fileName) for $i in fn:doc($xmlFile)/data/record/@stabbr let $label := fn:doc("../xml/metadata/ipedsVars_metadata_codes.xml")/variables/var[@name = "stabbr"][@year = "1984"]/code[@value = $i]/@label, $freq := 1 group by $i, $label order by $i return }