
378 N.W.2d 710 (1985)
STATE of Iowa, Appellee,
v.
Patricia (Schnetter) JENSEN, Appellant.
No. 85-574.
Supreme Court of Iowa.
December 18, 1985.
Charles L. Harrington, Appellate Defender, and B. John Burns, Asst. Appellate Defender, for appellant.
Thomas J. Miller, Atty. Gen., Lona Hansen, Asst. Atty. Gen., and H. Dale Huffman, County Atty., for appellee.
Considered by REYNOLDSON, C.J., and McCORMICK, McGIVERIN, LARSON and SCHULTZ, JJ.
McCORMICK, Justice.
This appeal involves a question of the district court's jurisdiction to revoke probation. Upon her plea of guilty to second-degree burglary in violation of Iowa Code section 713.1 (1981), defendant Patricia Schnetter Jensen received a deferred sentence and was placed on two years' probation commencing December 13, 1982. An application to revoke her probation was filed by the Pocahontas County Attorney on December 10, 1984, based on a series of alleged probation violations including events in November 1984. Hearing on the application was held on January 7, 1985, and an order revoking defendant's probation was entered on January 8, 1985. In appealing from the subsequent sentence, defendant contends the district court lacked jurisdiction to revoke her probation after it had expired. We find that the court had jurisdiction and therefore affirm the judgment.
Although the State contends otherwise, defendant was correct in attacking revocation by direct appeal rather than in a collateral postconviction action. A revocation order in a deferred sentencing proceeding inheres in the subsequent judgment and thus may be challenged on appeal from the judgment. State v. Farmer, 234 N.W.2d 89, 91 (Iowa 1975).
*711 In challenging the revocation order, defendant relies on Iowa Code section 907.9 (1983), which provides in relevant part:
At any time that the court determines that the purposes of probation have been fulfilled, the court may order the discharge of any person from probation. At the expiration of the period of probation, in cases where the court fixes the term of probation, the court shall order the discharge of such person from probation, and the court shall forward to the governor a recommendation for or against restoration of citizenship rights to such person. A person who has been discharged from probation shall no longer be held to answer for the person's offense. Upon discharge from probation, if judgment has been deferred under section 907.3, the court's criminal record with reference to the deferred judgment shall be expunged.
(Emphasis added.) We must decide whether a court has authority under this statute to revoke probation when revocation proceedings have been initiated but not completed before the probation term has ended.
The parties agree this question is one of legislative intent. The question cannot be answered from the language of the statute alone. The statutory language shows that a probationer is not discharged automatically at the end of the probation period. An order of discharge is required. Defendant contends the court's duty is mandatory when the period has expired. The State contends the order is not mandatory unless probation has been completed satisfactorily. Because this dispute cannot be resolved from language of the statute alone, we resort to rules of statutory construction. See Office of Consumer Advocate v. Iowa State Commerce Commission, 376 N.W.2d 878, 881 (Iowa 1985).
Two rules of statutory construction support the State's position. One is the rule that we consider the purpose of the statute and seek to give it effect. The other is the rule that we consider related statutes on the same subject and seek to harmonize them. Id.
The purposes of probation are expressed in section 907.7: "The purposes of probation are to provide maximum opportunity for the rehabilitation of the defendant and to protect the community from further offenses by the defendant and others." The length of probation is directly related to these purposes:
In determining the length of probation, the court shall determine what period is most likely to provide maximum opportunity for the rehabilitation of the defendant, to allow enough time to determine whether or not rehabilitation has been successful, and to protect the community from further offenses by the defendant and others.
Id. When probation is violated these purposes are frustrated. It is reasonable to believe the legislature intended that the period of probation be successfully served as a condition upon the probationer's right to discharge.
This intention is confirmed when sections 907.3(1) and 908.11 are considered. Section 907.3(1) authorizes deferred judgments like the one received by defendant in this case. It provides in part:
Upon fulfillment of the conditions of probation, the defendant shall be discharged without entry of judgment. Upon violation of the conditions of probation, the court may proceed as provided in chapter 908.
In relevant part, section 908.11 provides:
If the violation is established, the court may continue the probation with or without an alteration of the conditions of probation. If the defendant is an adult the court may hold the defendant in contempt of court and sentence the defendant to a jail term while continuing the probation, or may revoke the probation and require the defendant to serve the sentence imposed or any lesser sentence, and, if imposition of sentence was deferred, may impose any sentence which might originally have been imposed.
These provisions show the legislature intended the district court to have considerable flexibility in enforcing the terms of *712 probation. The defendant should not have an automatic right to discharge from probation when the terms have not been fulfilled.
One provision of section 907.2, which prescribes general duties of probation officers, provides arguable support for a contrary conclusion: "Probation officers shall keep records of their work and shall make reports to the court when alleged violations occur and within no less than thirty days before the period of probation will expire." To interpret this provision as precluding the reporting of violations that occur within the last thirty days of the probation period would shorten every probation by thirty days. We do not believe such an interpretation is warranted. Instead, we believe the provision is intended to require probation officers to make reports in two circumstances. One circumstance is when violations occur, even if they occur within the last thirty days of the period. The other circumstance is the reaching of a point in every probation not less than thirty days from the end of the period when a status report must be made, even if no violations have occurred.
Moreover, if the district court lost jurisdiction to revoke probation when the period expired, a defendant might escape revocation for violations occurring near the end of the period. Unless sufficient time existed for holding a hearing and ordering revocation, the period would expire and no action could then be taken except to discharge the defendant. We do not believe the legislature intended such a fortuitous result. Instead we believe the legislature conditioned the defendant's right to discharge from probation at the conclusion of the period on its successful fulfillment. At least in circumstances like those in the present case, where an application for revocation is filed before the end of the period, we find that the court retains jurisdiction to revoke probation.
A majority of other courts that have addressed the issue in analogous circumstances have reached the same conclusion.[1]See N. Cohen and J. Gobert, The Law of Probation and Parole § 11.01 at 525 (1983) ("What this means is that process sufficient to begin revocation proceedings must issue before the end of the probation or parole term."). Some courts interpret similar statutes to permit revocation within a reasonable time after expiration of the probation period even if the process was not initiated during the period.[2] Only a few courts have decided cases that support defendant's position.[3] We need not decide in this case whether our statute requires revocation proceedings to be initiated before expiration of the probation period. It is sufficient to hold, as we do, that the district court does not lose jurisdiction of a revocation proceeding that has been commenced but not completed before the period *713 expires. We also hold that a revocation proceeding is commenced with the filing in district court of an application for revocation.
Because we reject defendant's only claim on appeal, we affirm the district court.
AFFIRMED.
NOTES
[1]  See Parkerson v. State, 230 Ark. 118, 321 S.W.2d 207 (1959); Tiller v. State, 257 A.2d 385 (Del.Sup.1969); State v. Gazda, 257 So.2d 242 (Fla.1971); People v. Green, 91 Ill.App.3d 127, 46 Ill.Dec. 515, 414 N.E.2d 237 (1980); Gossett v. Commonwealth, 384 S.W.2d 308 (Ky.1964); People v. Wakefield, 46 Mich.App. 97, 207 N.W.2d 461 (1973); State ex rel. Carlton v. Haynes, 552 S.W.2d 710 (Mo.1977); Sherman v. Warden, 94 Nev. 412, 581 P.2d 1278 (1978); State v. Gibson, 156 N.J.Super. 516, 384 A.2d 178 (1978); People v. Cooper, 54 Misc.2d 42, 280 N.Y.S.2d 920 (1967); State v. Gooding 194 N.C. 271, 139 S.E. 436 (1927); Thompson v. State, 620 P.2d 422 (Okla.Crim.App.1980); Bryant v. State, 233 Or. 459, 378 P.2d 951 (1963); State v. Taylor, 111 R.I. 653, 306 A.2d 173 (1973); Lovell v. State, 223 S.C. 112, 74 S.E.2d 570 (1953); Allen v. State, 505 S.W.2d 715 (Tenn.1974); Richards v. State, 657 S.W.2d 174 (Tex.Crim.App.1983); State v. Russell, 27 Wash.App. 309, 617 P.2d 467 (1980); State ex rel. Cox v. State Department of Health and Social Services, 105 Wis.2d 378, 314 N.W.2d 148 (Wis.Ct.App.1981); Dent v. District of Columbia, 465 A.2d 841 (D.C.1983).
[2]  See State v. Berry, 287 Md. 491, 413 A.2d 557 (1980); Commonwealth v. Sawicki, 369 Mass. 377, 339 N.E.2d 740 (1975); State v. White, 193 Neb. 93, 225 N.W.2d 426 (1975); Decker v. State, 209 N.W.2d 879 (N.D.1973); Commonwealth v. Ruff, 272 Pa.Super. 50, 414 A.2d 663 (1979).
[3]  See Keller v. Superior Court, 22 Ariz.App. 122, 524 P.2d 956 (1974); People v. Ham, 118 Cal. Rptr. 591, 44 Cal.App.3d 288 (1975); Todd v. State, 108 Ga.App. 615, 134 S.E.2d 56 (1963); Cook v. Commonwealth, 211 Va. 290, 176 S.E.2d 815 (1970); State ex rel. Phillips v. Wood, 152 W.Va. 568, 165 S.E.2d 105 (1968).
