
    STATE of Missouri, ex rel. Frank E. DEHN, Respondent, v. Dora B. SCHRIRO, Director of Missouri Department of Corrections, and Mike Kemna, Superintendent of Western Missouri Correctional Center, Appellants.
    No. WD 52465.
    Missouri Court of Appeals, Western District.
    Oct. 8, 1996.
    Motion for Rehearing and/or Transfer to Supreme Court Denied Nov. 26,1996.
    Application to Transfer Denied Jan. 21,1997.
    
      Jeremiah W. (Jay) Nixon, Atty. Gen., Cassandra Dolgin, Asst. Atty. Gen., Jefferson City, for appellants.
    Laura G. Martin, Asst. Appellate Defender, Kansas City, for respondent.
   SPINDEN, Judge.

The Department of Corrections appeals the circuit court’s order that Frank Dehn be given credit against his sentences for stealing and tampering for the time he spent in prison in the United States Penitentiary in Leavenworth, Kansas. We reverse the judgment of the circuit court and remand for further proceedings.

On March 11,1988, Dehn pleaded guilty as a prior and persistent offender to one count of attempted stealing, a class D felony, and as a prior and persistent offender to one count of tampering. The circuit court sentenced Dehn as a prior and persistent offender to concurrent prison terms of 10 years and 15 years to run concurrently with other specified sentences including one in the Federal District Court of the Western District of Missouri. About three years later, Dehn requested the circuit court to credit his sentence for the time he served in prison while awaiting trial. On April 26, 1991, the circuit court entered this order:

IT IS HEREBY ORDERED that [Dehn] be credited for all time spent in jail or prison awaiting trial for the Johnson County offense beginning January 23, 1987, the date that a detainer was placed on [Dehn] by the Johnson County Sheriff’s department, while [Dehn] was in a U.S. penitentiary in Leavenworth, Kansas.
It is further ordered that the credit for jail and prison time shall be applied to [Dehn’s] Cass County sentence of imprisonment.

On June 20,1995, while incarcerated in the Western Missouri Correctional Center in Cameron, Dehn wrote a letter to Fran Brown, the correctional center’s records officer. Dehn enclosed a copy of the circuit court’s order granting him credit for time served and informed Brown that he did “not believe the Missouri Department of Corrections [had] ever considered the Order to apply the appropriate jail-time credit to [his] sentence.” Dehn asked for a credit of 103 days.

On August 1, 1995, Sonya D. Edwards, the department’s deputy general counsel, wrote a letter to the circuit court requesting it to reconsider its decision granting Dehn jail time credit. Edwards’ letter said, “Based on the jail endorsements and the date of sentence, it appears Mr. Dehn was serving federal time in the U.S. Penitentiary in Leavenworth, Kansas, and not being held because of a detainer on a bailable offense.”

On January 16, 1996, Dehn petitioned the circuit court for a writ of mandamus, or, in the alternative, a writ of habeas corpus. Dehn asked the circuit court to credit his sentence with the time served while he was in the custody at a United States penitentiary under a Johnson County detainer. He averred that the department had failed in its responsibility of crediting his sentence with this time. On February 29,1996, Dehn filed a motion for judgment on the pleadings.

On March 18,1996, the circuit court issued an order granting Dehn’s petition. The court directed the department to award Dehn credit for jail time served from January 28, 1987, to March 10, 1988. The circuit court’s order said:

This matter comes before the Court on Relator’s Motion for Judgment on the Pleadings. The Court having reviewed the pleadings and being fully advised in the premises, finds that Hon. Carl D. Green [sic], Circuit Judge, Cass County, Missouri, entered his written Order granting Frank Dehn credit for prison time awaiting trial; that the Order executed by Judge Green [sic] has not been set aside, reversed, or appealed; and that the Respondents have no authority to ignore or contravene a Court Order duly entered.

The department appeals the circuit court’s order.

Dehn sought credit for time served pursuant to § 558.031, RSMo 1994, which provides:

1. A person convicted of a crime in this state shall receive as credit toward service of a sentence of imprisonment all time spent by him in prison or jail both while awaiting trial for such crime and while pending transfer after conviction to the department of corrections or the place of confinement to which he was sentenced. Time required by law to be credited upon some other sentence shall be applied to that sentence alone, except that
(1) Time spent in jail or prison awaiting trial for an offense because of a detainer for such offense shall be credited toward service of a sentence of imprisonment for that offense even though the person was confined awaiting trial for some unrelated bailable offense; and
(2) Credit for jail or prison time shall be applied to each sentence if they are concurrent.

The only issue on appeal is whether the circuit court erred in ordering the department to award Dehn jail time credit.

From State of Missouri ex rel. Jones v. Cooksey, 830 S.W.2d 421 (Mo. banc 1992), we conclude that the circuit court did not have jurisdiction to enter the order. In that ease, the Supreme Court of Missouri said: “It is ... clear, and this Court holds, that this statutory scheme contemplates an administrative and not a judicial determination of the jail time to be credited, with no sharing of jurisdiction between the two branches of government.” Id. at 425. If the sentencing court did not have jurisdiction to order the jail-time credit, neither would the mandamus and habeas corpus court if its decision was based solely upon that of the sentencing court. Id.

The circuit court in Dehn’s case relied solely on the circuit court’s previous order. The circuit court, however, did not have jurisdiction when it first granted Dehn credit for his time served; hence, the circuit court, because it relied solely on the circuit court’s previous order, did not have jurisdiction in the mandamus proceeding to order the time credited.

The function of mandamus is to enforce and to execute, not to establish a claim or right and adjudicate. Naugher v. Mallory, 631 S.W.2d 370, 374 (Mo.App.1982). “Mandamus compels performance of an act by one who has a duty to perform it.” State of Missouri ex rel. Haley v. Groose, 873 S.W.2d 221, 223 (Mo. banc 1994). A court should issue a writ of mandamus only when a petitioner has shown “a clear and unequivocal right to the relief requested and a corresponding present, imperative, unconditional duty imposed on the respondent which the respondent has breached.” Naugher, 631 S.W.2d at 374. To determine whether the right to mandamus is clearly established and presently existing, the court examines the statute under which the relator claims the right. State of Missouri ex rel. Lupo v. City of Wentzville, 886 S.W.2d 727, 730 (Mo.App.1994).

Dehn had not shown a clear and unequivocal right to a credit to his sentence. Mandamus, therefore, was not an appropriate remedy.

Dehn’s petition requested alternatively a writ of habeas corpus which would be an appropriate remedy. The Supreme Court of Missouri instructed in Cooksey:

While the habeas corpus court had no jurisdiction to review the action of the sentencing court, it had not only the jurisdiction but the duty, under the pleadings, to make a factual inquiry into the propriety of the calculation by [the department] that no jail time was to be credited. That the jurisdiction of that court may be further and finally exercised, this cause must be returned there; that it may be properly exercised, further analysis is appropriate.

830 S.W.2d at 426.

The same is true in Dehn’s case. The department contends that Dehn is not entitled to any credit for the time served in the penitentiary. We, therefore, remand this case to the circuit court so it can determine whether the department properly concluded that Dehn was not entitled to any credit for the time he spent in the federal penitentiary. If Dehn is entitled to a credit, the circuit court shall order the department to credit it.

The judgment of the circuit court is reversed. We remand for further proceedings.

LOWENSTEIN, P.J., and HANNA, J., concur. 
      
      . This request was not made a part of the record on appeal. From the face of the court's order, we gather that Dehn served time at the United States Penitentiary in Leavenworth, Kansas.
     
      
      . The detainer was not made a part of the record on appeal.
     
      
      .The record on appeal does not indicate whether the circuit court ever ruled on the request to reconsider.
     
      
      . The order should have named Carl D. Gum as the judge.
     
      
      . The parties agree that the 1994 version of § 558.031 applies. This section was revised significantly in 1995 by HB 424.
     