It shall be the duty of the state's attorney whenever required by the grand jury to attend them for the purpose of examining witnesses in their presence or of giving them any advice on any legal matter, and to issue subpoenas or other process to compel the attendance of witnesses.
SDCL 7-16-11