
174 Cal.App.4th 1472 (2009)
In re M.B., a Person Coming Under the Juvenile Court Law.
THE PEOPLE, Plaintiff and Respondent,
v.
M.B., Defendant and Appellant.
No. F055289.
Court of Appeals of California, Fifth District.
June 18, 2009.
*1474 Courtney M. Selan, under appointment by the Court of Appeal, for Defendant and Appellant.
Edmund G. Brown, Jr., Attorney General, Michael P. Farrell, Assistant Attorney General, Louis M. Vasquez and Lloyd G. Carter, Deputy Attorneys General, for Plaintiff and Respondent.

OPINION
WISEMAN, Acting P. J. 
We hold that Welfare and Institutions Code section 733[1] allows a juvenile court to commit a ward to the Division of Juvenile Facilities[2] for a violation of probation found pursuant to an allegation under section 777, subdivision (a)(2), where the offense for which the ward received the probation is a DJF-eligible offense under section 733 and *1475 no petition alleging a more recent non-DJF-eligible offense has been sustained. The judgment is affirmed.

FACTUAL AND PROCEDURAL HISTORIES
On March 6, 2006, M.B. admitted to one misdemeanor count of vandalism (Pen. Code, § 594, subd. (b)(1)) alleged in a section 602 juvenile wardship petition. The juvenile court sustained that count and dismissed two others. It found the maximum time of confinement to be one year and ordered probation.
On September 29, 2006, M.B. responded to another section 602 petition and admitted to one count of assault by means likely to produce great bodily injury (Pen. Code, § 245, subd. (a)(1)), one count of participating in a criminal street gang (Pen. Code, § 186.22, subd. (a)), and an allegation pursuant to section 777, subdivision (a)(2), that he violated the terms of his probation by means not amounting to a crime. The juvenile court sustained those counts and dismissed several others. It found a maximum confinement time of five years and ordered continued probation, to be served in part at the Larry J. Rhoades Kern Crossroads Facility.
On February 20, 2008, answering a third petition, M.B. admitted to a probation violation not amounting to a crime within the meaning of section 777, subdivision (a)(2). The court sustained the allegation and dismissed another charge. The court again found the maximum confinement time to be five years, but this time committed him to DJF.

DISCUSSION
(1) Section 733 bars a juvenile court from committing a ward to DJF if: "The ward has been or is adjudged a ward of the court pursuant to Section 602, and the most recent offense alleged in any petition and admitted or found to be true by the court is not described in subdivision (b) of Section 707, unless the offense is a sex offense set forth in subdivision (c) of Section 290.008 of the Penal Code. This subdivision shall be effective on and after September 1, 2007." (§ 733, subd. (c).)
M.B. argues that his most recent offense was a violation of probation not amounting to a crime (§ 777, subd. (a)(2)), which is not among the enumerated offenses. Consequently, he says, the DJF commitment was unauthorized. The People argue that a probation violation is not an "offense alleged in [a] petition" within the meaning of section 733, so M.B.'s most recent offenses were the ones for which he received the probation he violated, i.e., assault by *1476 means likely to produce great bodily injury and criminal street gang participation. Assault by means likely to produce great bodily injury is one of the offenses listed as giving rise to DJF eligibility (see § 707, subd. (b)(14)), so the People contend the commitment was authorized.
The Court of Appeal recently considered a similar issue in In re J.L. (2008) 168 Cal.App.4th 43 [85 Cal.Rptr.3d 35]. After receiving probation for a DJF-eligible offense, J.L. went home from a juvenile center on a pass and failed to return, in violation of the terms of the probation. A freestanding notice under section 777i.e., a pleading alleging the probation violation alone, as opposed to a section 602 petition that included that allegation along with allegations of criminal offenseswas filed. (In re J.L., supra, at pp. 49-50.) A section 602 petition for further, non-DJF-eligible, offenses was filed later, but dismissed. (In re J.L., supra, at pp. 50, 53.) The juvenile court committed J.L. to DJF, expressing the theory that, although the most recent sustained allegation was only a probation violation, that violation related back to the DJF-eligible offense for which the probation had been imposed. (Id. at pp. 52-54.) The Court of Appeal affirmed on the ground that section 733, subdivision (c), says "the most recent offense alleged in any petition" and sustained must be an enumerated offense (italics added); the freestanding section 777 notice was not a petitionthat is, not a pleading alleging a criminal offense under section 602. Therefore, the most recent offense alleged in a petition was not the probation violation, but the DJF-eligible offense alleged in the petition that was sustained in the proceedings in which the probation was imposed. (In re J.L., supra, at pp. 57-58, 60.)
The present case differs from In re J.L., in that the probation violation here was not alleged in a freestanding section 777 notice but in a pleading titled "JUVENILE WARDSHIP PETITION WELF & INST CODE 602/777," in which the probation violation was alleged along with an allegation of a criminal offense, a violation of Penal Code section 496d (receiving a stolen vehicle). The latter allegation was dismissed, but the fact remains that the probation violation was "alleged in any petition." (§ 733, subd. (c).) It seems to us that it would exalt form over substance to say the top half of the third page of this pleading, on which the criminal charge appears, is a petition, while the bottom half of that same page, on which the probation violation allegation appears, is not.
(2) The question still must be answered, however, whether the probation violation was an "offense alleged in any petition" within the meaning of the statute. (§ 733, subd. (c), italics added.) M.B. argues that, under the facts of this case, the probation violation was an offense because the factual basis of it was a crime. He says the alleged Penal Code section 496d violation was the only basis of the claimed probation violation. In In re Eddie M. (2003) 31 *1477 Cal.4th 480, 506-508 [3 Cal.Rptr.3d 119, 73 P.3d 1115], however, our Supreme Court held that an allegation under section 777 of a probation violation not amounting to a crime cannot, as a matter of law, lead to a finding that a criminal offense has been committed. This is so even if the underlying conduct is a crime. (John L. v. Superior Court (2004) 33 Cal.4th 158, 165 [14 Cal.Rptr.3d 261, 91 P.3d 205].) On the other hand, even though prosecutors have discretion to treat criminal conduct as a probation violation not constituting a crime by charging it under section 777 alone, the charge under those circumstances arguably should be regarded as alleging an "offense" for purposes of section 733 simply because the charge would not exist but for the alleged criminal conduct. Beyond this, M.B. argues that an "offense" is simply a violation of law, and a probation violation is a violation of law regardless of whether it is also a crime.
(3) Our ultimate task in interpreting the word "offense" in section 733 is "to ascertain and effectuate legislative intent." (People v. Woodhead (1987) 43 Cal.3d 1002, 1007 [239 Cal.Rptr. 656, 741 P.2d 154].) To the extent the language in the statute may be unclear, we look to legislative history and the statutory scheme of which the statute is a part. (People v. Bartlett (1990) 226 Cal.App.3d 244, 250 [276 Cal.Rptr. 460].) We look to the entire statutory scheme in interpreting particular provisions "so that the whole may be harmonized and retain effectiveness." (Clean Air Constituency v. California State Air Resources Bd. (1974) 11 Cal.3d 801, 814 [114 Cal.Rptr. 577, 523 P.2d 617].) "In the end, we `"must select the construction that comports most closely with the apparent intent of the Legislature, with a view to promoting rather than defeating the general purpose of the statute, and avoid an interpretation that would lead to absurd consequences." [Citation.]'" (Torres v. Parkhouse Tire Service, Inc. (2001) 26 Cal.4th 995, 1003 [111 Cal.Rptr.2d 564, 30 P.3d 57].)
(4) It is unlikely that the Legislature intended always to bar DJF commitments for juveniles who commit DJF-eligible offenses, who are given a second chance via probation, and who fail to make good on that second chance. As we have pointed out elsewhere, the purpose of the enactment that became section 733 was to reduce the cost and increase the effectiveness of juvenile confinement by shifting all but the most serious juvenile offenders to county facilities. (In re N.D. (2008) 167 Cal.App.4th 885, 891-892 [84 Cal.Rptr.2d 517].) This purpose does not support the view that those who commit the offenses the Legislature deemed serious enough for DJF must not be confined there if they first get probation but then violate its terms. The Legislature could not have intended that juvenile court judges be forced into a choice of either sending a DJF-eligible ward to DJF immediately or ordering probation and then forfeiting the threat of a DJF commitment later if the ward violates probation. We avoid this result by interpreting the word *1478 "offense" in section 733 to exclude a violation of probation found pursuant to section 777, subdivision (a)(2).

DISPOSITION
The judgment is affirmed.
Gomes, J., and Kane, J., concurred.
NOTES
[1]  Subsequent statutory references are to the Welfare and Institutions Code unless otherwise indicated.
[2]  The California Youth Authority (CYA) was renamed California's Department of Corrections and Rehabilitation, Juvenile Justice, effective July 1, 2005. The Division of Juvenile Facilities (DJF) is part of the Division of Juvenile Justice. (Gov. Code, §§ 12838, 12838.3, 12838.5, 12838.13.) DJF is referenced in statutes, such as sections 731 and 733, that formerly referred to CYA. In this opinion, we will use the name DJF.
