#!/usr/bin/perl
### $Id:$
### Report on applications

open(APP, "< /p/stat/Data/admin/Applicants") ||
    die "Unable to open Applicants database for reading $!\n";

$= = 50;
while (<APP>) {
    local(
	$lastname	#varchar(25) not null,
        ,$firstname	#varchar(25) not null,
        ,$univid		#unividtype not null,	/* university id (key field) */
		#/* undergrad school, major and gpa */
        ,$uschool		#varchar(30) not null,
        ,$umajor		#varchar(25) null,
        ,$ugpa		#real null,
        ,$ugpaof		#real null,
        ,$classrank	#smallint null,
        ,$classrankof	#smallint null,
		#/* highest schooling */
        ,$hidegree	#char(1) null,
        ,$hischool	#varchar(30) null,
        ,$himajor		#varchar(25) null,
        ,$higpa		#real null,
				# /* other schooling */
	,$otdegree      #char(1) null,
        ,$otschool      #varchar(30) null,
        ,$otmajor       #varchar(25) null,
        ,$otgpa         #real null
		#/* GRE scores and percentages */
        ,$verblgre	#smallint null,
        ,$verblgrep	#tinyint null,
        ,$quantgre	#smallint null,
        ,$quantgrep	#tinyint null,
        ,$analytgre	#smallint null,
        ,$analytgrep	#tinyint null,
        ,$advgre		#smallint null,
        ,$advgrep		#tinyint null,
        ,$advgretopic	#varchar(20) null,
		#/* other test scores */
        ,$toefl		#smallint null,
        ,$tse		#real null,
        ,$michigan	#real null,
		#/* misc */
        ,$interestarea	#varchar(10) null,
        ,$degreedesrd	#char(1) null,		/* 'M'asters or 'P'hd */
        ,$aiddesired	#char(1) not null,
        ,$aidrequired	#char(1) not null,
        ,$appstatus	#char(1) not null,
        ,$aidstatus	#char(1) not null,
        ,$appnotes	#varchar(25) null,
        ,$response	#char(1) not null,	/* are they coming here?(Y,$N) */
        ,$aidonly		#char(1) not null,
        ,$email		#varchar(50) null,
        ,$lettersent	#datetime null,
        ,$lettersentto	#char(1) null,
        ,$sex		#char(1) null,
        ,$ethnic		#ethnictype null,
        ,$visa		#char(1) null,
        ,$citizenship	#varchar(25) null,
        ,$opened		#datetime null,
        ,$updated		#datetime null,
		#/* postal address info */
        ,$permaddr1       #varchar(50)     null,
        ,$permaddr2       #varchar(50)     null,
        ,$permcity        #varchar(25)     null,
        ,$permstate       #char(2)         null,
        ,$permcountry     #varchar(20)     null,
        ,$permzip         #varchar(10)     null,
        ,$permphone       #phonenumtype    null,
        ,$curaddr1        #varchar(50)     null,
        ,$curaddr2        #varchar(50)     null,
        ,$curcity         #varchar(25)     null,
        ,$curstate        #char(2)         null,
        ,$curcountry      #varchar(20)     null,
        ,$curzip          #varchar(10)     null,
        ,$curphone        #phonenumtype    null,
        ,$middleinit	#char(1) null,
        ,$usorperm	#char(1) null,
        ,$code		#char(2) not null
	  ) = split(/:/, $_);
    $name = $lastname . ", " . $firstname . " " . $middleinit;
    write;
}

format top =
                                               Applicant Information
Name               Sex   Home   GPA              GRE           Toef Dgree   Highest         Undergrad       Other
                       Country      verb pct quan pct anly pct      Dsrd Dgree  School      School          School
------              -  ------- ---- ---- --- ---- --- ---- --- ---- ---  --- ------------- --------------- ----------
.

format STDOUT =
@<<<<<<<<<<<<<<<<<< @ @<<<<<<< @>>>>@###@###@####@###@####@###@####  @ @>>> @<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<<
$name,$sex,$curcountry,$higpa,$verblgre,$verblgrep,$quantgre,$quantgrep,$analytgre,$analytgrep,$toefl,$degreedesrd,$hidegree,$hischool,$uschool,$otschool
.
