	FUNCTION GetSDAVec, fileNa, times, st_idx, dSet=dSet
;	---------------------------------------------------------------
;+							3-Jul-1991
;	Name:
;		GetSDAVec
;	Purpose:
;		For each given SDA File Name (SFR or SPR), GetSDAVec
;		returns an roadmap-index list which corresponds 
;		to the input requested times.
;	CALLING SEQUENCE:
;		err = GetSDAVec(fileNa, times, st_idx, [dSet=dSet])
;	Input:
;		fileNa	SDA file name (spr or sfr)
;		times 	list of requested times for input file.
;		st_idx	start value index for the output dset vector
;       Output/Keyword:
;		dSet 	list of roadmap-index values for data-ptrs
;		GetSDAVec	err value:
;			0 indicates an error occurs
;			1 indicates that no error occured.
;	History:
;		written 12-Mar-1991 by GAL (no error checking added yet)
;		3-Jul-91, added keyword to returned data-set-vector (dSet).
;
;-
;	--------------------------------------------------------------
;	ON_ERROR, 2		;force a return to caller if error occurs
        err = 0			;assume an error will occur

	IF (NOT KEYWORD_SET(dSet)) THEN BEGIN
	  dSet = times.time	;define dimensions and data-type
	  dSet(*) = LONG(0)	;init values
	ENDIF
	ntimes = N_ELEMENTS(times)	;n elements input and output

;	Get the Roadmap to the data file:
	RD_roadmap, fileNa, roadmap, ndset, recsize

;	Find the corresponding roadmap index for input times:
	tIdx = 0		;initial time index
	idx  = st_idx		;initial index for output vector
	done = 0		;not done flag

	REPEAT BEGIN
	  rmapi = BinarySea(errStat, times(tIdx), roadmap.day, roadmap.time)
	  dSet(idx) = rmapi		;load index value for data-pointer
          tIdx = tIdx + 1		;increment time index
	  idx = idx + 1
	  IF (tIdx EQ ntimes) THEN BEGIN	;check for bounds overflow 
	    done = 1
	  ENDIF ELSE BEGIN			;check for end of list
	    IF ( (times(tIdx).time EQ LONG(0)) AND (times(tIdx).day $
			EQ FIX(0)) )	THEN BEGIN	;end of list
	      done = 1
	    ENDIF 
	  ENDELSE 
	ENDREP UNTIL done

	err = 1				;success flag set
	RETURN, err
	END	
