:orphan:
# PetscBagSetOptionsPrefix
Sets the prefix used for searching for all `PetscBag` items in the options database.
## Synopsis
```
#include "petscbag.h"
PetscErrorCode PetscBagSetOptionsPrefix(PetscBag bag, const char pre[])
```
Logically Collective
## Input Parameters
- ***bag -*** the bag of values
- ***prefix -*** the prefix to prepend all Bag item names with.
## Note
Must be called prior to registering any of the bag items.
## See Also
`PetscBag`, `PetscBagRegisterReal()`, `PetscBagRegisterInt()`, `PetscBagRegisterBool()`, `PetscBagRegisterScalar()`
`PetscBagSetFromOptions()`, `PetscBagCreate()`, `PetscBagDestroy()`, `PetscBagRegisterEnum()`
## Level
Intermediate
## Location
src/sys/classes/bag/bag.c
## Examples
src/sys/tutorials/ex5.c
src/sys/tutorials/ex5f90.F90
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/bag/bag.c)
[Index of all Sys routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)