A prosecuting attorney may file a dismissal of an indictment, information, or complaint and the prosecution shall thereupon terminate. Such a dismissal may not be filed during a trial without the consent of the defendant. Source: SDC 1939 & Supp 1960, § 34.2204; SDCL, § 23-34-7; SL 1978, ch 178 , § 535.