
148 Cal.App.3d 112 (1983)
195 Cal. Rptr. 802
THE PEOPLE, Plaintiff and Respondent,
v.
RAYMOND D. ROE, Defendant and Appellant.
Docket No. 15157.
Court of Appeals of California, Fourth District, Division One.
October 19, 1983.
*114 COUNSEL
Gary M. Bubis, under appointment by the Court of Appeal, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, A. Wells Petersen and Pat Zaharopoulos, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
WIENER, J.
In this case we examine the nature of the 120-day limitation on a trial court's authority to recall a sentence and commitment on its own *115 motion and resentence a defendant. (Pen. Code, § 1170, subd. (d).)[1] We conclude that limitation is jurisdictional, and thus the lower court lacked authority to resentence the defendant, Raymond D. Roe, nine months after originally pronouncing sentence. Rather than dismiss Roe's attempted appeal from the judgment purportedly entered upon resentencing, we treat that appeal as a petition for a writ of habeas corpus. Thus reaching the merits we conclude Roe's original sentence was authorized and properly imposed and must now be completed.

Factual and Procedural Background
During the course of his abortive nocturnal effort to burglarize Michele Reynolds' home, Roe severely beat Reynolds about her face and eyes. The injuries he inflicted required 22 stitches. When he committed the offense Roe was on parole from the California Rehabilitation Center where he had received treatment for drug addiction.
Roe pleaded guilty to first degree burglary (§ 459, former § 460, subd. (1) and inflicting great bodily injury (§ 12022.7) and agreed to a Harvey waiver (People v. Harvey (1979) 25 Cal.3d 754, 757-759 [159 Cal. Rptr. 696, 602 P.2d 396]) in exchange for the dismissal of three prior felony conviction allegations and a second count charging assault (former § 245, subd. (a)) and inflicting great bodily injury. (§ 12022.7.) The district attorney also agreed to a maximum seven-year sentence and dismissed a two-count information (Health & Saf. Code, § 11352) in an unrelated case arising out of Roe's participation in two cocaine transactions.
On October 7, 1981, the court sentenced Roe to serve seven years, consisting of a four-year middle term for the burglary conviction (§ 461, subd. (1) plus the three-year enhancement. (§ 12022.7.) Judgment was entered the same day committing Roe to prison. At the October 7 hearing the court said it was sentencing Roe "... pursuant to 1170(d) of the Penal Code which does allow a modification if the Department of Corrections or if I decide to change the term upon the recommendation." On March 31, 1982, at an ex parte hearing the court issued an order to produce Roe for resentencing at a hearing to be held in May. Counsel for both the prosecution and defense attended the March 31 hearing. On April 23 the Department of Corrections filed a diagnostic study and evaluation of Roe as requested by the court. The unanimous recommendation of the department's study team was that no change be made in Roe's sentence and commitment. At a hearing on June 11 with Roe and both counsel in attendance the court set a "modification hearing" for July 8, 1982, and ordered the preparation of a supplemental *116 probation report. In accordance with that report's recommendation, the court resentenced Roe on July 8 to a seven-year term identical to that originally imposed. Roe filed a timely notice of appeal from the judgment entered on July 8. Although the record does not clearly reflect when the court recalled Roe's sentence and commitment, it appears the court took those steps at the March 31 hearing.

Discussion

I
(1) As a general rule, when a defendant is committed and execution of his sentence begins the trial court loses jurisdiction to reconsider a denial of probation (Holder v. Superior Court (1970) 1 Cal.3d 779, 783 [83 Cal. Rptr. 353, 463 P.2d 705]; People v. Calhoun (1977) 72 Cal. App.3d 494, 497 [140 Cal. Rptr. 225]) or to vacate or modify the sentence imposed. (People v. McAllister (1940) 15 Cal.2d 519, 526-527 [102 P.2d 1072], disapproved on another ground in People v. Thomas (1959) 52 Cal.2d 521, 534 [342 P.2d 889]; People v. Clinton (1966) 243 Cal. App.2d 284, 288 [52 Cal. Rptr. 221].) (2) There are, however, some exceptions to the rule. Trial courts, for instance, have the authority to correct clerical errors in recording sentences and judgments (In re Candelario (1970) 3 Cal.3d 702, 705 [91 Cal. Rptr. 497, 477 P.2d 729]) and the obligation to correct the imposition of a sentence unauthorized by law. (People v. Massengale (1970) 10 Cal. App.3d 689, 693 [89 Cal. Rptr. 237].)
(3) Section 1170, subdivision (d) represents a limited statutory exception to the general rule. That section provides in pertinent part: "(d) When a defendant subject to this section or subdivision (b) of Section 1168 has been sentenced to be imprisoned in the state prison and has been committed to the custody of the Director of Corrections, the court may, within 120 days of the date of commitment on its own motion, or at any time upon the recommendation of the Director of Corrections or the Board of Prison Terms, recall the sentence and commitment previously ordered and resentence the defendant in the same manner as if he had not previously been sentenced, provided the new sentence, if any, is no greater than the initial sentence...." (Italics added.)
The predecessor to section 1170, subdivision (d) was former section 1168. (Stats. 1969, ch. 990, § 1, pp. 1959-1960; see generally People v. Gainer (1982) 133 Cal. App.3d 636, 639-640, fn. 3 [184 Cal. Rptr. 120].) That section also authorized the trial court, under certain circumstances, to recall a sentence and commitment and to resentence a defendant on its own motion within 120 days of commitment. (Ibid.) The 120-day limitation on the exception *117 allowed by former section 1168 was jurisdictional and could not be circumvented by successive invocations of that section's recall and resentencing authority. (People v. Calhoun, supra, 72 Cal. App.3d at p. 497.) The trial court could exercise such authority only within the first 120 days of the original commitment. (Ibid.)
We think Calhoun's strict jurisdictional interpretation of former section 1168's 120-day limitation should apply to the corresponding limitation of section 1170, subdivision (d). The statutory language on its face indicates the trial court's authority to recall and resentence may only be exercised within the first 120 days of the original commitment. (See People v. Laue (1982) 130 Cal. App.3d 1055, 1060 [182 Cal. Rptr. 99] (dictum).) Such an interpretation is consistent with legislative intent. Calhoun was decided shortly after the Legislature amended section 1170 to conform the language of subdivision (d)'s 120-day limitation to the corresponding language of former section 1168. (Compare Stats. 1977, ch. 165, § 15, p. 648 with Stats. 1969, ch. 990, § 1, p. 1960.) On five occasions after Calhoun's publication the Legislature amended section 1170 without changing the language of subdivision (d)'s 120-day limitation. (Stats. 1978, ch. 579, § 29, p. 1989; Stats. 1979, ch. 255, § 8, p. 550; Stats. 1980, ch. 676, § 251, p. 1985; Stats. 1980, ch. 1117, § 7, p. 3596; Stats. 1981, ch. 1111, § 1, p. 4336.) The Legislature's repeated reenactment of that language without change indicates it intended Calhoun's strict jurisdictional interpretation would apply to section 1170, subdivision (d). (People v. St. Martin (1970) 1 Cal.3d 524, 535 [83 Cal. Rptr. 166, 463 P.2d 390]; Property Research Financial Corp. v. Superior Court (1972) 23 Cal. App.3d 413, 421-422 [100 Cal. Rptr. 233].) Any other interpretation allowing the trial court open-ended authority to vacate or modify a valid sentence would infringe on the power of the Legislature to establish a determinate sentencing system providing statutorily fixed terms for given crimes to be imposed by courts with limited discretion to vary those terms. (See § 1170, subd. (a)(1); People v. Tanner (1979) 24 Cal.3d 514, 519, fn. 3 [156 Cal. Rptr. 450, 596 P.2d 328].)
Here, the Department of Corrections recommended no change be made in Roe's sentence and commitment, and the trial court's purported recall and resentencing occurred more than 120 days after Roe's original commitment. Consequently, the trial court was without jurisdiction to resentence Roe on July 8, 1982. Roe argues the People waived this jurisdictional defect by failing to raise it at the hearings held on March 31, June 11 and July 8, 1982. This argument overlooks the fact the court was without subject matter as well as personal jurisdiction once the first 120 days passed. (See In re Black (1967) 66 Cal.2d 881, 888-891 [59 Cal. Rptr. 429, 428 P.2d 293]; People v. Helton (1979) 91 Cal. App.3d 987, 991 [154 Cal. Rptr. *118 482].) (4) Subject matter jurisdiction cannot be conferred on the court by the consent of the parties. (In re Griffin (1967) 67 Cal.2d 343, 346-347 [62 Cal. Rptr. 1, 431 P.2d 625]; People v. Perez (1961) 198 Cal. App.2d 460, 464-465 [18 Cal. Rptr. 164].)

II
(5a) Having concluded the 120-day limitation of section 1170, subdivision (d) is jurisdictional, we must now determine the proper manner for disposing Roe's appeal. Had the trial court resentenced Roe within the 120-day period, Roe could have appealed his new sentence by timely filing a notice of appeal. (§ 1237, subd. (1); People v. Flores (1974) 12 Cal.3d 85, 93, fn. 6 [115 Cal. Rptr. 225, 524 P.2d 353].) However, because the court acted after the 120 days had passed and thus lacked jurisdiction to resentence Roe, the judgment the court purportedly entered on July 8, 1982, is of no effect and cannot be appealed. (See People v. Behrmann (1949) 34 Cal.2d 459, 462 [211 P.2d 575].) Appellate courts routinely dismiss attempted appeals from nonappealable judgments and orders. (See, e.g., id., at pp. 462, 464; People v. Clinton, supra, 243 Cal. App.2d at p. 288.)
In light of the procedural history of this case, a routine dismissal of Roe's appeal would be manifestly unjust. Because the trial court invoked section 1170, subdivision (d) at his original sentencing, Roe reasonably waited to file a notice of appeal until after the court resentenced him. To dismiss Roe's appeal now would, in effect, deprive him of his right to appeal. (6) (See fn. 2.) (See § 1237, subd. (1).)[2] Roe should not be foreclosed from challenging the validity of his sentence where he reasonably relied on the lower court's misunderstanding of its jurisdictional authority.
Rather than dismiss, we shall treat Roe's appeal as a petition for a writ of habeas corpus. (7) Such petitions may be brought to challenge judicial acts in excess of jurisdiction. (§ 1487, subd. (1); In re Brown (1973) 9 Cal.3d 612, 624-625 [108 Cal. Rptr. 465, 510 P.2d 1017].) (8) Trial court probation and sentencing decisions must be grounded on a proper exercise of judicial discretion. (People v. Russel (1968) 69 Cal.2d 187, 194-195 [70 Cal. Rptr. 210, 443 P.2d 794]; see, e.g., People v. Bolton (1979) 23 Cal.3d 208, 216-218 [152 Cal. Rptr. 141, 589 P.2d 396]; People v. Giminez (1975) 14 Cal.3d 68, 71-73 [120 Cal. Rptr. 577, 534 P.2d 65].) *119 When based on an abuse of discretion, as Roe contends was the case here (see part III, post), such decisions are acts in excess of jurisdiction. (See Neal v. State of California (1960) 55 Cal.2d 11, 16-17 [9 Cal. Rptr. 607, 357 P.2d 839], cert. den., 365 U.S. 823 [5 L.Ed.2d 700, 81 S.Ct. 708]; Abelleira v. District Court of Appeal (1941) 17 Cal.2d 280, 287-291 [109 P.2d 942, 132 A.L.R. 715]; see also Witkin, Cal. Criminal Procedure (1963 & 1983 supp., pt. 1) Habeas Corpus and Other Extraordinary Writs, §§ 805, 808.) (5b) Treatment, therefore, of Roe's appeal as a habeas corpus petition is appropriate in this case. (Compare People v. Olken (1981) 125 Cal. App.3d 1064, 1067-1068 [178 Cal. Rptr. 497].)

III
Turning to the merits, Roe argues the lower court abused its discretion when it denied him probation. Alternatively, Roe argues the court abused its discretion by failing either to strike the additional punishment for the great bodily injury enhancement (§ 1170.1, subd. (h) (former subd. (g)); Cal. Rules of Court, rule 445)[3] or to impose the lower rather than the middle term for his burglary conviction.[4] (§ 1170, subd. (b); rule 439(b).)
(9) A sentencing court must state adequate reasons for denying probation and imposing the middle term. (People v. Salazar (1980) 108 Cal. App.3d 992, 1000 [167 Cal. Rptr. 38]; see also People v. Mobley (1983) 139 Cal. App.3d 320, 324 [188 Cal. Rptr. 583].) In denying probation here the court acknowledged Roe's remorse (rule 414(d)(9)) but noted the seriousness of his offense (rule 414(c)(1)), the vulnerability of his victim (rule 414(c)(2)), the injuries he inflicted (rule 414(c)(4)), his prior record of criminal convictions (rule 414(d)(1)) and his parole status when he committed the offense. (Rule 414(d)(2).) The court further found the circumstances in aggravation and mitigation were equal. (10) Sentencing courts have wide discretion in weighing aggravating and mitigating factors (People v. Evans (1983) 141 Cal. App.3d 1019, 1022 [190 Cal. Rptr. 633]), and may balance them against each other in qualitative as well as quantitative terms. (See People v. Lambeth (1980) 112 Cal. App.3d 495, 501 [169 Cal. Rptr. 193].) The record shows the court fully considered the many factors argued by both the prosecution and the defense, and then reached a reasonable assessment of their relative weight. On that basis the court did not abuse its *120 discretion by denying probation[5] and imposing the middle term. (People v. Evans, supra, 141 Cal. App.3d at p. 1022.) Absent circumstances in mitigation of the additional punishment (§ 1170.1, subd. (h); rule 445), the court also did not abuse its discretion by failing to strike the three-year term for the great bodily injury enhancement. (See People v. Hughes (1980) 112 Cal. App.3d 452, 463-464 [169 Cal. Rptr. 364].) Roe's October 7, 1981, sentence was authorized (§§ 461, subd. (1), 12022.7) and properly imposed (see People v. Peace (1980) 107 Cal. App.3d 996, 1001-1002 [166 Cal. Rptr. 202]) and must now be completed.

Disposition
Writ denied; defendant to complete service of sentence originally imposed.
Brown (Gerald), P.J., and Cologne, J., concurred.
NOTES
[1]  All statutory references are to the Penal Code unless otherwise indicated.
[2]  Defendants who plead guilty retain the right to appeal in certain circumstances. (§ 1237.5; Cal. Rules of Court, rule 31(d).) Challenging the validity of a sentence or a sentencing procedure after entry of the plea is one such circumstance. (See People v. Holland (1978) 23 Cal.3d 77, 83, fn. 5 [151 Cal. Rptr. 625, 588 P.2d 765]; see also Witkin, Cal. Criminal Procedure (1983 supp., pt. 1) Appeal, § 639E, subds. (b)(3) and (b)(4), p. 866.)
[3]  All rule references are to the California Rules of Court.
[4]  Roe understandably directs his challenges to the sentence imposed on July 8, 1982. That sentence, of course, cannot be appealed. (See part II, ante.) However, because Roe's two sentences were identical, we treat his arguments as being addressed to the sentence imposed on October 7, 1981.
[5]  From the time Roe entered his guilty plea to the time the court purportedly resentenced him, everyone in the system  the court, the probation officer, the Department of Corrections, the prosecution, defense counsel and various defense experts  has assumed Roe's eligibility for probation. Apart from brief references in passing to rule 416(b) in defense counsel's statement in mitigation and argument at resentencing, the first instance where anyone squarely addresses the possibility Roe might be ineligible for probation unless his is an unusual case (§§ 462, subd. (a), 1203, subds. (e)(3) and (e)(4)) appears in Roe's opening brief on appeal. Discussion of the possibility Roe might be absolutely ineligible for probation (§ 1203.075, subd. (a)(6)) appears nowhere at all. Because the record amply supports the lower court's decision on the merits to deny probation, we will not at this late stage consider either of the above possibilities.
