STKAUP, C. J.
This is a proceeding praying for a -writ of mandate. In the petition it is alleged that B,. E. Bramlet, B. E. McGuire, and John K. Garrett, having been held by a committing magistrate to answer in the district court of Weber county for the crime of robbery, were informed against for such offense by the district attorney of that district. Through inadvertence the district attorney neglected to charge venue in the information. After the defendants had been arraigned, and had entered their pleas of not guilty, the district *399attorney asked leave to amend tbe information by alleging venne. Tbe court, upon the defendants’ objection, declined tbe amendment. The district, attorney, recognizing itha.t the information was fatally defective, and the court refusing to allow the amendment, then moved the court “to dismiss — to quash — the information and set it aside.” Counsel for the defendants then said: “And discharge the defendants, I suppose ? That will be the order, I take it ?” The district attorney replied, “I intend to file an information in the same matter,” and, if the defendants “are discharged, I will ask for a bench warrant that they may be required to appear and plead.” The court said: “To what?” The district attorney answered: “To the information which I shall file.” The court said: “You may file an information if you desire.” Counsel for the defendants then observed: “But as to this case the information that has been read to them, and to which they plead, I understand is dismissed, and, of course, you will be discharging them. As to future proceedings, that is for counsel, and I do not know that I have any authority, if the district attorney files an information, to appear — they may hire somebody else.” To this the district attorney replied: “If that is the view that counsel take, and the court takes that view of it, that they are discharged and the bondsmen released, of course when I file an information I will ask the court to issue a bench warrant that they may be brought in for arraignment and plead.” The Court: “At any rate, I understand you are now moving for a dismissal of the action.” To this the district attorney said, “Yes.” The Court: “Then it may be dismissed.” As counsel for defendants was leaving the courtroom-the district attorney, addressing the court, said: “I now desire to file an information charging the defendants with the crime of robbery.” The Court: “I think I will permit the information to be filed.” The district attorney thereupon immediately filed an information in the same language as the first information except the added averments of venue. The court thereupon caused the following order or judgment to be made and entered of record: “On this *400day comes the district attorney, and moves that this action be dismissed, which is by the court granted, and the action is accordingly dismissed, and the defendants discharged from custody. Subsequently on this day the district attorney presents and has filed in open court a new information charging said defendants with the crime of robbery, and asks the court that a bench warrant issue for the arrest of the defendants herein, but the court, being doubtful of its jurisdiction to issue said warrant reserves its decision upon the question.” On the following day the court made an order denying the request for a bench warrant. One week thereafter the district attorney moved the court to set a day for the arraignment of the defendants on the second or new information. The court set a day for the hearing of the motion. On that day the defendants and their counsel failed to appear, whereupon the court fixed a day for the arraignment. Thereafter the defendants and their counsel appeared and moved the court to set aside the order requiring the defendants to so appear, and further moved the court to strike from the files the second or new information, upon the grounds that the action upon which the defendants had been regularly bound over, and in which the information had been filed, and to which they had pleaded, had been dismissed; that there was no preliminary examination upon which the second information could properly be based; that no process was issued requiring the presence of the defendants; and that the court was without jurisdiction to further proceed with, the case. The court denied the motion of the district attorney requiring the defendants who were in court to be arraigned and plead to the new information, and granted the defendants’ motion, upon the ground that the action was dismissed, and the defendants discharged from custody before the second information was filed. Thereafter the district attorney, upon notice to the defendants’ counsel, moved the court to amend the records of the court theretofore made, so as to read that the information was dismissed, and not that the action was dismissed and the defendants discharged. Upon a hearing had this motion was also de*401nied. It is further alleged that the court refused to issue a bench warrant for the' arrest and appearance of the defendants, or to fix a day for their arraignment, or to further proceed with the case. Upon the foregoing allegations the district attorney has applied to this court for a writ of mandate to compel the court to correct or amend the record in the particular referred to; to vacate the order striking the second information from the files and to reinstate it; to fix a day for the arraignment of the defendants on the second or new information, and “to proceed with the trial of said action against the defendants in the regular manner and as provided by law.” To the petition so filed by the district attorney the judge of the district court has filed a general demurrer.
Of course mandamus will not lie to correct the records of the district court as prayed for. Where a 1, 2 court without authority refused jurisdiction and dismissed an action, mandamus will lie to compel him to reinstate it and to proceed with it. But section 5068, Comp. Laws 1907, confers upon the court the power, on his own motion, or on the application of the district attorney, and in furtherance of justice, to order “an action, information or indictment to be dismissed.” It was within the power of the court, upon the motion of the district attorney, to dismiss the action, and to discharge the defendants, as recited in the order or judgment of dismissal made and entered by the court. Whether, in furtherance of justice, such an order ought to have been made under all the circumstances is another thing. But mandamus will not lie to inquire into that. The district attorney, however, insists that though the order and judgment of dismissal and discharge as made and entered by the district court shall stand, nevertheless, the first information being a nullity, he had the right to file a new or second information upon the preliminary examination, and upon the records thereof already had and transmitted to the district court by the committing magistrate, *402and upon wbicb the first information was founded, without leave or intervention of the court, and that upon a presentation of such new information it was the legal duty of the court to entertain it, and to proceed' with the case as though it had been the first information filed in the case. In support of such a contention it is argued that the commitment proceedings and the transmission of the records thereof to the district court were no part of the action pending in the district court, and that the first information which was filed, and the subsequent proceedings had in respect thereof, constituted the action in the district court; and hence, when the district court dismissed the action and discharged the defendants, it was in effect but a dismissal of the information.
We cannot agree with the district attorney that a dismissal of an action and a discharge of the defendant is synonymous with, and amounts to no more than, a dismissal of an information. True, such a dismissal and discharge 3 might not be a bar to another prosecution for the same offense. But that is another thing. When the action was dismissed, and the defendants discharged and sent out of court, that put an end to that controversy. Whether such a proceeding constitutes a bar to another prosecution for the same offense is another matter. The statute requires the district attorney to file an information within thirty days after the defendant has been examined and committed by the magistrate. It further provides that if the district attorney determines that an information ought not to be filed, he shall subscribe and file a statement in writing, setting forth his reasons for not filing an information. If the court is not satisfied with such statement, he shall direct and require the district attorney to file an information. If no such information is directed by the court, the defendant shall be discharged, and his bail exonerated. If the position of the district attorney is correct that there is no action pending before the district court until an information is filed it is somewhat difficult to perceive the power of the court to discharge the defendant and exonerate his bail, or to take any action in the premises without the filing of an infor*403mation. It is not tbe information alone which takes the place of proceedings by indictment. It is the preliminary-examination held by the committing magistrate, and the information filed by the district attorney. Except by indictment, the defendant cannot be prosecuted in the district court for the commission of an offense without a preliminary examination, nor without the filing of an information. In such case both are initial and essential steps. While it may be said that a prosecution has not been commenced in the district court until an information has been filed, still the preliminary examination is just as initial and essential to the commencement of an action in the district court as is the filing of an information. An information cannot properly exist without a preliminary examination, but the record of a preliminary examination is entirely 4 distinct from the information and can and does exist after the information is destroyed. The setting aside or the dismissal of-the information does not affect the preliminary examination. But when the action is dismissed, and the defendant discharged from custody, and permitted to go without day, and his bail exonerated, the whole controversy is put at an end, and the cause carried out of court.
There is still another reason why we think the district-attorney was not entitled to file the second information under all the circumstances. Section 4694 of the statute provides:
“An information may be amended in matter of substance or form at any time before tbe defendant pleads, -without leave of court. Tbe information may be amended at any time thereafter and on tbe trial as to all matters of form, at tbe discretion of tbe court, where tbe same can be done without prejudice to tbe rights of tbe defendant. No amendment must cause any delay of tbe trial unless for good cause shown by affidavit.”
The first information, failing to allege venue, undoubtedly was defective in matters of substance. The defendants had been arraigned thereon and their plea taken before leave was asked to amend the information. The. 5 court evidently denied the application to amend upon *404tbe theory that the court, because of the statute, was then without authority to allow it. Such seems to be the plain reading of the statute. After the amendment was denied, to then permit the district attorney to dismiss the information, defective in substance, and to substitute 6 and file a new information in the same cause, curing such defect, is in effect but to permit an amendment of the first information. Such a method would indirectly accomplish a purpose directly forbidden by the statute. And to hold that the court, after the defendants’ plea, was without authority to permit an information to- be amended in matters of substance, and then follow the district attorney, without leave or intervention of the court, to dismiss the defective information, and file a new one in the same cause curing such defect, is to render the provisions of the statute nugatory. It is useless to discuss the question as to the purpose or utility of such a statute. The legislature must be understood to mean what it has plainly expressed. 7 It is our duty to give the statute such effect, and not to set it aside or evade its operation-by forced and unreasonable construction. The enactment violates no- constitutional provision or principle; and, if it has been improvidently passed, the responsibility is with the legislature, and not with us. But it is said that section 4783 permits a new information to be filed, upon the direction of the court, when a demurrer has been sustained to the information; and, if the court does not so direct, the judgment on the demurrer is final upon the information, and a bar to another prosecution for the same offense. The Supreme -Court of California under a like statute held that, upon the sustaining of a demurrer to an information, a new information could not be filed by the district attorney without the direction of the court (People v. Jordan, 63 Cal. 219), and that the action of the court giving the district attorney leave to file a new information, in such case, without a positive direction of the court so to do, gave the district attorney no right to file a new- information. (Ex parte- Williams, 116 Cal. 512, 48 Pac. 499.) These rulings have bepn approved by
*405this court in the case of State v. Crook, 16 Utah. 212, 51 Pac. 1091. Upon the sustaining of a demurrer to an information the statute undoubtedly, upon the direction of the court, permits the filing of a new information 8 when, in the judgment of the court, the defects in the information, whether of matters of form or substance, may be avoided in a new information. But under our Code of Criminal Procedure the demurrer to an information and the ruling thereon precedes the defendant’s plea.
We have been referred to still another section of the statute (4793) which provides:
“If the defendant shall have been formerly acquitted on the ground of variance between the information or indictment and the proof, or the information or indictment shall have been 9 dismissed upon an objection to its form or substance, or in order to hold the defendant for a higher offense, without a judgment of acquittal, it shall not be an acquittal of the same offense.”
In a ease where the first information in a prosecution for robbery was invalid for the reason that it contained no allegation of the ownership of the property taken, and the information on the motion of the district attorney was dismissed, and the defendant discharged, and a new information filed by the district attorney, without leave or direction of the court, and upon which new information the defendant was. prosecuted and convicted, the Supreme Court' of California held that, under a section of their statute corresponding with section 4793 of our statute, the pleas of jeopardy and former acquittal, based upon the dismissal of the first information and the discharge of the defendant, were not well founded, and that the district attorney was authorized to file a new information without the direction or order of the court. (People v. Ammerman, 118 Cal. 23, 50 Pac. 15.) And in the case where the defendant upon an information filed was prosecuted for larceny, and the jury disagreed and were discharged, that court again held that the trial court did not err in directing the district attorney to file a new information charging the defendant with embezzlement, and *406tba.t tbe defendant’s conviction of sucb offense was not unlawful because be was not given another preliminary examination. (Ex parte Nicholas, 91 Cal. 640, 28 Pac. 47.) Tbe correctness of these rulings under tbe criminal procedure of California may be conceded. They were based upon a section of tbe statute corresponding with section 4793 of our statute, providing that a former acquittal on the ground of variance is not a bar to a further prosecution for tbe same offense. But in none of tbe cases where a new information was permitted to be filed was it made to appear that tbe action in which tbe first information bad been filed bad itself been dismissed. Nor did California have a provision in their statute corresponding with section 4694 of our statute, forbidding the amendment of an information in matters of substance after plea. That provision of our statute was borrowed from tbe Montana statute.
We think tbe demurrer to tbe petition ought to be, and it therefore is, sustained, and tbe writ denied. It is so ordered.
FRICK and McCABTY, JJ., concur.