#! /bin/ksh

report-header Countries

line2="================================================================="
line1="-----------------------------------------------------------------"

echo "$line1
This report is a quick reference format of the HCI programs,
sorted by their country of location.  Each line includes:
 * the country of the program (within the United States,
   programs are sorted by their two-letter state abbreviation)
 * the 'code' for the program, based on the insitution and unit
 * the 'shortname' for the institution and academic unit,
   possibly truncated to fit within 80 characters
$line2"

country=%-34.34country
codename=%-14.14codename
shortname=%.29shortname
template="$country $codename $shortname"

for i in ${*-*}
do
	sssearch section=unit $i |
		ssadd -f codename -t ${i##*/} |
			ssformat -t "$template"
done | sort
