
166 Ill. App.3d 843 (1988)
520 N.E.2d 1255
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
HENRY LARUE ROLLINS, Defendant-Appellant.
No. 5-86-0279.
Illinois Appellate Court  Fifth District.
Opinion filed March 11, 1988.
*844 Daniel M. Kirwan and Larry R. Wells, both of State Appellate Defender's Office, of Mt. Vernon, for appellant.
David W. Hauptmann, State's Attorney, of Harrisburg (Kenneth R. Boyle, Stephen E. Norris, and Raymond F. Buckley, Jr., all of State's Attorneys Appellate Prosecutor's Office, of counsel), for the People.
Judgment affirmed.
JUSTICE KARNS delivered the opinion of the court:
The defendant, Henry Larue Rollins, pleaded guilty to unlawful possession of a controlled substance, lysergic acid diethylamide, a violation of section 402(b) of the Illinois Controlled Substances Act (Act) (Ill. Rev. Stat. 1985, ch. 56 1/2, par. 1402(b)). Defendant was sentenced to 30 months' probation and as an incident of that probation, defendant was ordered to serve six months' periodic imprisonment. Subsequently, defendant's probation was revoked and he was again sentenced to 30 months' probation, and as an incident of that probation, he was ordered to serve six months in the county jail. On appeal, defendant contends that he must be given credit against his second sentence of probation for the time served initially on probation and that his sentence to the county jail must be credited with the time spent on periodic imprisonment.
A violation of section 402(b) of the Act is punishable as a Class 4 felony on which a term of probation not to exceed 30 months can be imposed. (Ill. Rev. Stat. 1985, ch. 38, par. 1005-6-2(b)(2); ch. 56 1/2, par. 1402(b).) As incidents of probation, defendant could have been sentenced to periodic imprisonment not exceeding 18 months in duration (Ill. Rev. Stat. 1985, ch. 38, pars. 1005-6-3(b)(1), 1005-7-1(d)) or a period of imprisonment not in excess of six months (Ill. Rev. Stat. 1985, ch. 38, par. 1005-6-3(d)). Section 5-6-4(h) of the Unified Code of Corrections (Code) (Ill. Rev. Stat. 1985, ch. 38, par. *845 1005-6-4(h)) provides:
"Resentencing after revocation of probation or conditional discharge or supervision shall be under Article 4. Time served on probation, conditional discharge or supervision shall be credited by the court against a sentence of imprisonment or periodic imprisonment unless the court orders otherwise."
Section 5-6-4(e) of the Code (Ill. Rev. Stat. 1985, ch. 38, par. 1005-6-4(e)) provides:
"If the court finds that the offender has violated a condition [of probation] at any time prior to the expiration or termination of the period, it may continue him on the existing sentence, with or without modifying or enlarging the conditions, or may impose any other sentence that was available under Section 5-5-3 [of the Code] at the time of initial sentencing."
 1 Section 5-6-4(e) provides that where a court does not intend to continue the defendant on the original sentence, it may impose any other sentence that was available when he was first sentenced. The court, therefore, may impose any length of probation upon revocation that was available originally, regardless of the amount of the previously served probation. Thus, where a probationer has completed a substantial portion of his probation and then commits an egregious violation of probation, the court in its discretion may order the maximum term anew to rehabilitate the errant probationer. Otherwise, a court might be more inclined to sentence the defendant to imprisonment if an extended term of probation would be unavailable. (People v. Miller (1982), 109 Ill. App.3d 255, 256-57, 440 N.E.2d 409, 410.) Therefore, we conclude that the court could properly sentence defendant to 30 months' probation upon revocation of probation and not credit him for time previously served on probation.
We must next decide whether defendant is entitled to credit against the six-month jail sentence imposed as an incident of probation for the time spent on periodic imprisonment, which had been imposed as an incident of the first probation. In addition to the aforementioned quoted sections of the Code, the following sections of the Code are pertinent to our discussion of this issue:
"The court shall not impose a sentence of periodic imprisonment if it imposes a sentence of imprisonment upon the defendant in excess of 90 days." (Ill. Rev. Stat. 1985, ch. 38, par. 1005-7-1(c).)
"The offender shall be given credit on the determinate sentence or maximum term and the minimum period of imprisonment for time spent in custody as a result of the offense for *846 which the sentence was imposed, at the rate specified in Section 3-6-3 [Ill. Rev. Stat. 1985, ch. 38, par. 1003-6-3] of this Code." Ill. Rev. Stat. 1985, ch. 38, par. 1005-8-7(b).
In People v. Scheib (1979), 76 Ill.2d 244, 390 N.E.2d 872, our supreme court dealt with whether certain credits should be given against a sentence of imprisonment in the Department of Corrections (DOC). In deciding the issue, the court stated:
"In contrast to section 5-8-7(b), section 5-6-4(h) does not refer to time spent in confinement. Section 5-6-4(h) (Ill. Rev. Stat. 1977, ch. 38, par. 1005-6-4(h)) now encompasses three specific forms of restraint  probation, conditional discharge and supervision  each a lesser restraint on freedom than confinement. Reading the sections in consort, we conclude that section 5-8-7(b) is to apply whenever the time, for which credit is sought, was served in confinement, and that section 5-6-4(h) is to apply whenever the time was served unconfined on probation, conditional discharge or supervision. Read in this manner, a defendant must be fully credited for any time which he has spent in jail for a particular offense, regardless of whether the time in confinement was considered served as part of a condition of probation or conditional discharge." (76 Ill.2d at 251, 390 N.E.2d at 875.)
The supreme court was particularly concerned that if certain credits were not granted, a defendant might be confined on an offense for a greater amount of time that the maximum sentence provided by statute.
 2, 3 Scheib did not decide the issue of whether one incident of probation must be credited against another incident of probation. The statute discussed in Scheib has since been amended by the addition of the phrase "at a rate specified in Section 3-6-3 of the Code." Section 3-6-3 discusses, in part, the granting of good-time credits by DOC. Therefore, Scheib requires that credit be granted so that a defendant does not spend more time incarcerated than is permitted by statute. While defendant could not be sentenced to jail time in excess of 90 days in combination with a sentence of periodic imprisonment (see People v. Evans (1984), 124 Ill. App.3d 634, 642-43, 464 N.E.2d 1083, 1090, cert. denied (1985), 469 U.S. 1211, 84 L.Ed.2d 328, 105 S.Ct. 1179; People v. McMullen (1980), 88 Ill. App.3d 611, 615, 410 N.E.2d 1174, 1177-78), a court is not prevented from imposing periodic imprisonment as an incident of an initial sentence of probation and a sentence of straight time in the county jail as an incident of a subsequent probation. After finding a violation of probation, the court *847 "may impose any other sentence that was available under Section 5-5-3 at the time of initial sentencing." (Ill. Rev. Stat. 1985, ch. 38, par. 1005-6-4(e).) If the court were required to grant credit for a previously imposed sentence of periodic imprisonment, a defendant might receive a less onerous sentence than had previously been imposed, and a court might be more inclined to sentence the defendant to imprisonment if a straight-time jail sentence could not be implemented. Further, "imprisonment" means incarceration in a correctional institution under a sentence of imprisonment and does not include "periodic imprisonment" under article 7. (Ill. Rev. Stat. 1985, ch. 38, par. XXXX-X-XX.) The basic theory of probation is to grant a defendant an opportunity of rehabilitation without DOC incarceration; to afford the unfortunate another opportunity by extending clemency. (See People v. Henderson (1971), 2 Ill. App.3d 401, 405, 276 N.E.2d 373, 375.) In the case at bar, initially defendant was sentenced to serve 6 p.m. one day to 6 a.m. the next day every day for six months as an incident of probation, which did not lead to his rehabilitation. The court then tried six months' county jail straight time to effect defendant's rehabilitation. By reference to good-time credit being granted by DOC, the legislature did not intend section 5-8-7(b) to apply to the circumstances presented in this case. The exclusion of periodic imprisonment from the definition of imprisonment further indicates the legislative intent. As previously stated, section 5-6-4(h) does not deal with confinement. Therefore, there is no requirement that the court grant a defendant credit for the type of periodic imprisonment imposed in this case as an incident of probation against a subsequent sentence of straight jail time imposed as an incident of probation. We note that the total incident of probation does not exceed the maximum penal sentence to which defendant could be subjected by his conviction in the case at bar.
For the foregoing reasons, the judgment of the circuit court of Saline County is affirmed.
Affirmed.
WELCH and LEWIS, JJ., concur.
