pro bcs_rd_grpplan, infil, grpplan
;
;
;
;HISTORY:
;	Written Fall 1991 by M.Morrison
;	 7-Jul-92 (MDM) - Modified so that it used RDWRT so that it
;			  would work on a MIPS or SUN machine
;
if (n_elements(infil) eq 0) then infil = '$DIR_REFORMAT_DATA/bcs_grpplan.dat'

dummy = {Grouper_plan_rec,  $		;
	cre_date: bytarr(24), $		; Creation date (string variable)
	length: fix(0),  $		; Total No of bytes of data created by the plan
	planid: fix(0),  $		; ID of the plan
	ngrp: bytarr(4),  $		; No. of sets for each channel
	grps: intarr(10,4)}		; Sets for each channel


grpplan = replicate({grouper_plan_rec},190)
;
;	  read the database in
;
openr, lundtb, infil, /block, /get_lun
ii = fix(0)
bytout = 0
rdwrt, 'R', lundtb, bytout, rsiz, ii, 1		;skip 2 bytes
rdwrt, 'R', lundtb, bytout, rsiz, grpplan, 1

;;readu, lundtb, ii				;skip 2 bytes?
;;readu, lundtb, grpplan

free_lun,lundtb
end
