Given, J.
The county attorney, desiring to call one John Brannan as a witness, who had not been examined before the grand jury, and whose name was not indorsed upon the indictment, gave notice under section 5373 of the Code. On being called, Mr. Brannan was asked, “What is your present occupation ?” to which he answerd, “Soldier, at present; working for the government.” Defendant’s counsel objected to the witness testifying under this notice, for the reason that his occupation is not given in the notice as required by statute. Thereupon the state asked, “What was 1 your occupation before your enlistment?” to which defendant’s objection was sustained, and the court, upon defendant’s objection, refused to allow any further examination of Mr. Brannan as to his occupation. To all of these rulings the state excepted, and from them this appeal is taken.
Said section 5373 contains the following: “The county attorney, in offering the evidence in support of the indict' ment in the order prescribed in the last section, shall not be permitted to introduce any witness who was not examined before a committing magistrate or the grand jury, and the *99minutes of whose testimony were not presented with the indictment to the court, unless he shall have given to the defendant a notice in writing, stating the name, nlace of residence and occupation of such witness, and the substance of what he expects to prove by him on the trial, at least four days before the commencement of such trial.” The notice given in this case wa.s duly served in time, and notified the defendant that the state would introduce the testimony of “John Brannan, a resident of the town of Shell-rock, Butler county, Iowa, whose occupation is that of a day laborer, and whose age is 25 years,” and stating the substance of what it was expected to prove by him. The objection, seems to have been sustained upon the theory that, the witness having stated his occupation to be different from that named in the notice, his statement was conclusive, and that the variance was such as that the state was not entitled to his evidence. “The purpose of the statute is to secure to> the accused such knowledge of the evidence which will be given against him as will enable him to make proper preparation to contradict or explain it.” State v. Rainsbarger, 74 Iowa, 196; State v. Harlan, 98 Iowa, 458. “But errors in such notices as to the witness’ place of residence, or to facts expected to be proven by him, will not render the introduction of testimony of the witness erroneous, where the defects or mistakes in the notice are not prejudicial.” State v. Rainsbarger, supra. See, also, State v. Kreder, 86 Iowa, 25. In State v. Rainsbarger, supra, the notice gave the place of residence of the witness as Kansas City, Kansas, and it appeared that he lived in Kansas City, Missouri. It also said that this omission in giving his trud place of residence was not a reversible error, unless prejudicial. It has been repeatedly held that a variance between the name of the witness as endorsed on the indictment and his true name is not a valid objection to the examination of the witness, unless the defendant was misled or prejudiced by the variation. Houston v. State, 4 G. Greene, 437; State v. Pierce, 8 Iowa, 231; State v. Schlagel, 19 Iowa, 169; State *100v. McComb, 18 Iowa, 43; State v. Stanley, 33 Iowa, 526; State v. Arnold, 98 Iowa, 253; State v. Briggs, 68 Iowa, 416; State v. Harlan, 98 Iowa, 458. Tbis notice serves tire same purpose, so far as informing the defendant is concerned, as the indorsement of the names of witnesses on the indictment, and the minutes of their evidence returned by the grand jury. The purpose of each is to inform the defendant what persons will be examined on behalf of the state, and what is expected to be proven by them. We have seen that an error as to the name or residence of a witness that does not mislead the defendant as to the identity of the person will not prevent the state from examining such witness, and for the same reason a mistake in stating the occupation of the witness that does not mislead the defendant should not prevent the examination. Whether the state was entitled to examine this witness under said notice was a question for the court, and full inquiry as to the occupation of the witness and defendant’s acquaintance with him should have been permitted; and, if the court found that .the defendant was informed by the notice that this witness would be examined, the examination should have been permitted, and, if the court found otherwise, it should not. The state sought to prove that the defendant and Brannan had resided in the town of Shellrock for a long time, that they were acquainted, that there was no other John Brannan residing in that town, that up to the time of his enlistment in the army Brannan’s occupation had been that of a day laborer, and that defendant knew that fact. With this proven, there could be no doubt that the defendant knew that it was this John Brannan the state proposed to examine; yet the court accepted Brannan’s statement that his occupation was that of a soldier as conclusive, refused to allow this proof, and refused to allow the county attorney to state orally what he desired to prove as to Brannan’s occupation. This action of the court we think clearly erroneous, according to the record before us as presented by the appellant. — Reveesed.