Routines (alphabetical) > Routines: H > HDF Routines > HDF_SD_SELECT

# HDF_SD_SELECT

The HDF_SD_SELECT function returns an SD dataset ID given the current SD interface ID, and the zero-based SD dataset index.

HDF_SD_FILEINFO can be used to determine the number of SD datasets in an HDF file, HDF_SD_REFTOINDEX can be used to find the index from its SD dataset ID, and HDF_SD_NAMETOINDEX can be used to find the index from its name.

## Examples

; Open an HDF file:

SDinterface_id = HDF_SD_START('test.hdf')

; Access the first SD in the HDF file:

SDdataset_id_1=HDF_SD_SELECT(SDinterface_id, 0)

; End access to any SD ids:

HDF_SD_ENDACCESS, SDdataset_id_1

; Close the file:

HDF_SD_END, SDinterface_id

## Syntax

Result = HDF_SD_SELECT(SDinterface_id, Number)

## Return Value

Returns the specified SD dataset’s identifier.

## Arguments

### SDinterface_id

A SD interface ID as returned from HDF _SD_START.

### Number

A zero-based SD dataset index.

## Keywords

None

## Version History

4.0 | Introduced

## See Also

HDF_SD_CREATE, HDF_SD_END, HDF_SD_ENDACCESS, HDF_SD_NAMETOINDEX, HDF_SD_REFTOINDEX, HDF_SD_SELECT, HDF_SD_START