Plaintiff appeals an order dismissing his petition for writ of mandamus. He alleged in his petition that he was incarcerated in the Oregon State Penitentiary under the custody of the Oregon Corrections Division. He further alleged that defendants refused to credit him for time served in custody before his delivery to Corrections Division custody as required by ORS 137.320:
“(1) When a judgment includes commitment to the legal and physical custody of the Corrections Division, the sheriff shall deliver the defendant, together with a copy of the entry of judgment and a statement signed by the sheriff of the number of days the defendant was imprisoned prior to delivery, to the superintendent of the penal or correctional institution to which the defendant is initially assigned pursuant to ORS 137.124. ' a* * * * *
“(3) Upon receipt of the information described in subsection (1) or (2) of this section, the Corrections Division shall establish a case file and compute the defendant’s sentence in accordance with the provisions of ORS 137.370.
Defendants moved to dismiss on the basis that the petition did not state facts upon which relief could be granted. The court granted the motion. A writ of mandamus may issue to compel the named defendants to perform an act which they are required by law to perform. Under ORS 137.320, defendants have no duty to credit plaintiff with time served until the sheriff has provided a signed statement setting forth the number of days that plaintiff had previously been imprisoned. The petition does not allege that the certification by the sheriff was provided to defendants. Consequently, the petition does not allege a basis for a writ of mandamus commanding the named defendants to credit plaintiff with time served.
Affirmed.