# PetscViewerHDF5HasDataset
Check whether a given dataset exists in the HDF5 file 
## Synopsis
```
#include "petscviewerhdf5.h" 
PetscErrorCode PetscViewerHDF5HasDataset(PetscViewer viewer, const char path[], PetscBool *has)
```
Collective


## Input Parameters

- ***viewer -*** The `PETSCVIEWERHDF5` viewer
- ***path -*** The dataset path



## Output Parameter

- ***has -*** Flag whether dataset exists





## Notes
If path starts with '/', it is taken as an absolute path overriding currently pushed group, else path is relative to the current pushed group.

If path is NULL or empty, has is set to `PETSC_FALSE`.

If path exists but is not a dataset, has is set to `PETSC_FALSE` as well.


## See Also
 [](sec_viewers), `PETSCVIEWERHDF5`, `PetscViewerHDF5HasObject()`, `PetscViewerHDF5HasAttribute()`, `PetscViewerHDF5HasGroup()`, `PetscViewerHDF5PushGroup()`, `PetscViewerHDF5PopGroup()`, `PetscViewerHDF5GetGroup()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerHDF5HasDataset">src/sys/classes/viewer/impls/hdf5/hdf5v.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/hdf5/hdf5v.c)


[Index of all Viewer routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
