
83 Ill.2d 402 (1980)
415 N.E.2d 323
THE PEOPLE OF THE STATE OF ILLINOIS, Appellant,
v.
CHARLES KUESIS, Appellee.
No. 53247.
Supreme Court of Illinois.
Opinion filed November 18, 1980.
Rehearing denied January 29, 1981.
*403 Tyrone C. Fahner and William J. Scott, Attorneys General, of Springfield, and Bernard Carey, State's Attorney, of Chicago (Melbourne A. Noel, Jr., Mark L. Rotert, and Donald B. Mackay, Assistant Attorneys *404 General, of Chicago, and Marcia B. Orr, Joel A. Stein and Christine A. Campbell, Assistant State's Attorneys, of counsel), for the People.
James J. Doherty, Public Defender, of Chicago (Timothy P. O'Neill, Assistant Public Defender, of counsel), for appellee.
Appellate court reversed; circuit court affirmed.
MR. JUSTICE CLARK delivered the opinion of the court:
The defendant, Charles Kuesis, was charged with burglary (Ill. Rev. Stat. 1977, ch. 38, par. 19-1). He was found guilty after a bench trial in the circuit court of Cook County. At the conclusion of a sentencing hearing, the court imposed a sentence of 2 1/2 to 7 1/2 years in the penitentiary. The defendant appealed. The appellate court, pursuant to Supreme Court Rule 23 (73 Ill.2d R. 23), vacated the circuit court's sentence and remanded the cause for a new sentencing hearing. (81 Ill. App.3d 1199.) We allowed the State's petition for leave to appeal. 73 Ill.2d R. 315.
No issue is raised relative to the defendant's conviction. Instead, the issue is whether the trial court erred in imposing sentence since it did not consider defendant's eligibility for treatment under the Dangerous Drug Abuse Act (Ill. Rev. Stat. 1977, ch. 91 1/2, par. 120.10). Section 10 of that act provides in pertinent part:
"If a court has reason to believe that an individual convicted of a crime is an addict or the individual states that he is an addict and the court finds that he is eligible to make the election provided for under Section 8, the court may advise him that he may be placed on probation if he elects to submit to treatment and is accepted for treatment by the Department." (Ill. Rev. Stat. 1977, ch. 91 1/2, par. 120.10.)
Section 8 of the Dangerous Drug Abuse Act reads in pertinent part:

*405 "An addict charged with or convicted of a crime is eligible to elect treatment under the supervision of the Department instead of prosecution or probation, as the case may be, unless * * * (e) the addict is on probation or parole and the appropriate parole or probation authority does not consent to that election, * * *." (Ill. Rev. Stat. 1977, ch. 91 1/2, par. 120.8.)
At the time of the instant offense, the defendant was on probation. Also the record is clear that the defendant did not affirmatively elect to be treated, nor did the appropriate probation authority consent to any election. It is argued by the defendant, and concurred in by the appellate court, that an obligation is placed on the trial court, if the court has reason to believe that a convicted defendant is an addict (Ill. Rev. Stat. 1977, ch. 91 1/2, par. 120.3-3), to exercise its discretion and consider whether the defendant should be placed in a treatment program.
The State argues that the defendant was not eligible to elect for treatment because he was on probation as of September 15, 1978, the day of sentencing, and no consent was obtained from the appropriate probation authority. Consequently, the court was not required to consider the alternative of placing the defendant on probation under the Dangerous Drug Abuse Act.
The presentence report contained in the record indicates that "the defendant admitted he had trouble with alcohol and narcotics. The defendant stated he consumed beer and whiskey daily. From a previous probation the defendant had been sent to see Joseph Vidi at the Basta Drug Abuse Program. The defendant stated he had used heroin since 1971 and saw this as part of the reason for his criminal background." Furthermore, in the sentencing hearing, defense counsel alluded to the defendant's drug use. The report also indicated that, based on the defendant's five prior probation sentences, "there seems little that the Adult Probation Department can offer the defendant in ways of resources."
*406 First of all, the defendant herein never filed a petition to elect to receive treatment under the Act. (See People v. Teschner (1980), 81 Ill.2d 187, People v. Warren (1977), 69 Ill.2d 620, 623, and People v. Phillips (1977), 66 Ill.2d 412, 413, where petitions were filed in the circuit court by defendants seeking to elect treatment under the Dangerous Drug Abuse Act.) In People v. Warren it was stated that a trial court does not have "unlimited discretion in denying a petition seeking treatment under the Act. That denial will remain subject to judicial review, and the record must reflect that the trial judge exercised his discretion and did not abuse it or act in a purely arbitrary manner." (69 Ill.2d 620, 629.) Thus the court need not exercise its discretion in the first instance unless the defendant applied for probation under the Act by filing a petition. Consistent with this result is our recent decision in People v. Meeks (1980), 81 Ill.2d 524, wherein a presentence report was defective because it failed to comment upon resources within the community which may have been available to assist the defendant's rehabilitation. The trial court considered the presentencing report, as required by the Unified Code of Corrections (Ill. Rev. Stat. 1977, ch. 38, par. 1005-4-1). The defendant never raised any objection to that defect, although he raised other objections to the report. In holding that the defendant's failure to bring that particular deficiency to the court's attention waived any error, this court stated:
"It is the duty of the probation officer to prepare a presentence report consistent with the directives of the statute. It is the duty of the parties, however, to bring to the attention of the sentencing authority any alleged deficiency or inaccuracy in the presentence report. The requirement that the trial judge consider the presentence report was complied with in the present case; any objections *407 to the sufficiency of the report must first be presented to the trial court." People v. Meeks (1980), 81 Ill.2d 524, 533.
To the same effect is People v. Pierce (1976), 62 Ill.2d 223, 224, wherein it was held that, although a statute provides that where a person is charged with a sexual crime against a child under 13 years the court "shall, before trial, require a psychiatric examination of the person charged," if a defendant does not request an examination, the right to one will be waived. Accordingly, the trial court was not required to initiate an inquiry into whether the defendant was eligible to elect to receive treatment.
Even if, however, the defendant had petitioned to elect to receive treatment and had affirmatively shown the consent of his probation officer (People v. Phillips (1977), 66 Ill.2d 412, 416), we would not disturb the sentence of the court, because section 10 of the Dangerous Drug Abuse Act specifies that after eligibility is established the court "may" advise the defendant that he "may be placed on probation if he elects to submit to treatment and is accepted for treatment by the Department [of Mental Health and Developmental Disabilities]" (Ill. Rev. Stat. 1977, ch. 91 1/2, par. 120.10). Thus, even if the defendant files a petition, the court is not under any obligation to comply with the defendant's request. People v. Warren (1977), 69 Ill.2d 620, 629.
Our next inquiry is whether the defendant should have been sentenced to probation under the Unified Code of Corrections (Ill. Rev. Stat. 1977, ch. 38, par. 1005-6-1). Preliminarily, it should be noted that the trial court could have sentenced the defendant to probation conditioned upon the defendant's participation in a drug-treatment program under the Unified Code of Corrections (Ill. Rev. Stat. 1977, ch. 38, par. 1005-6-3(b)(4)). Thus, the absence of a probation officer's consent did not restrict *408 the court's sentencing alternatives, as argued by the defendant, but merely the defendant's eligibility under the Dangerous Drug Abuse Act. Ill. Rev. Stat. 1977, ch. 91 1/2, par. 120.8(e); People v. Phillips (1977), 66 Ill.2d 412, 416.
The standard of review of allegedly excessive sentences is whether a trial court exercised its discretion and whether that discretion was abused. (People v. Perruquet (1977), 68 Ill.2d 149, 153.) The standard, however, as to whether the trial court should impose probation or conditional discharge as opposed to imprisonment or periodic imprisonment is contained in section 5-6-1 of the Unified Code of Corrections:
"Sec. 5-6-1. Sentences of Probation and of Conditional Discharge and Disposition of Supervision.
(a) Except where specifically prohibited by other provisions of this Code, the court shall impose a sentence of probation or conditional discharge upon an offender unless, having regard to the nature and circumstance of the offense, and to the history, character and condition of the offender, the court is of the opinion that:
(1) his imprisonment or periodic imprisonment is necessary for the protection of the public; or
(2) probation or conditional discharge would deprecate the seriousness of the offender's conduct and would be inconsistent with the ends of justice."
(Ill. Rev. Stat. 1979, ch. 38, par. 1005-6-1, effective February 1, 1978.)
We stated in our recent opinion in People v. Cox (1980), 82 Ill.2d 268, 281:
"In view of this statutory provision, whenever a sentence of imprisonment or periodic imprisonment is imposed, the record must indicate that the judge is of the opinion that imprisonment is necessary for the protection of the public or that probation or conditional discharge would deprecate the seriousness of the offender's conduct and would be inconsistent with the ends of justice. Substantial *409 compliance with section 5-6-1 may exist even if the judge does not specifically say that `imprisonment is necessary for the protection of the public' or that `probation or conditional discharge would deprecate the seriousness of the offender's conduct and would be inconsistent with the ends of justice.' If the record demonstrates substantial compliance with this requirement, then a reviewing court may alter the sentencing judge's disposition only upon a finding of an abuse of discretion [in that a sentence is excessive]. People v. Perruquet (1977), 68 Ill.2d 149, 153."
In this case the trial court was of the opinion either that imprisonment was necessary to protect the public or that probation would deprecate the seriousness of the offender's conduct. The record supports the court's opinion. The defendant had received several sentences of probation prior to this offense and was on probation at the time he committed the instant offense.
During the sentencing hearing the court noted:
"The pre-sentence investigation report reveals that you have had four prior probation sentences.  You are presently on probation. You also walked out so says the report, of the work release periodic imprisonment program.
Prior to this, you have had three prior felony convictions, not counting this one.
*   *   *
It is a bad record and you have been given many chances. I see your family in court supporting you.  I intended to give you close to the maximum, in no way do you deserve anywhere near the minimum. You still obviously have hope because you are not that old a man as yet.
The sentence will be, not less than two and a half years, nor more than seven and one-half years in the Illinois Department of Corrections.
There will be judgment on the finding and sentence."
While it is, of course, preferable for a court to state expressly *410 which basis it is relying upon for refusing to sentence a defendant to probation or conditional discharge, we believe that the trial court herein substantially complied with section 5-6-1 (Ill. Rev. Stat. 1979, ch. 38, par. 1005-6-1, effective February 1, 1978). The sentence will stand.
Finally, we are aware of the recent amendment to section 10 of the Dangerous Drug Abuse Act (Pub. Act 81-851, approved and effective September 20, 1979) which provides:
"Sec. 10. If a court has reason to believe that an individual convicted of a crime is an addict or the individual states that he is an addict and the court finds that he is eligible to make the election provided for under Section 8, the court shall advise him that he may be placed on probation if he elects to submit to treatment and is accepted for treatment by the Department. * * * (Emphasis added.) (Ill. Rev. Stat. 1979, ch. 91 1/2, par. 120.10.)
We decline to decide how this amendment would affect this case, since the defendant was sentenced fully a year before the amendment became effective. Accordingly, for the reasons stated, the judgment of the appellate court is reversed, and the judgment of the circuit court is affirmed.
Appellate court reversed; circuit court affirmed.
