[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::bb_rotis

Title:Baseball Rotisserie Notes Conference
Moderator:EVMS::WRIDE
Created:Thu Apr 16 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:136
Total number of notes:3417

10.0. "RLS.COM" by FREE::GOGUEN (A closed mouth gathers no feet) Fri Apr 17 1992 13:35

T.RTitleUserPersonal
Name
DateLines
10.1FREE::GOGUENA closed mouth gathers no feetThu Jun 18 1992 17:254
10.2Pulldown Transactions from BB_STATSSALEM::KUPTONKEN IN ROUGHFri Jun 19 1992 12:438
10.3FREE::GOGUENA closed mouth gathers no feetFri Jun 19 1992 13:231
10.4SHANE::PACIELLOFri Jun 19 1992 13:4827
10.5FREE::GOGUENA closed mouth gathers no feetFri Jun 19 1992 16:0737
10.6CERBUS::KARLSONOnly 189 shopping days until Xmas!Fri Jun 19 1992 16:212
10.7EMACS -- gimme a break... :-)FREE::GOGUENA closed mouth gathers no feetFri Jun 19 1992 16:244
10.8Hey, Don, where's the WPS-Plus support?PLUGH::NEEDLEMoney talks. Mine says "Good-Bye!"Sat Jun 20 1992 05:050
10.9FREE::GOGUENA closed mouth gathers no feetSun Jun 21 1992 21:349
10.10SHANE::PACIELLOMon Jun 22 1992 13:314
10.11don't need 'em any more with UPDATE_ROSTERFREE::GOGUENA closed mouth gathers no feetMon Jun 22 1992 13:365
10.12SHANE::PACIELLOMon Jun 22 1992 14:0813
10.13FREE::GOGUENA closed mouth gathers no feetMon Jun 22 1992 19:053
10.14ask and you shall receiveFREE::GOGUENA closed mouth gathers no feetMon Jun 22 1992 19:417
10.15POST.LOG;32767 :-)FREE::GOGUENA closed mouth gathers no feetThu Jun 25 1992 19:136
10.16PLUGH::NEEDLEMoney talks. Mine says "Good-Bye!"Thu Jun 25 1992 23:3918
10.17FREE::GOGUENA closed mouth gathers no feetFri Jun 26 1992 14:373
10.18PLUGH::NEEDLEMoney talks. Mine says "Good-Bye!"Sat Jun 27 1992 20:5318
10.19good ideaFREE::GOGUENA closed mouth gathers no feetMon Jun 29 1992 13:3320
10.20SHANE::PACIELLOMon Jun 29 1992 13:571
10.21trust me. I *know*CERBUS::KARLSONOnly 179 shopping days until Xmas!Mon Jun 29 1992 14:055
10.22A dissenting opinionGUESS::CARRI'm so glad its summertime...Mon Jun 29 1992 15:087
10.23FREE::GOGUENA closed mouth gathers no feetMon Jun 29 1992 16:3514
10.24Oh yeah Roy, about BKSTATS - there's one more thing...PLUGH::NEEDLEMoney talks. Mine says "Good-Bye!"Mon Jun 29 1992 17:396
10.25CoolGUESS::CARRIf not you, who? If not now, when?Mon Jun 29 1992 19:021
10.26FREE::GOGUENA closed mouth gathers no feetMon Jul 06 1992 18:2841
10.27FREE::GOGUENA closed mouth gathers no feetMon Jul 06 1992 18:554
10.28FREE::GOGUENA closed mouth gathers no feetMon Jul 06 1992 19:021
10.29FREE::GOGUENA closed mouth gathers no feetMon Jul 06 1992 20:419
10.30Can you imagine playing Rotis back then ???SHALOT::HUNTEverybody Wang Chung TonightMon Jul 06 1992 21:497
10.31FREE::GOGUENA closed mouth gathers no feetTue Jul 07 1992 13:119
10.32SHANE::PACIELLOSun Sep 06 1992 03:0712
10.33FREE::GOGUENRhymes with Hoguen (oops, Hogan :-)Tue Sep 08 1992 13:1712
10.34CSLALL::BRULEOne week to opening day?Tue Mar 30 1993 12:0732
10.35FREE::GOGUENMy golf clubs are getting boredTue Mar 30 1993 13:435
10.36CSLALL::BRULEOne week to opening day?Tue Mar 30 1993 14:065
10.37let me log in again??FREE::GOGUENMy golf clubs are getting boredTue Mar 30 1993 16:371
10.38CSLALL::BRULEOne week to opening day?Tue Mar 30 1993 18:284
10.39Changes for Internet-style addressesEVMS::WRIDERemember what the Dormouse saidFri Apr 11 1997 01:017
I had problems sending to Internet-style addresses with RLS.COM (e.g. 
wride@evms.zko.dec.com) so I made a few changes to make it work. I'll 
post the RLS.COM that I'm using as the next reply but I don't know 
whether I started with the latest version or not. I guess the 
standard disclaimer applies - "Your milage may vary." 

                              Steve
10.40RLS.COMEVMS::WRIDERemember what the Dormouse saidFri Apr 11 1997 01:021846
$!				*****************
$!				**** RLS.COM ****
$!				*****************
$!
$!			 ROTISSERIE LEAGUE STATISTICIAN
$!
$!		     Created by:  Don Goguen  (FREE::Goguen)
$!
$!  THIS COMMAND PROCEDURE WILL PROVIDE FULL SYSTEM SUPPORT FOR A ROTISSERIE
$!  LEAGUE STATISTICIAN FOR ONE OR MORE ROTISSERIE BASEBALL LEAGUES.
$!
$	set noverify
$!
$! ===========================
$! INITIALIZE ERROR CONDITIONS
$! ===========================
$!
$	on control_y then goto finished
$	on control_c then goto finished
$	on error then goto show_menu
$	on warning then goto show_menu
$	on severe_error then goto finished
$!
$! ====================================
$! SAVE CONTEXT FOR RESTORING UPON EXIT
$! ====================================
$!
$	wrap = f$getdvi("tt:","tt_wrap")
$	lines_per_page = f$getdvi("tt:","tt_page")
$	nobroad = f$getdvi("tt:","tt_nobrdcst")
$	set term /nowrap /nobroad
$!
$! ========
$! GET YEAR
$! ========
$!
$	time	:= "''f$time()'" 
$	year	:= 'f$extract(7,4,time)'
$!
$! =================================
$! SHORTEN OUTPUT AND SEARCH SYMBOLS
$! =================================
$!
$	wso	:= write sys$output
$	sea	:= search /nolog /nohead /nohigh
$!
$! =========
$! VARIABLES
$! =========
$!
$	If f$trnlnm("RLS$") .eqs. "" then define RLS$ 'f$environment("default")'
$	rls$dir	= f$trnlnm("RLS$")
$	rotis$  = f$extract(0,f$length(rls$dir)-1,rls$dir)
$	stats$	= "''rotis$'.STATS]"
$	mode	= f$trnlnm("RLS$COMMAND")
$	suppl	= 0
$	spring	= 90
$	prior	= 98
$	lge	= ""
$	frz 	= ""
$	l_frz	= ""
$	n_frz	= ""
$	pre_yn	= "Y"
$	clear	= "CLEAR"
$!
$! ============
$! DEFINE VERBS
$! ============
$!
$       vr	:== $rls$:vr.exe
$	rsort	:== $rls$:alphabetize.exe
$	set command rls$:avail
$!
$! ============================================
$! READ RLS.TXT FOR LEAGUE-SPECIFIC INFORMATION
$! ============================================
$!
$	file = "''rls$dir'rls.txt"
$	open /read fspec 'file
$	read /end=read_error fspec rec
$	gosub skip_comments
$	editor = f$edit(rec,"TRIM")
$	editing := "''editor'"
$	gosub skip_comments
$	menu_size = f$edit(rec,"TRIM")
$	read /end=read_error fspec rec
$	long_window = f$edit(rec,"TRIM")
$	read /end=read_error fspec rec
$	wide_screen = f$edit(rec,"TRIM")
$	gosub skip_comments
$	leagues = f$edit(rec,"TRIM")
$	gosub skip_comments
$	types = f$edit(rec,"TRIM")
$	gosub skip_comments
$	no_teams = f$edit(rec,"TRIM")
$	gosub skip_comments
$	max_keepers = f$edit(rec,"TRIM")
$	gosub skip_comments
$	confs = f$edit(rec,"TRIM")
$	gosub skip_comments
$	roster_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	trans_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	freemove_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	standings_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	delta_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	team_tot_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	owner_stats = f$edit(rec,"TRIM")
$	gosub skip_comments
$	avail_pit_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	avail_bat_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	pos_elig_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	draft_nums = f$edit(rec,"TRIM")
$	gosub skip_comments
$	th1 = f$edit(rec,"TRIM")
$	gosub skip_comments
$	th2 = f$edit(rec,"TRIM")
$	gosub skip_comments
$	dline_day = f$edit(rec,"TRIM")
$	read /end=read_error fspec rec
$	dline_time = f$edit(rec,"TRIM")
$	gosub skip_comments
$	rating_file = f$edit(rec,"TRIM")
$	read /end=read_error fspec rec
$	gosub skip_comments
$	owners_0 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_1 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_2 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_3 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_4 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_5 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_6 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_7 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_8 = f$edit(rec,"TRIM")
$	read /end=no_more fspec rec
$	owners_9 = f$edit(rec,"TRIM")
$NO_MORE:
$	close fspec
$!
$! =======================
$! READ DISTRIBUTION LISTS
$! =======================
$!
$	num = 0
$DIS:
$       ac = ""
$       ow = ""
$       nk = ""
$	y = f$element(num,";",leagues)
$	if y .eqs. ";" then goto params
$	x = f$element(num,";",no_teams)
$       dist = "''rls$dir'''y'.DIS"
$	count = 0
$       open /read fspec 'dist
$	gosub skip_comments
$DIS1:
$	count = count + 1
$	cmp_rec = f$edit(rec,"COMPRESS,TRIM")
$	at = f$element(0," ",cmp_rec)
$	if f$locate("@",at) .lt. f$length(at) then at = """" + at + """"
$	ac = ac + at
$	ow = ow + f$element(2," ",cmp_rec)
$	if f$extract(f$length(ow)-1,1,ow) .eqs. "'" then -
	  ow = f$extract(0,f$length(ow)-1,ow)
$	if f$extract(f$length(ow)-2,2,ow) .eqs. "'s" then -
	  ow = f$extract(0,f$length(ow)-2,ow)
$	nk = nk + f$element(3," ",cmp_rec)
$	if f$element(4," ",cmp_rec) .nes. " " then -
	  nk = nk + " ''f$element(4," ",cmp_rec)'"
$	if f$element(5," ",cmp_rec) .nes. " " then -
	  nk = nk + " ''f$element(5," ",cmp_rec)'"
$	if count .eq. x then goto dis2
$	ac = ac + ";"
$	ow = ow + ";"
$	nk = nk + ";"
$       read /end=dis2 fspec rec
$       goto dis1
$DIS2:
$       accounts_'num = ac
$       all_owners_'num = "''ow'"
$       all_nicks_'num = "''nk'"
$	close fspec
$	num = num + 1
$	goto dis
$!
$! ====================================================================
$! PROCESS OPTIONAL PARAMETERS: p1 = league acronym; p2 = freeze number
$! ====================================================================
$!
$PARAMS:
$	if p1 .eqs. "" then goto show_menu
$	lge = p1
$	if p2 .nes. "" 
$	then 
$	    frz = p2
$	    if f$length(frz) .eq. 1 then frz = "0''frz'"
$	    if frz .ne. 0 
$	    then
$		l_frz = frz - 1
$		if f$length(l_frz) .eq. 1 then l_frz = "0''l_frz'"
$		n_frz = frz + 1
$		if f$length(n_frz) .eq. 1 then n_frz = "0''n_frz'"
$	    else
$		l_frz = ""
$		n_frz = ""
$	    endif
$	endif
$	goto cl1
$!
$! ==============================================================
$! PROCESSING FOR CHOICES MADE WITHOUT SETTING A LEAGUE OR FREEZE
$! ==============================================================
$!
$NCL:
$	if mode .eqs. "EXPERT"
$	then
$	    wso "No current league set ..."
$	else
$	    wso "No current league set ..."
$	endif
$	wait 00:00:01
$	if mode .nes. "EXPERT" then wso ""
$	goto show_menu
$NCF:
$	if mode .eqs. "EXPERT"
$	then
$	    wso "No current freeze set ..."
$	else
$	    wso "No current freeze set ..."
$	endif
$	wait 00:00:01
$	if mode .nes. "EXPERT" then wso ""
$!
$! ================
$! DISPLAY THE MENU
$! ================
$!
$SHOW_MENU:
$	wso ""
$	if frz .ge. spring
$	then
$	    values =	"DC;DM;DU;DP;NC;SF;SD;SP;RM;RU;RP;RC;GS;GO;GF;" + -
			"GR;GP;GT;GA;GZ;CL;CF;PV;PP;MR;MS;MP;EX"
$	    exp_vals =	"DRAFT {dc,dm,du,dp}; NOTES {nc}; " + -
			"STATS {sf,sd,sp};

ROSTERS {rm,ru,rp,rc}; " + -
			"GET DATA {gs,go,gf,gr,gp,gt,ga,gz};

" + -
			"CURRENT {cl,cf}; POSITIONS {pv,pp}; "  + -
			"MISCELLANEOUS {mr,ms,mp}; EX"
$	else
$	    values =	"TM;TN;TP;TR;FM;FP;SF;SD;SP;RM;RU;RP;RC;GS;GO;GF;" + -
			"GR;GP;GT;GA;GZ;CL;CF;PV;PP;MR;MS;MP;EX"
$	    exp_vals =	"TRANSACTIONS {tm,tn,tp,tr}; FREE MOVES {fm,fp}; " + -
			"STATS {sf,sd,sp};

ROSTERS {rm,ru,rp,rc}; " + -
			"GET DATA {gs,go,gf,gr,gp,gt,ga,gz};

" + -
			"CURRENT {cl,cf}; POSITIONS {pv,pp}; "  + -
			"MISCELLANEOUS {mr,ms,mp}; EX"
$	endif
$	if mode .eqs. "EXPERT" then goto get_choice
$	if clear .eqs. "CLEAR"
$	then
$	    wso ""
$	    set term /page='menu_size' 
$	    set term /width=80
$	endif
$!
$	wso "#3     ROTISSERIE LEAGUE STATISTICIAN     "
$	wso "#4     ROTISSERIE LEAGUE STATISTICIAN     "
$!
$	if frz .ge. spring
$	then
$	    wso "DRAFT:       "
$	    wso " DC   Create New Round"
$	    wso " DM   Modify       "
$	    wso " DU   Update"
$	    wso " DP   Post "
$!
$	    wso "NOTES:     
$	    wso " NC   Create for"
$	    wso "        new season"
$	else
$	    wso "TRANSACTIONS:"
$	    wso " TM   Modify          "
$	    wso " TN   Notify Owners"
$	    wso " TP   Post  "
$	    wso " TR   Reset"
$!
$	    wso "FREE MOVES:
$	    wso " FM   Modify    "
$	    wso " FP   Post        "
$	endif
$!
$	wso "STATS PROCESSING:
$	wso " SF   Freeze"
$	wso " SD   Delta"
$	wso " SP   Post & mail"
$!
$	wso "ROSTERS:
$	wso " RM   Modify (manual)"
$	wso " RU   Update (auto)"
$	wso " RP   Post"
$	wso " RC   Copy"
$!
$	wso "GET DATA:
$	wso " GS   Standings"
$	wso " GO   Owner stats"
$	wso " GF   Free agents"
$	wso " GR   Roster"
$	wso " GP   Player stats"
$	wso " GT   Team stats"
$	wso " GA   Affiliation"
$	if rating_file .nes. "" then -
	  wso " GZ   player rating"
$!
$	wso "CURRENT SETTINGS:
$	wso " CL   League"
$	wso "(''lge')"
$	wso " CF   Freeze"
$	wso "(''frz')"
$!
$	wso "POSITION ELIGIBILITY:
$	wso " PV   Verify"
$	wso " PP   Post"
$!
$	wso "MISCELLANEOUS:
$	wso " MR   Refresh screen"
$	wso " MS   Spawn to DCL"
$	wso " MP   Purge"
$	wso " EX   EXit"
$!
$! =====================================================
$! OBTAIN A MENU SELECTION FROM THE USER AND VALIDATE IT
$! =====================================================
$!
$GET_CHOICE:
$	if mode .eqs. "EXPERT"
$	then
$	    wso ""
$	    wso "League:  ''lge'"
$	    wso "Freeze:  ''frz'"
$	    wso ""
$	    read /prompt="''exp_vals' > " /end=get_choice sys$command choice
$	    choice = f$edit(choice,"UPCASE,TRIM")
$	else
$	    read -
	      /prompt="CHOICE >     " -
	      /end=get_choice sys$command choice
$	    choice = f$edit(choice,"UPCASE,TRIM")
$	    wso ""
$	endif
$VALIDATE:
$	num = 0
$LOOP1:
$	y = f$element(num,";",values)
$	if y .eqs. ";" 
$	then
$	    if mode .eqs. "EXPERT"
$	    then
$		wso "Invalid option  ..."
$	    else
$		wso "Invalid option ..."
$	    endif
$	    wait 00:00:01
$	    if mode .nes. "EXPERT" then wso ""
$	    goto get_choice
$	endif
$	if choice .nes. y then goto skip1
$	goto 'y'
$SKIP1:
$	num = num + 1
$	goto loop1
$!
$! ==================
$! SET CURRENT LEAGUE
$! ==================
$!
$CL:
$	clear	= ""
$	lge = ""
$	if mode .eqs. "EXPERT"
$	then
$	    read /prompt="League > " /end=show_menu sys$command lge 
$	    lge = f$edit(lge,"UPCASE,TRIM")
$	else
$	    wso ""
$	    read /prompt="> " /end=show_menu sys$command lge 
$	    lge = f$edit(lge,"UPCASE,TRIM")
$	    wso " (''lge')"
$	endif
$CL1:
$	num = 0
$CL2:
$	y = f$element(num,";",leagues)
$	if y .eqs. ";" then goto cl
$	if lge .eqs. y then goto cl3
$	num = num + 1
$	goto cl2
$CL3:
$	lge_num = num
$	lge$	= "''rotis$'.''lge']"
$	del$	= "''rotis$'.''lge'.delta]"
$	if p2 .nes. "" then goto cf1
$	goto show_menu
$!
$! =========================
$! SET CURRENT FREEZE NUMBER
$! =========================
$!
$CF:
$	clear	= ""
$	frz = ""
$	if mode .eqs. "EXPERT" 
$	then
$	    wso ""
$	    wso " 0       = supplemental draft"
$	    wso " 1 -> 89 = regular season (typically 1-26)"
$	    wso "90 -> 97 = spring training stats"
$	    wso "98       = last season's stats"
$	    wso ""
$	    read /prompt="Freeze > " /end=show_menu sys$command frz
$	else
$	    wso "0: supp;  1-26: in-season; 90-97: spring; 98: last yr"
$	    wso ""
$	    read /prompt="> " /end=show_menu sys$command frz
$	    wso " (''frz')"
$	    wso ""
$	endif
$CF1:
$	if f$type(frz) .nes. "INTEGER" then goto cf
$	if frz .lt. suppl .or. frz .gt. prior then goto cf
$	if f$length(frz) .eq. 1 then frz = "0''frz'"
$	l_frz = frz - 1
$	if f$length(l_frz) .eq. 1 then l_frz = "0''l_frz'"
$	n_frz = frz + 1
$	if f$length(n_frz) .eq. 1 then n_frz = "0''n_frz'"
$	goto show_menu
$!
$! ===============================
$! TRANSACTIONS: FILE MODIFICATION
$! ===============================
$!
$TM:
$	gosub clear_it
$	temp = "''rls$dir'''lge'.trans"
$	assign /user 'f$logical("SYS$COMMAND") sys$input:
$	editing  'temp
$	goto show_menu
$!
$! ====================================
$! TRANSACTIONS: NOTIFICATION OF OWNERS
$! ====================================
$!
$TN:
$	gosub clear_long
$	f1 = "''rls$dir'''lge'.trans"
$	type /page 'f1
$	wso ""
$!
$	send_to = "@rls$:''lge'.dis"
$	read /prompt="To: [A]ll, (P)ending, (O)ther > " /end=tn1 -
	  sys$command xx
$	xx = f$edit(xx,"UPCASE,TRIM")
$	if xx .eqs. "O" then -
	  read /prompt="To > " /end=tn1 sys$command send_to
$	if xx .eqs. "P" 
$	then
$	    define /user league$dis "''rls$dir'''lge'.dis"
$	    define /user trans$file "''rls$dir'''lge'.trans"
$	    define /user pending$dis "''rls$dir'pending.dis"
$	    run rls$:pending_trans
$	    send_to = "@rls$:pending.dis"
$	    wso ""
$	    wso "Transactions will be sent to:"
$	    wso ""
$	    type rls$:pending.dis
$	    wso ""
$	endif
$!
$	ccopy = ""
$	read /prompt="CC: > " /end=tn1 sys$command ccopy
$	wso ""
$!
$	subj = "''lge' transactions: due ''dline_day' at ''dline_time'"
$	read /prompt="Subj: [R]egular, (D)eadline, (F)inal, (O)ther > " -
	  /end=tn1 sys$command dd
$	dd = f$edit(dd,"UPCASE,TRIM")
$	if dd .eqs. "O" then -
	  read /prompt="Subj > " /end=tn1 sys$command subj
$	if dd .eqs. "D" then -
	  subj = "''lge' transactions: due TODAY at 4:00"
$	if dd .eqs. "F" then -
	  subj = "FINAL ''lge' transactions for freeze ''frz'"
$!
$	if ccopy .eqs. ""
$	then
$	    mail /sub="''subj'" 'f1 "''send_to'"
$	else
$	    mail /sub="''subj'" 'f1 "''send_to', ''ccopy'"
$	endif
$	wso "Transactions mailed ..."
$	wait 00:00:01
$TN1:
$	if mode .nes. "EXPERT" then set term /page='menu_size'
$	goto show_menu
$!
$! =====================
$! TRANSACTIONS: POSTING
$! =====================
$!
$TP:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	f1 = "''rls$dir'post.temp"
$	open /write temp 'f1
$	write temp "$ notes"
$	write temp "open /noauto ''f$element(lge_num,";",confs)'"
$	write temp "set mod"
$	write temp "''f$element(lge_num,";",trans_nums)'.LAST"
$	gosub del_prev
$	if y_n .nes. "Y" then goto tp1
$	write temp "del"
$	write temp "y"
$TP1:
$	write temp "reply /noed ''rls$dir'''lge'.trans"
$	gosub note_title
$	submit /nonotify /noprint /noidentify 'f1
$	goto get_choice
$!
$! ========================
$! TRANSACTIONS: FILE RESET
$! ========================
$!
$TR:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	f1 = "''rls$dir'''lge'.trans"
$	f2 = "''rls$dir'''lge'.alltrans"
$	assign /user _nla0: sys$error
$	assign /user _nla0: sys$output
$	dir /brief 'f2
$	if $status then goto tr1
$	create 'f2
$TR1:
$	open /read t1 'f1
$	open /append t2 'f2
$	open /write t3 'f1
$	write t2 ""
$	read /end=tr3 t1 rec
$	write t2 rec
$	write t3 rec
$	read /end=tr3 t1 rec
$	write t2 rec
$	date = f$extract(f$length(rec)-5,5,rec)
$TR2:
$	newdate = ""
$	if mode .eqs. "EXPERT"
$	then
$	    read /prompt="New effective date (old date was ''date') > " -
	      /end=trz sys$command newdate
$	else
$	    read /prompt="New effective date (old date was ''date') >        " -
	      /end=trz sys$command newdate
$	    wso ""
$	endif
$	if newdate .eqs. "" then goto tr2
$TRZ:
$	write t3 "''f$extract(0,f$length(rec)-5,rec)'''newdate'"
$	l = 0
$TR3:
$	read /end=tr4 t1 rec
$	write t2 rec
$	write t3 rec
$	l = l + 1
$	if l .lt. 6 then goto tr3
$	owner = ""
$	prev_owner = ""
$	l = 1
$TR4:
$	read /end=tr5 t1 rec
$	if rec .eqs. ""
$	then
$	    write t2 ""
$	else
$	    if f$extract(0,1,rec) .nes. " "
$	    then
$		prev_owner = owner
$		owner = f$extract(0,12,rec)
$	    endif
$	    if f$extract(f$length(rec)-1,1,rec) .eqs. "*"
$	    then
$		write t2 "''f$extract(0,50,rec)'(LATE)"
$		if owner .eqs. prev_owner
$		then
$		    write t3 "            *''f$extract(13,f$length(rec)-12,rec)'"
$		else
$		    if l .eq. 0 then write t3 ""
$		    l = 0
$		    write t3 "''owner'*''f$extract(13,f$length(rec)-12,rec)'"
$		    prev_owner = owner
$		endif
$	    else
$		write t2 rec
$	    endif
$	endif
$	goto tr4
$TR5:
$	close t1
$	close t2
$	close t3
$	goto get_choice
$!
$! =============================
$! FREE MOVES: FILE MODIFICATION
$! =============================
$!
$FM:
$	gosub clear_it
$	temp = "''rls$dir'''lge'.freemoves"
$	assign /user 'f$logical("SYS$COMMAND") sys$input:
$	editing  'temp
$	goto show_menu
$!
$! ===================
$! FREE MOVES: POSTING
$! ===================
$!
$FP:
$	clear = ""
$	if lge .eqs. "" then goto ncl
$	f1 = "''rls$dir'post.temp"
$	open /write temp 'f1
$	write temp "$ notes"
$	write temp "open /noauto ''f$element(lge_num,";",confs)'"
$	write temp "set mod"
$	write temp "''f$element(lge_num,";",freemove_nums)'.LAST"
$	gosub del_prev
$	if y_n .nes. "Y" then goto fp1
$	write temp "del"
$	write temp "y"
$FP1:
$	write temp "reply /noed ''rls$dir'''lge'.freemoves"
$	gosub note_title
$	submit /nonotify /noprint /noidentify 'f1
$	goto get_choice
$!
$! ========================
$! STATS PROCESSING: FREEZE
$! ========================
$!
$SF:
$	gosub clear_it_2
$	pre_yn = "Y"
$	if frz .ge. spring .and. frz .lt. prior then -
	  read /prompt="First pre-season posting ([Y]/N) > " /end=show_menu -
	  sys$command pre_yn
$	pre_yn = f$edit(pre_yn,"UPCASE,TRIM")
$	if frz .eq. spring .or. frz .eq. prior
$	then
$	    read /prompt="Current freeze is ''frz' -- run for freezes ''frz' and 0?? (Y/[N]) > " -
		 /end=show_menu sys$command ans
$	else
$	    read /prompt="Current freeze is ''frz' -- run for freezes ''frz' and ''l_frz'?? (Y/[N]) > " -
		 /end=show_menu sys$command ans
$	endif
$	ans = f$edit(ans,"UPCASE,TRIM")
$	if ans .nes. "Y" then goto show_menu
$	wso ""
$	wso "RUNNING WEEKLY STATS:"
$	subdir = "''rotis$'.''lge']"
$	define /nolog	stats$al	"''stats$'"
$	define /nolog	stats$nl	"''stats$'"
$	define /nolog	stats$ini	"''stats$'"
$	define /nolog	stats$roster	'subdir
$	define /nolog	stats$owners	'subdir
$	define /nolog	stats$results	'subdir
$	define /nolog	stats$log	'subdir
$	define /nolog	stats$available	'subdir
$	l_type = f$element(lge_num,";",types)
$	if frz .ge. spring
$	then
$	    if frz .eq. spring .or. frz .eq. prior
$	    then
$		stats == "$stats$al:stats4.exe ''frz' 0 ''l_type' name=''lge' no_salary no_check"
$	    else
$		stats == "$stats$al:stats4.exe ''frz' ''l_frz' ''l_type' name=''lge' no_salary no_check"
$	    endif
$	else
$	    stats == "$stats$al:stats4.exe ''frz' ''l_frz' ''l_type' name=''lge' no_salary"
$	endif
$	stats
$	wso ""
$	f1 = "stats$log:''lge'_''frz'.log"
$	wso "Searching STATS log file for duplicate player messages . . ."
$	sea 'f1 "already"
$	if mode .nes. "EXPERT" then inquire /nopunc x "Press RETURN to continue ... "
$	goto show_menu
$!
$! =======================
$! STATS PROCESSING: DELTA
$! =======================
$!
$SD:
$	gosub clear_it_2
$	read /prompt="Current freeze is ''frz' -- run for freezes ''frz' and ''l_frz'?? (Y/[N]) > " -
	  /end=show_menu sys$command ans
$	ans = f$edit(ans,"UPCASE,TRIM")
$	if ans .nes. "Y" then goto show_menu
$	wso ""
$	wso "RUNNING DELTA STATS:"
$	subdir = "''rotis$'.''lge'.delta]"
$	x = "''subdir'delta_''l_frz'.*;*"
$	delete 'x /exc=(.standings,.rosters)
$	define /nolog	stats$al	"''stats$'"
$	define /nolog	stats$nl	"''stats$'"
$	define /nolog	stats$ini	"''stats$'"
$	define /nolog	stats$roster	'subdir
$	define /nolog	stats$owners	'subdir
$	define /nolog	stats$results	'subdir
$	define /nolog	stats$log	'subdir
$	define /nolog	delta$dir	'subdir
$	stats == "$stats$al:stats4.exe ''frz' ''l_frz' ''l_type' name=delta no_avail no_salary"
$	stats 'p3 'p4
$	wso ""
$	f1 = "stats$log:delta_''frz'.log"
$	wso "Searching STATS log file for duplicate player messages . . ."
$	sea 'f1 already
$	if mode .nes. "EXPERT" then inquire /nopunc x "Press RETURN to continue ... "
$	goto show_menu
$!
$! =====================================
$! STATS PROCESSING: POSTING AND MAILING
$! =====================================
$!
$SP:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	if frz .eqs. "" then goto ncf
$	dir1 = "''rotis$'.''lge']"
$	dir2 = "''rotis$'.''lge'.delta]"
$	post1 = "''dir1'post.temp"
$	mail1 = "''dir1'mail.temp"
$	if frz .ge. spring
$	then
$	    if mode .eqs."EXPERT"
$	    then
$		read /prompt="After what draft round > " /end=show_menu -
		  sys$command round
$	    else
$		read /prompt="After what draft round >     " -
		  /end=get_choice sys$command round
$		wso ""
$	    endif
$	endif
$	if mode .eqs. "EXPERT"
$	then
$	    wso "Creating batch files for posting and mailing ..."
$	else
$	    wso "Creating batch files for posting and mailing..."
$	endif
$	open /write tmpfile 'post1
$	open /write mailfile 'mail1
$	num_tms = f$element('lge_num,";",no_teams)
$	write tmpfile "$ set default ''dir1'"
$	write tmpfile "$ notes"
$	x = f$element('lge_num,";",confs)
$	write tmpfile "open /noauto ''x'"
$	write tmpfile "set mod"
$	if frz .ge. spring then goto sp2
$	x = f$element('lge_num,";",owner_stats)
$	write tmpfile "''x'.L"
$	if frz .eq. 1 then goto sp2
$	count = 0
$SP1:
$	count = count + 1
$	write tmpfile "del"
$	write tmpfile "Y"
$	if count .lt. num_tms then goto sp1
$SP2:
$	o = all_owners_'lge_num
$	n = all_nicks_'lge_num
$	t = accounts_'lge_num
$	count = 0
$SP3:
$	o1 = f$element('count,";",o)
$	n1 = f$element('count,";",n)
$	t1 = f$element('count,";",t)
$	count = count + 1
$	if frz .ge. spring then goto sp4
$	write tmpfile "reply /noed ''dir1'''lge'_''frz'.''o1'"
$	write tmpfile "''n1' -- week ''frz'"
$	write tmpfile "Y"
$SP4:
$	f1 = "''dir1'''lge'_''frz'.''o1'"
$	f2 = "''dir2'delta_''frz'.''o1'"
$	if frz .ge. spring
$	then
$	    write mailfile "$ mail /noself /sub=""''lge': after round ''round' - ''n1'"" ''f1' "+t1
$	else
$	    write mailfile "$ mail /noself /sub=""''lge': freeze ''frz' - ''n1'"" ''f1' "+t1
$	    write mailfile "$ mail /noself /sub=""''lge': freeze ''frz' delta - ''n1'"" ''f2' "+t1
$	endif
$	if count .lt. num_tms then goto sp3
$	x = f$element('lge_num,";",standings_nums)
$	write tmpfile "''x'.L"
$	if frz .ge. spring .and. pre_yn .eqs. "N"
$	then
$	    write tmpfile "del"
$	    write tmpfile "Y"
$	endif
$	write tmpfile "reply /noedit ''dir1'''lge'_''frz'.standings"
$	if frz .eq. suppl  then write tmpfile "after supplemental draft"
$	if frz .gt. suppl .and. -
	   frz .lt. spring then write tmpfile "freeze ''frz'"
$	if frz .ge. spring then write tmpfile "after round ''round'"
$	write tmpfile "Y"
$	if frz .ge. spring then goto sp5
$	x = f$element('lge_num,";",delta_nums)
$	write tmpfile "''x'"
$	write tmpfile "reply /noed ''dir2'delta_''frz'.standings"
$	write tmpfile "freeze ''frz'"
$	write tmpfile "Y"
$	x = f$element('lge_num,";",team_tot_nums)
$	write tmpfile "''x'"
$	write tmpfile "reply /noedit ''dir1'''lge'_''frz'.totals"
$	write tmpfile "freeze ''frz'"
$	write tmpfile "Y"
$SP5:
$	x = f$element('lge_num,";",avail_pit_nums)
$	write tmpfile "''x'.l"
$	if frz .eq. 1 then goto sp6
$	if frz .ge. spring .and. pre_yn .eqs. "Y" then goto sp6
$	write tmpfile "del"
$	write tmpfile "y"
$SP6:
$	write tmpfile "reply /noedit ''dir1'''lge'_''frz'.pit_avail"
$	if frz .ge. spring
$	then
$	    write tmpfile "after round ''round'"
$	else
$	    write tmpfile "after freeze ''frz'"
$	endif
$	write tmpfile "Y"
$	x = f$element('lge_num,";",avail_bat_nums)
$	write tmpfile "''x'.l"
$	if frz .eq. 1 then goto sp7
$	if frz .ge. spring .and. pre_yn .eqs. "Y" then goto sp7
$	write tmpfile "del"
$	write tmpfile "y"
$SP7:
$	write tmpfile "reply /noedit ''dir1'''lge'_''frz'.bat_avail"
$	if frz .ge. spring
$	then
$	    write tmpfile "after round ''round'"
$	else
$	    write tmpfile "after freeze ''frz'"
$	endif
$	write tmpfile "Y"
$	write tmpfile "EXIT"
$	close tmpfile
$	close mailfile
$	if mode .eqs. "EXPERT"
$	then
$	    read /prompt="Submit batch file to post stats (Y/[N]) > " -
	      /end=show_menu sys$command x
$	else
$	    read /prompt="Submit batch file to post stats (Y/[N]) >    " -
	      /end=get_choice sys$command x
$	    wso ""
$	endif
$	x = f$edit(x,"UPCASE,TRIM")
$	if x .eqs. "Y" then submit /notify /noprint /noidentify 'post1
$	if mode .eqs. "EXPERT"
$	then
$	    read /prompt="Submit batch file to mail stats (Y/[N]) > " -
	      /end=show_menu sys$command x
$	else
$	    read /prompt="Submit batch file to mail stats (Y/[N]) >    "-
	      /end=get_choice sys$command x
$	    wso ""
$	endif
$	x = f$edit(x,"UPCASE,TRIM")
$	if x .eqs. "Y" then submit /notify /noprint /noidentify 'mail1
$	if mode .nes. "EXPERT" then wso ""
$	goto get_choice
$!
$! ==============================
$! ROSTERS: MODIFICATION (manual)
$! ==============================
$!
$RM:
$	gosub clear_it
$	games = 3
$	if frz .ge. spring then games = 20
$	temp = "''rls$dir'''lge'.rosters"
$	assign /user 'f$logical("SYS$COMMAND") sys$input:
$	editing 'temp
$	inquire /nopunc y_n "Validate positions (Y/[N]) > "
$	y_n = f$edit(y_n,"UPCASE,TRIM")
$	if y_n .eqs. "Y" 
$	then
$	    l_type = f$element(lge_num,";",types)
$	    temp = "''rls$dir'''lge'.rosters"
$	    if l_type .eqs. "AL"
$	    then
$		vr 'temp rls$:vr.dat 'games rls$:vr.last 20
$	    else
$		vr 'temp rls$:vr.dat 'games rls$:vr.last 20 NL
$	    endif
$	    inquire /nopunc x "Press RETURN to continue "
$	endif
$	goto show_menu
$!
$! ===========================
$! ROSTERS: UPDATE (automatic)
$! ===========================
$!
$RU:
$	gosub clear_it
$	games = 3
$	if frz .ge. spring then games = 20
$	wso "Do you want to delete the latest version of your roster file?"
$	wso ""
$	wso "NOTE:	You'd only want to do this if you are re-running this"
$	wso "	option for the same transaction freeze, after correcting errors..."
$	wso ""
$	read /prompt="(Y/[N]) > " /end=show_menu sys$command xx
$	xx = f$edit(xx,"UPCASE,TRIM")
$	if xx .eqs. "Y" then delete 'lge.rosters;
$	wso ""
$	wso "Updating ''lge'.ROSTERS from ''lge'.TRANS ..."
$	log = "''rls$dir'update_roster.log"
$	define /nolog	roster$file	"''rls$dir'''lge'.rosters"
$	define /nolog	trans$file	"''rls$dir'''lge'.trans"
$	define /nolog	new_roster$file	"''rls$dir'''lge'.rosters"
$	run rls$:update_roster
$	wso "Displaying Update Roster LOG (ran okay if no errors appear):"
$	wait 00:00:02
$	type /page 'log
$	inquire /nopunc y_n "Alphabetize rosters (Y/[N]) > "
$	y_n = f$edit(y_n,"UPCASE,TRIM")
$	if y_n .eqs. "Y" then rsort <new_roster$file >new_roster$file -noowner
$	inquire /nopunc y_n "Validate positions (Y/[N]) > "
$	y_n = f$edit(y_n,"UPCASE,TRIM")
$	if y_n .eqs. "Y" 
$	then
$	    l_type = f$element(lge_num,";",types)
$	    temp = "''rls$dir'''lge'.rosters"
$	    if l_type .eqs. "AL"
$	    then
$		vr 'temp rls$:vr.dat 'games rls$:vr.last 20
$	    else
$		vr 'temp rls$:vr.dat 'games rls$:vr.last 20 NL
$	    endif
$	    inquire /nopunc x "Press RETURN to continue "
$	endif
$	goto show_menu
$!
$! =============
$! ROSTERS: POST
$! =============
$!
$RP:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	f1 = "''rls$dir'post.temp"
$	open /write temp 'f1
$	write temp "$ notes"
$	write temp "open /noauto ''f$element(lge_num,";",confs)'"
$	write temp "set mod"
$	write temp "''f$element(lge_num,";",roster_nums)'.LAST"
$	gosub del_prev
$	if y_n .nes. "Y" then goto rp1
$	write temp "del"
$	write temp "y"
$RP1:
$	write temp "reply /noed ''rls$dir'''lge'.rosters"
$	gosub note_title
$	submit /nonotify /noprint /noidentify 'f1
$	goto get_choice
$!
$! =======================================
$! ROSTERS: COPY (TO STATS SUBDIRECTORIES)
$! =======================================
$!
$RC:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	if frz .eqs. "" then goto ncf
$	if mode .eqs. "EXPERT"
$	then
$	    if frz .ge. spring
$	    then
$		read sys$command x /end=show_menu -
		  /prompt="Copy to appropriate *_''frz'.ROSTERS (Y/[N]) > "
$	    else
$		read sys$command x /end=get_choice -
		  /prompt="Copy to appropriate *_''n_frz'.ROSTERS (Y/[N]) > "
$	    endif
$	else
$	    if frz .ge. spring
$	    then
$		read /prompt="Copy to appropriate *_''frz'.ROSTERS (Y/[N]) >    " -
		  /end=show_menu sys$command x
$		wso ""
$	    else
$		read /prompt="Copy to appropriate *_''n_frz'.ROSTERS (Y/[N]) >    " -
		  /end=get_choice sys$command x
$		wso ""
$	    endif
$	endif
$	x = f$edit(x,"UPCASE,TRIM")
$	if x .nes. "Y" then goto get_choice
$	f1 = "''rls$dir'''lge'.rosters"
$	f2 = "''rotis$'.''lge']''lge'_''n_frz'.rosters"
$	f3 = "''rotis$'.''lge'.delta]delta_''n_frz'.rosters"
$	copy /nolog 'f1 'f2
$	copy /nolog 'f1 'f3
$	if frz .ge. spring
$	then
$	    f1 = "''rls$dir'''lge'.rosters"
$	    f2 = "''rotis$'.''lge']''lge'_''frz'.rosters"
$	    f3 = "''rotis$'.''lge'.delta]delta_''frz'.rosters"
$	    copy /nolog 'f1 'f2
$	    copy /nolog 'f1 'f3
$	endif
$	goto get_choice
$!
$! ===================
$! GET DATA: STANDINGS
$! ===================
$!
$GS:
$	gosub clear_long
$	def_frz = frz
$GS1:
$	gosub get_freeze
$	read /prompt="Cumulative (C) or Delta (D) > " /end=gs2 -
	  sys$command x
$	x = f$edit(x,"UPCASE,TRIM")
$	if x .eqs. "" then goto gs2
$	if x .nes. "D" .and. x .nes. "C" then goto gs1
$	if x .eqs. "D"
$	then
$	    f1 = "''rotis$'.''lge'.delta]delta_''f'.standings"
$	else
$	    f1 = "''rotis$'.''lge']''lge'_''f'.standings"
$	endif
$	type /page 'f1
$	wso ""
$	goto gs1
$GS2:
$	if mode .nes. "EXPERT" then set term /page='menu_size'
$	goto show_menu
$!
$! =====================
$! GET DATA: OWNER STATS
$! =====================
$!
$GO:
$	gosub clear_long
$	set term /width='wide_screen'
$	def_frz = frz
$GO1:
$	gosub get_freeze
$	read /prompt="Cumulative (C) or Delta (D) > " /end=go3 -
	  sys$command x
$	x = f$edit(x,"UPCASE,TRIM")
$	if x .eqs. "" then goto go3
$	if x .nes. "D" .and. x .nes. "C" then goto go1
$GO2:
$	read /prompt="Owner > " /end=go3 sys$command owner 
$	if owner .eqs. "" then goto go1
$	if x .eqs. "D"
$	then
$	    f1 = "''rotis$'.''lge'.delta]delta_''f'.''owner'"
$	else
$	    f1 = "''rotis$'.''lge']''lge'_''f'.''owner'"
$	endif
$	type /page 'f1
$	wso ""
$	goto go2
$GO3:
$	if mode .nes. "EXPERT" then set term /page='menu_size'
$	set term /width=80
$	goto show_menu
$!
$! ==============================================
$! GET DATA: FREE AGENTS (AVAILABLE PLAYER LISTS)
$! ==============================================
$!
$GF:
$	gosub clear_it
$	def_frz = frz
$GF1:
$	gosub get_freeze
$	read /prompt="Batters or Pitchers (BAT, PIT) > " /end=gf2 -
	 sys$command x 
$	x = f$edit(x,"UPCASE,TRIM")
$	if x .eqs. "" then goto show_menu
$	if x .nes. "BAT" .and. x .nes. "PIT" then goto gf1
$	avail /'x /freeze='def_frz 'lge
$	wso ""
$	goto gf1
$!
$! ================
$! GET DATA: ROSTER 
$! ================
$!
$GR:
$	gosub clear_it
$GR1:
$	read /prompt="Owner > " /end=show_menu sys$command owner 
$	owner = f$edit(owner,"UPCASE,TRIM")
$	wso ""
$	if owner .eqs. "" then goto show_menu
$	f1 = "''rls$dir'''lge'.rosters"
$	open /read fspec 'f1
$	read fspec rec
$	read fspec rec
$	read fspec rec
$	read fspec rec
$GR2:
$	read/end=grnone fspec rec
$	read/end=grnone fspec rec
$	cmp_rec = f$edit(rec,"COMPRESS,TRIM")
$	read fspec nick
$	read fspec rec
$	count = 0
$GR3:
$	lname = f$element(count," ",cmp_rec)
$	name = f$edit(lname,"UPCASE,TRIM")
$	len = f$length(name)
$	if f$extract(len-2,2,name) .eqs. "'S" then name = f$extract(0,len-2,name)
$	if f$extract(len-1,1,name) .eqs. "'" then name = f$extract(0,len-1,name)
$	if name .eqs. owner then goto gr5
$	count = count + 1
$	if count .lt. 4 then goto gr3 
$GR4:
$	read/end=grnone fspec rec
$	rec = f$edit(rec,"TRIM")
$	if rec .eqs. "" then goto gr2
$	goto gr4
$GR5:
$	num_res = 0
$       nick = "''f$extract(19*count+3,18,nick)'"
$	wso "''lname' ''nick'"
$	wso "Pitchers:Infielders:"
$	wso "Designated Hitter:Reserves:"
$	wso "Outfielders:Catchers:"
$	wso "1B2BSS3BCIMI"
$	p = 0
$GR6:
$	read fspec rec
$	player = "''f$extract(19*count+3,18,rec)'"
$	row = p + 5
$	wso "[''row';9H''player'"
$	p = p + 1
$	if p .lt. 9 then goto gr6
$	read fspec rec
$GR7:
$	read fspec rec
$	if f$extract(0,2,rec) .eqs. "--" .or. f$extract(0,2,rec) .eqs. "==" -
	    then goto gr8
$	player = "''f$extract(19*count+3,18,rec)'"
$	if f$extract(0,1,player) .nes. " " .and. f$extract(0,1,player) .nes. ""
$	then
$	    row = num_res + 9
$	    wso "[''row';57H''player'"
$	    num_res = num_res + 1
$	endif
$	goto gr7
$GR8:
$       num_res = num_res + 1
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	read fspec rec
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	read fspec rec
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	read fspec rec
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	gosub get_player
$	wso "''player'"
$	read fspec rec
$	gosub get_player
$	wso "''player'"
$	read fspec rec
$GR9:
$	read fspec rec
$	if f$extract(0,2,rec) .eqs. "--" .or. f$extract(0,2,rec) .eqs. "==" -
	    then goto grdone
$	player = "''f$extract(19*count+3,18,rec)'"
$	if f$extract(0,1,player) .nes. " "
$	then
$	    row = num_res + 9
$	    wso "[''row';57H''player'"
$	endif
$	num_res = num_res + 1
$	goto gr9
$GRNONE:
$	wso "No match for owner's name"
$GRDONE:
$	close fspec
$	goto gr1
$!
$! ======================
$! GET DATA: PLAYER STATS
$! ======================
$!
$GP:
$	gosub clear_long
$	if mode .nes. "EXPERT" then wso ""
$GP1:
$	read /prompt="League & Position (ALBAT, ALPIT, NLBAT, NLPIT) > " -
	  /end=gp3 sys$command ext 
$	ext = f$edit(ext,"UPCASE,TRIM")
$	if ext .eqs. "" then goto gp3
$	if ext .nes. "ALBAT" .and. ext .nes. "ALPIT" .and. -
	  ext .nes. "NLBAT" .and. ext .nes. "NLPIT" then goto gp1
$GP2:
$	read /prompt="Player's name > " /end=gp3 sys$command player 
$	if player .eqs. "" then goto gp1
$	f1 = "''stats$'freeze_*.''ext'"
$	wso ""
$	if f$extract(2,3,ext) .eqs. "PIT"
$	then 
$	    wso "                     W  L   G GS CG GF SH SV   IP    H   R  ER HR  BB  SO"
$	else
$	    wso "                      G  AB   R   H  TB 2B 3B HR RBI  BB  SO  SB CS  E"
$	endif
$	sea 'f1 "''player'"
$	wso ""
$	goto gp2
$GP3:
$	if mode .nes. "EXPERT" then set term /page='menu_size'
$	goto show_menu
$!
$! ===================================
$! GET DATA: TEAM STATS (major league)
$! ===================================
$!
$GT:
$	gosub clear_long
$	def_frz = frz
$	gosub get_freeze
$GT1:
$	read /prompt="League & Position (ALBAT, ALPIT, NLBAT, NLPIT) > " -
	  /end=gt7 sys$command ext 
$	ext = f$edit(ext,"UPCASE,TRIM")
$	if ext .eqs. "" then goto gt7
$	if ext .nes. "ALBAT" .and. ext .nes. "ALPIT" .and. -
	  ext .nes. "NLBAT" .and. ext .nes. "NLPIT" then goto gt1
$GT2:
$	read /prompt="Three-letter team code > " /end=gt7 sys$command -
	  tcode
$	tcode = f$edit(tcode,"UPCASE,TRIM")
$	if tcode .eqs. "" then goto gt1
$	wso ""
$	f1 = "''stats$'freeze_''f'.''ext'"
$	open /read fspec 'f1
$GT3:
$	read /end=gt5 fspec /err=gt6 rec
$	if f$extract(0,3,rec) .nes. tcode then goto gt3
$	if f$extract(2,3,ext) .eqs. "PIT"
$	then 
$	    wso "                     W  L   G GS CG GF SH SV   IP    H   R  ER HR  BB  SO"
$	else
$	    wso "                      G  AB   R   H  TB 2B 3B HR RBI  BB  SO  SB CS  E"
$	endif
$GT4:
$	read /end=gt6 fspec rec
$	if rec .eqs. "" then goto gt6
$	wso "''rec'"
$	goto gt4
$GT5:
$	wso "Team ''tcode' not found in ''ext'"
$GT6:
$	close fspec
$	wso ""
$	goto gt2
$GT7:
$	set term /page='menu_size'
$	goto show_menu
$!
$! =========================================
$! GET DATA: AFFILIATION (who owns a player)
$! =========================================
$!
$GA:
$	clear	= "CLEAR"
$	if mode .nes. "EXPERT" then wso ""
$GA1:
$	read /prompt="Player's name > " /end=show_menu sys$command player 
$	if player .eqs. "" then goto show_menu
$	wso ""
$	wso "NOTE:  Owner appears above player's name ..."
$	wso ""
$	num = 0
$GA2:
$	y = f$element(num,";",leagues)
$	if y .eqs. ";" then goto ga1
$	wso "''y':"
$	f = "''rls$dir'''y'.rosters"
$	o = owners_'num
$	sea 'f "''player'", 'o
$	wso ""
$	num = num + 1
$	goto ga2
$!
$! =======================
$! GET DATA: PLAYER RATING
$! =======================
$!
$GZ:
$	clear = ""
$	if rating_file .nes. "" then goto gz1
$	if mode .eqs. "EXPERT"
$	then
$	    wso "No rating file(s) defined ..."
$	else
$	    wso "No rating file(s) defined ..."
$	endif
$	wait 00:00:01
$	if mode .nes. "EXPERT" then wso ""
$	goto show_menu
$GZ1:
$	clear	= "CLEAR"
$	if mode .nes. "EXPERT" then wso ""
$GZ2:
$	read /prompt="Player > " /end=show_menu sys$command pl
$	if pl .eqs. "" then goto show_menu
$	wso ""
$	sea 'rating_file "''pl'"
$	wso ""
$	goto gz2
$!
$! ============================
$! POSITION ELIGIBILITY: VERIFY
$! ============================
$!
$PV:
$	clear	= "CLEAR"
$	if mode .nes. "EXPERT" then wso ""
$	last_year = f$string(f$integer(year) - 1)
$PV1:
$	read /prompt="Major league (AL, NL) > " /end=show_menu sys$command -
	  maj_lge
$	maj_lge = f$edit(maj_lge,"UPCASE,TRIM")
$	if maj_lge .eqs. "" then goto show_menu
$	if maj_lge .nes. "AL" .and. maj_lge .nes. "NL" then goto pv1
$PV2:
$	read /prompt="Player's last name > " /end=show_menu sys$command player
$	if player .eqs. "" then goto pv1
$	f1 = "''rls$dir'''maj_lge'_positions.''last_year'"
$	f2 = "''rls$dir'''maj_lge'_positions.''year'"
$	wso ""
$	wso ""
$	wso "''last_year':"
$	sea 'f1 'player, 'year, basemen, design, outfield
$	wso ""
$	wso "''year':"
$	sea 'f2 'player, 'year, basemen, designated, outfield
$	wso ""
$	goto pv2
$!
$! ==========================
$! POSITION ELIGIBILITY: POST
$! ==========================
$!
$PP:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	f1 = "''rls$dir'post.temp"
$	open /write temp 'f1
$	write temp "$ notes"
$	write temp "open /noauto ''f$element(lge_num,";",confs)'"
$	write temp "set mod"
$	write temp "''f$element(lge_num,";",pos_elig_nums)'.LAST"
$	gosub del_prev
$	l_type = f$element(lge_num,";",types)
$	if y_n .nes. "Y" then goto pp1
$	write temp "del"
$	write temp "y"
$	if l_type .nes. "" then goto pp1
$	write temp "del"
$	write temp "y"
$PP1:
$	if l_type .eqs. ""
$	then
$	    write temp "reply /noed ''rls$dir'al_positions.''year'"
$	    write temp ""
$	    write temp "y"
$	    write temp "reply /noed ''rls$dir'nl_positions.''year'"
$	else
$	    write temp "reply /noed ''rls$dir'''l_type'_positions.''year'"
$	endif
$	write temp ""
$	write temp "y"
$	write temp "exit"
$	close temp
$	submit /nonotify /noprint /noidentify 'f1
$	goto get_choice
$!
$! =======================
$! DRAFT: CREATE NEW ROUND
$! =======================
$!
$DC:
$	clear	= ""
$	f1 = "''rls$dir'''lge'.round"
$	f2 = "''rls$dir'''lge'.draft"
$	f3 = "''rls$dir'''lge'.order"
$	keepers = f$element(lge_num,";",max_keepers)
$	assign /user _nla0: sys$error
$	assign /user _nla0: sys$output
$	dir /brief 'f1
$	if .not. $status then goto dc2
$	assign /user _nla0: sys$error
$	assign /user _nla0: sys$output
$	dir /brief 'f2
$	if $status then goto dc1
$	create 'f2
$DC1:
$	open /read t1 'f1
$	open /append t2 'f2
$	read t1 rec
$	space = f$locate(" ",rec)
$	colon = f$locate(":",rec)
$	round = f$extract(space+1,colon-space-1,rec)
$	if round .le. keepers then round = keepers
$	write t2 ""
$	write t2 ""
$	close t1
$	close t2
$	append 'f1 'f2
$	goto dc3
$DC2:
$	if mode .eqs. "EXPERT"
$	then
$	    read /prompt="Fewest protected by any owner > " /end=show_menu -
	      sys$command round
$	else
$	    wso ""
$	    read /prompt="Fewest protected by any owner > " -
	      /end=get_choice sys$command round
$	    wso ""
$	endif
$DC3:
$	open /write t1 'f1
$DC3a:
$	round = round + 1
$	write t1 "ROUND ''round':"
$	write t1 ""
$	write t1 "OWNER        POS/PLAYER             TM.           POSITION ADJUSTMENT"
$	write t1 "-----        ----------             ---           -------------------"
$	open /read t3 'f3
$DC4:
$	read /end=dc5 t3 rec
$	cmp_rec = f$edit(rec,"COMPRESS,TRIM")
$	if f$element(0," ",cmp_rec) .lt. round then -
	  write t1 "''f$element(1," ",cmp_rec)'"
$	goto dc4
$DC5:
$	if round .ge. keepers then goto dc6
$	write t1 ""
$	write t1 ""
$	close t3
$	goto dc3a
$DC6:
$	close t1
$	close t3
$	goto get_choice
$!
$! =============
$! DRAFT: MODIFY
$! =============
$!
$DM:
$	gosub clear_it
$	temp = "''rls$dir'''lge'.round"
$	assign /user 'f$logical("SYS$COMMAND") sys$input:
$	editing  'temp
$	goto show_menu
$!
$! ====================================
$! DRAFT: UPDATE (generates new roster)
$! ====================================
$!
$DU:
$	gosub clear_it
$	games = 3
$	if frz .ge. spring then games = 20
$	wso "Do you want to delete the latest version of your roster file?"
$	wso ""
$	wso "NOTE:	You'd only want to do this if you are re-running this"
$	wso "	option for the same draft round, after correcting errors..."
$	wso ""
$	read /prompt="(Y/[N]) > " /end=show_menu sys$command xx
$	xx = f$edit(xx,"UPCASE,TRIM")
$	if xx .eqs. "Y" then delete 'lge.rosters;
$	wso ""
$	wso "Updating ''lge'.ROSTERS from ''lge'.ROUND ..."
$	image = "''rls$dir'update_draft"
$	log = "''rls$dir'update_draft.log"
$	define /nolog	roster$file	"''rls$dir'''lge'.rosters"
$	define /nolog	draft$file	"''rls$dir'''lge'.round"
$	define /nolog	new_roster$file	"''rls$dir'''lge'.rosters"
$	run 'image
$	wso "Displaying Update Draft LOG (okay if no errors appear):"
$	wait 00:00:02
$	type /page 'log
$	inquire /nopunc y_n "Alphabetize rosters (Y/[N]) > "
$	y_n = f$edit(y_n,"UPCASE,TRIM")
$	if y_n .eqs. "Y" then rsort <new_roster$file >new_roster$file -noowner
$	inquire /nopunc y_n "Validate positions (Y/[N]) > "
$	y_n = f$edit(y_n,"UPCASE,TRIM")
$	if y_n .eqs. "Y" 
$	then
$	    l_type = f$element(lge_num,";",types)
$	    temp = "''rls$dir'''lge'.rosters"
$	    if l_type .eqs. "AL"
$	    then
$		vr 'temp rls$:vr.dat 'games rls$:vr.last 20
$	    else
$		vr 'temp rls$:vr.dat 'games rls$:vr.last 20 NL
$	    endif
$	    inquire /nopunc x "Press RETURN to continue "
$	endif
$	goto show_menu
$!
$! ===========
$! DRAFT: POST
$! ===========
$DP:
$	clear	= ""
$	if lge .eqs. "" then goto ncl
$	f1 = "''rls$dir'post.temp"
$	open /write temp 'f1
$	write temp "$ notes"
$	write temp "open /noauto ''f$element(lge_num,";",confs)'"
$	write temp "set mod"
$	write temp "''f$element(lge_num,";",draft_nums)'.LAST"
$	gosub del_prev
$	if y_n .nes. "Y" then goto dp1
$	write temp "del"
$	write temp "y"
$DP1:
$	write temp "reply /noed ''rls$dir'''lge'.round"
$	gosub note_title
$	submit /nonotify /noprint /noidentify 'f1
$	goto get_choice
$!
$! ============================
$! NOTES: CREATE FOR NEW SEASON
$! ============================
$!
$NC:
$	gosub clear_it
$	wso "Creating batch job to write new notes to your conference..."
$	f1 = "''rls$dir'base_note.temp"
$	open /write temp 'f1
$	write temp "    Please do not reply to this note -- for league statistician only"
$	close temp
$	f1 = "''rls$dir'misc_note.temp"
$	open /write temp 'f1
$	write temp "	Use this note for miscellaneous discussions for the current season..."
$	close temp
$	f1 = "''rls$dir'post.temp"
$	open /write temp 'f1
$	write temp "$ notes"
$	write temp "open /noauto ''f$element(lge_num,";",confs)'"
$!	write temp "set mod"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Draft"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Rosters"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Transactions & Trades"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Free Moves"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Standings"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Delta Standings"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Team Totals"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Team Stats"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Available Pitchers"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Available Batters"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'base_note.temp"
$	write temp "''year' ''lge' Position Eligibilities"
$	write temp "Y"
$	write temp "write /noed ''rls$dir'misc_note.temp"
$	write temp "''year' ''lge' Miscellaneous"
$	write temp "Y"
$	write temp "exit"
$	close temp
$	submit /nonotify /noprint /noidentify 'f1
$	wso "Batch job submitted"
$	wso ""
$	wso "NOTE:	Please check your conference in a few minutes and make"
$	wso "	note of the newly created notes and their note numbers."
$	wso ""
$	wso "	Before continuing, you should exit RLS, modify RLS.TXT to "
$	wso "	reflect the new note numbers, and then re-enter RLS..."
$	wso ""
$	inquire /nopunc x "Press RETURN to continue . . ."
$	goto show_menu
$!
$! =============================
$! MISCELLANEOUS: REFRESH SCREEN
$! =============================
$!
$MR:
$	wso ""
$	goto show_menu
$!
$! ===========================
$! MISCELLANEOUS: SPAWN TO DCL
$! ===========================
$!
$MS:
$	clear	= "CLEAR"
$	if mode .nes. "EXPERT" then wso ""
$	if .not. nobroad then set term /broadcast
$	spawn /prompt="LOGOUT to resume RLS > "
$	set term /nobroadcast
$	goto show_menu
$!
$! ====================
$! MISCELLANEOUS: PURGE
$! ====================
$!
$MP:
$	clear = ""
$	xx = f$environment("DEFAULT")
$	set default rls$
$	if mode .eqs. "EXPERT"
$	then
$	    wso "Purging files under ''rls$dir' ..."
$	    purge [...]
$	    wso "Finished"
$	else
$	    wso "Purging files under ''rls$dir' ..."
$	    purge [...]
$	    wso ""
$	endif
$	set default 'xx 
$	goto get_choice
$!
$! ===================
$! ... SUBROUTINES ...
$! ===================
$!
$! ============================
$! FIND NEXT NON-COMMENTED LINE
$! ============================
$!
$SKIP_COMMENTS:
$	read /end=read_error fspec rec
$	if f$extract(0,1,rec) .eqs. "!" then goto skip_comments
$	return
$!
$! ===============
$! DELETE PREVIOUS
$! ===============
$!
$DEL_PREV:
$	if mode .eqs. "EXPERT" 
$	then
$	    read /prompt="Delete previous posting (Y/[N]) > " /end=stop_dp -
	     sys$command y_n 
$	else
$	    read /prompt="Delete previous posting (Y/[N]) >    " -
	     /end=stop_dp sys$command y_n 
$	    wso ""
$	endif
$	y_n = f$edit(y_n,"UPCASE,TRIM")
$	return
$STOP_DP:
$	close temp
$	goto get_choice
$!
$! =====
$! CLEAR
$! =====
$!
$CLEAR_IT:
$	clear = ""
$	if lge .eqs. "" then goto ncl
$	clear	= "CLEAR"
$	wso ""
$	return
$!
$! =======
$! CLEAR 2
$! =======
$!
$CLEAR_IT_2:
$	clear = ""
$	if lge .eqs. "" then goto ncl
$	if frz .eqs. "" then goto ncf
$	clear	= "CLEAR"
$	if mode .nes. "EXPERT" then wso ""
$	return
$!
$! ==========
$! CLEAR LONG
$! ==========
$!
$CLEAR_LONG:
$	clear = ""
$	if lge .eqs. "" then goto ncl
$	if frz .eqs. "" then goto ncf
$	clear	= "CLEAR"
$	if mode .nes. "EXPERT" 
$	then
$	    wso ""
$	    set term /page='long_window'
$	endif
$	return
$!
$! ==========
$! GET_PLAYER
$! ==========
$!
$GET_PLAYER:
$	read fspec rec
$	player = "''f$extract(19*count+3,18,rec)'"
$	return
$!
$! ==========
$! NOTE TITLE
$! ==========
$!
$NOTE_TITLE:
$	title = ""
$	if mode .eqs. "EXPERT"
$	then
$	    read /prompt="[Title] > " /end=stop_nt sys$command title
$	else
$	    wso ""
$	    read /prompt="[Title] > " /end=stop_nt sys$command -
	     title
$	    wso ""
$	endif
$	write temp "''title'"
$	write temp "y"
$	write temp "exit"
$	close temp
$	return
$STOP_NT:
$	close temp
$	goto get_choice
$!
$! ==========
$! GET FREEZE
$! ==========
$!
$GET_FREEZE:
$	read /prompt="Freeze [''def_frz'] > " /end=show_menu sys$command f 
$	if f$length(f) .eq. 1 then f = "0''f'"
$	if f .eqs. "" 
$	then 
$	    f = def_frz
$	else
$	    def_frz = f
$	endif
$	return
$!
$! ====
$! EXIT
$! ====
$!
$FINISHED:
$	close t1
$	close t2
$	close temp
$	close tmpfile
$	close fspec
$EX:
$	if mode .nes. "EXPERT" then wso ""
$	if .not. nobroad then set term /broadcast
$	if wrap then set term /wrap /page='lines_per_page'
$	wso "Checking to see if you received any VAXmail while in RLS ...."
$	mail
$	wso ""
$	exit
$!
$! ==============
$! ERROR HANDLING
$! ==============
$!
$READ_ERROR:
$	wso ""
$	wso ""
$	wso "Insufficient data reading RLS.TXT"
$	wso ""
$	exit