
815 N.E.2d 10 (2004)
351 Ill. App.3d 884
286 Ill.Dec. 800
Ronald SCOTTI, Plaintiff-Appellant,
v.
Anne R. TAYLOR, Defendant-Appellee.
No. 4-03-0648.
Appellate Court of Illinois, Fourth District.
August 17, 2004.
*11 Ronald Scotti, Pontiac, Pro Se.
Justice STEIGMANN delivered the opinion of the court:
In June 2003, plaintiff, Ronald Scotti, an Illinois Department of Corrections (DOC) inmate, filed a pro se petition for mandamus against defendant, Anne R. Taylor, chairman of the Prisoner Review Board. Three days later, the trial court sua sponte dismissed the petition for failure to state a cause of action.
Scotti appeals, arguing that the trial court erred by dismissing his petition because it stated a cause of action. We reverse and remand.

I. BACKGROUND
In his June 2003 mandamus petition, Scotti alleged that Taylor failed to comply with section 3-5-1(b) of the Unified Code of Corrections (Code) (730 ILCS 5/3-5-1(b) (West 2002)), in that a portion of his good-conduct credit had been revoked and he was not provided with the factual information that was relied upon by DOC and the review board in making the determination to revoke it. He also alleged that his due process rights were violated by Taylor's failure to provide him with the factual basis for the revocation of his good-conduct credit. As relief, Scotti sought an order compelling Taylor to (1) comply with section 3-5-1(b) of the Code by providing him with the factual information underlying the revocation of his good-conduct credit and (2) restore his good-conduct credit.
Scotti attached to his mandamus petition (1) a copy of a sentence-calculation worksheet showing that in February 2003, one month of his good-conduct credit was revoked; and (2) a copy of a March 7, 2003, grievance filed by Scotti, alleging that (a) DOC or the review board failed to comply with section 3-5-1(b) of the Code (730 ILCS 5/3-5-1(b) (West 2002)) and (b) the only document he received after his revocation hearing was the aforementioned sentence-calculation worksheet. A written response dated March 11, 2003, appears in the section of the grievance form designated for a grievance counselor's response and states as follows: "Record office supervisor indicates they do not have the information requested."
*12 On June 23, 2003, the trial court dismissed Scotti's mandamus petition in a docket entry, which states as follows:
"The [c]ourt, having examined the submissions of [Scotti] wherein he complains about revocation of certain good time as a result of certain disciplinary proceedings. The [c]ourt finds that [Scotti] has wholly failed to state a cause of action in mandamus. Therefore, this cause is hereby dismissed."
This appeal followed.

II. THE TRIAL COURT'S DISMISSAL OF SCOTTI'S MANDAMUS PETITION
Scotti argues that the trial court erred by dismissing his mandamus petition. We agree.
We review de novo a trial court's dismissal of a complaint for failure to state a cause of action. Bajwa v. Metropolitan Life Insurance Co., 208 Ill.2d 414, 421, 281 Ill.Dec. 554, 804 N.E.2d 519, 525 (2004). Such dismissal will be held proper only if it clearly appears that no set of facts can be proved under the pleadings which will entitled the plaintiff to recover. Bajwa, 208 Ill.2d at 421, 281 Ill.Dec. 554, 804 N.E.2d at 525.
"Mandamus relief is an extraordinary remedy to enforce, as a matter of right, the performance of official duties by a public official where the official is not exercising discretion. A court will not grant a writ of mandamus unless the petitioner can demonstrate a clear, affirmative right to relief, a clear duty of the official to act, and clear authority in the official to comply with the writ. The writ will not lie when its effect is to substitute the court's judgment or discretion for the official's judgment or discretion. Mandamus relief, therefore, is not appropriate to regulate a course of official conduct or to enforce the performance of official duties generally." Hatch v. Szymanski, 325 Ill.App.3d 736, 739, 259 Ill.Dec. 805, 759 N.E.2d 585, 588 (2001).
Section 3-5-1(b) of the Code provides, in pertinent part, as follows:
"If [DOC] or the [review board] makes a determination under this Code which affects the length of the period of confinement or commitment, the committed person and his counsel shall be advised of factual information relied upon by [DOC] or [the][b]oard to make the determination * * *." 730 ILCS 5/3-5-1(b) (West 2002).
In addition, the Supreme Court has held that under the principles of due process, prisoners are entitled to the following process in disciplinary proceedings: (1) notice of the disciplinary charges at least 24 hours prior to the hearing; (2) when consistent with institutional safety and correctional goals, an opportunity to call witnesses and present documentary evidence in his defense; and (3) a written statement by the fact finder of the evidence relied on and the reasons for the disciplinary action. Wolff v. McDonnell, 418 U.S. 539, 563-66, 94 S.Ct. 2963, 2978-79, 41 L.Ed.2d 935, 955-56 (1974).
In Mason v. Snyder, 332 Ill.App.3d 834, 842, 266 Ill.Dec. 351, 774 N.E.2d 457, 463-64 (2002), this court held that trial courts have the authority to "utilize their discretion in dealing with `professional litigants' who inappropriately burden the court system with nonmeritorious litigation" by sua sponte striking mandamus petitions that the courts find to be "frivolous and without merit." In so holding, we also encouraged trial courts to set forth in the record their analysis when "utilizing this administrative tool," given that this court would be reviewing the court's decision without the benefit of argument from the defendant. *13 Mason, 332 Ill.App.3d at 843, 266 Ill.Dec. 351, 774 N.E.2d at 464.
Although we adhere to our holding in Mason  that trial courts have the authority to sua sponte dismiss a DOC inmate's frivolous mandamus petition  in this case, we are unable to discern from the record the basis for the court's decision to dismiss Scotti's mandamus petition. Scotti's petition alleges that he was never informed of the factual basis for the revocation of his good-conduct credit, as is required by (1) section 3-5-1(b) of the Code (730 ILCS 5/3-5-1(b) (West 2002)) and (2) the United States Constitution. He attached to the petition documentation of (1) the revocation of his good-conduct credit and (2) his grievance, showing that when he sought the pertinent information, he was informed that the record office did not have it. As relief, Scotti sought, in part, an order directing Taylor to provide him with the pertinent factual information in accordance with section 3-5-1(b) of the Code and his right to procedural due process. Thus, Scotti alleged facts that established a right to the relief requested and the existence of a statutory and constitutional duty on Taylor's part to provide that relief.
A mandamus petition is an appropriate vehicle for obtaining the relief Scotti seeks  namely, an official's compliance with a statutorily prescribed nondiscretionary duty. Noyola v. Board of Education of the City of Chicago, 179 Ill.2d 121, 132, 227 Ill.Dec. 744, 688 N.E.2d 81, 86 (1997). On this record, we fail to see how Scotti's petition fails to state a cause of action for mandamus relief or is otherwise frivolous. Accordingly, we reverse the trial court's judgment dismissing the petition.
In so doing, we are not suggesting that Scotti's petition may not be the proper subject of dismissal or denial in further proceedings. In addition, we reiterate our suggestion in Mason that when a trial court sua sponte dismisses a DOC inmate's mandamus petition, the court also set forth in the record the basis upon which that determination was made.

III. CONCLUSION
For the reasons stated, we reverse the trial court's judgment and remand for further proceedings.
Reversed and remanded.
COOK and McCULLOUGH, JJ., concur.
