
6 Cal.3d 216 (1971)
490 P.2d 1137
98 Cal. Rptr. 449
FRANK R. HAYES, Petitioner,
v.
THE SUPERIOR COURT OF SAN BERNARDINO COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. L.A. 29861.
Supreme Court of California. In Bank.
December 6, 1971.
*219 COUNSEL
Roger Jon Diamond, under appointment by the Supreme Court, for Petitioner.
Evelle J. Younger, Attorney General, William E. James, Assistant Attorney General, and Jack K. Weber, Deputy Attorney General, for Respondent.
OPINION
WRIGHT, C.J.
Petitioner is confined in the Nevada State Prison under a sentence imposed by a Nevada district court. He is subject to a California detainer based on his violation of a probation order of respondent Superior Court of San Bernardino County. Petitioner seeks a writ of mandate compelling respondent to dismiss the California criminal action on the ground that respondent made no attempt to comply with petitioner's requests that he be returned to this state for a speedy hearing as to reinstatement of probation or pronouncement of sentence.
We decline the relief requested by petitioner. We conclude, however, that if petitioner wishes respondent to dispose finally of the pending action *220 he may invoke the procedure set out in Penal Code section 1203.2a. That statute provides that a defendant who has been granted probation without imposition of sentence and who is then "committed to a prison in this State" for another offense can obtain final disposition of the case in which he received probation by requesting imposition of sentence "in his absence and without his being represented by counsel." We hold that the Legislature's purported limitation of the procedure to those committed to prison "in this State" denies the equal protection of the laws required by the federal and California Constitutions. We reject petitioner's contention that the statutory procedure is unconstitutional because if he invokes it he will have to forego his right to appear in person and with counsel at the time of imposition of sentence.
In September 1968, in respondent court, petitioner was convicted of possessing a money order with intent to defraud, an offense punishable either by imprisonment in the state prison for not more than 14 years or by imprisonment in the county jail for not more than one year. (Pen. Code, § 475a.) In October 1968 respondent suspended imposition of sentence and granted probation for the period of two years. The conditions of probation included requirements that petitioner violate no law and that he not leave the State of California without the probation officer's written permission. Petitioner did not appeal from the order granting probation.
Petitioner violated probation by going to Nevada without permission and by committing robbery in that state. In February 1969 he was convicted of the robbery and sentenced to 10 years' imprisonment in the Nevada State Prison. He did not appeal from the Nevada judgment.
In March 1969 the San Bernardino probation officer reported petitioner's violations of probation and imprisonment in Nevada to respondent court. Respondent revoked probation ex parte and issued its bench warrant for petitioner's apprehension as a probation violator. In April 1969 the San Bernardino Sheriff lodged a copy of the warrant with the Nevada prison as a detainer, with a letter stating, "After subject has fulfilled his obligation to your department and should he become available to us, advise if he will waive extradition. If he should decline, we will request that our district attorney seek to extradite subject." Because of the California detainer petitioner is confined in a maximum security facility, his opportunities to participate in educational and rehabilitative programs are limited, and his prospects for parole are adversely affected.
By a series of letters and written pro se motions addressed to respondent court commencing in May 1969 petitioner asked that probation be reinstated and the bench warrant recalled, or that he be produced promptly *221 before respondent for hearing and final disposition of the California case, or that the case be dismissed for want of speedy prosecution. Respondent denied these requests. Petitioner then filed a pro se petition for a writ of mandate. We issued the alternative writ and appointed counsel to represent him in this proceeding.
(1a) Petitioner has a substantial interest in obtaining prompt and final disposition of the criminal action which is pending in respondent court. Correctional authorities have pointed out and courts and legislatures have found that in the usual course of prison and parole administration a detainer against a prisoner results in adverse effects on the conditions of his custody and the prospects for his parole. (Smith v. Hooey (1969) 393 U.S. 374, 378-379 [21 L.Ed.2d 607, 611-612, 89 S.Ct. 575]; United States v. Candelaria (S.D.Cal. 1955) 131 F. Supp. 797, 805-806; United States ex rel. Giovengo v. Maroney (W.D.Pa. 1961) 194 F. Supp. 154, 155; Pen. Code, § 1389 et seq., the statutory Agreement on Detainers which has been enacted in 28 states; 22 Assembly Interim Com. Report No. 3, Criminal Procedure (1961-1963) p. 157, Appendix to Journal of Assem. (1963 Reg. Sess.) vol. 2, hereafter cited as Assem. Com. Rep.) These adverse effects appear in petitioner's case.
A detainer based on an untried charge or on a conviction as to which no sentence has been imposed is particularly discouraging to rehabilitative efforts by prison administrators and the prisoner himself because of uncertainty as to whether the detainer will be exercised or dropped when the prisoner is released from his current confinement. "The adjustment to prison is difficult at best; when the prisoner does not know whether he will have to serve another sentence at the completion of the present one, the problem is greatly increased." (Assem. Com. Rep., supra, p. 158.) Many officers who file detainers deliberately delay decision as to whether the hold will be exercised for as long as possible (Barker v. Municipal Court (1966) 64 Cal.2d 806, 810 [51 Cal. Rptr. 921, 415 P.2d 809]; People v. Brown (1968) 260 Cal. App.2d 745, 749 [67 Cal. Rptr. 288]; Assem. Com. Rep., supra, p. 160) yet many detainers are not exercised and many are filed without intent to exercise them. (Assem. Com. Rep., supra, p. 161; 9B U.L.A. (1966) p. 364, Commissioners' Note on the Uniform Mandatory Disposition of Detainers Act.)[1]
Petitioner is further prejudiced by delay in final disposition of the pending California case because he loses the possibility of receiving a sentence which will run concurrently with his Nevada sentence. (Smith v. Hooey *222 (1969) supra, 393 U.S. 374, 378 [21 L.Ed.2d 607, 611]; In re Crow (1971) 4 Cal.3d 613, 621 [94 Cal. Rptr. 254, 483 P.2d 1206].)
(2a) Penal Code section 1203.2a[2] establishes a procedure by which one committed to prison in California can obtain relief from the harmful uncertainty of other outstanding California convictions as to which he has been granted probation with imposition or execution of sentence suspended. That procedure benefits both the prisoner and the state. (3) "Fairness to one committed to a state prison and proper administration by the prison officials and the Adult Authority require that such outstanding convictions be reduced to judgment or be otherwise finally disposed of by termination of the trial court's jurisdiction." (In re Perez (1966) 65 Cal.2d 224, 228 [53 Cal. Rptr. 414, 418 P.2d 6].) (2b) When the prisoner requests imposition of sentence under section 1203.2a he receives the benefit of the possibility of concurrent sentences. (In re White (1969) 1 Cal.3d 207, 211 [81 Cal. Rptr. 780, 460 P.2d 980].) The trial court and its clerk and probation officer are afforded the convenience of closing their files in a case which otherwise might remain undisposed of for years. Moreover, the procedure seeks to give prisoners the benefit of prompt sentencing or other final disposition while avoiding the government's expenditure of time and funds to produce imprisoned defendants for unnecessary court appearances. (People *223 v. Ford (1966) 239 Cal. App.2d 944, 946 [49 Cal. Rptr. 283]; Senate Fact Finding Com. on Judiciary Report, Post-Conviction Procedures (Jan. 1963) p. 51, Appendix to Journal of Sen. (1963 Reg. Sess.) vol. 1, hereafter cited as Sen. Com. Rep.)
(4a) The foregoing considerations apply equally to the cases of defendants committed in California and the cases of defendants committed in other jurisdictions. Section 1203.2a, however, is limited to defendants "committed to a prison in this State." (Italics added.)
(5) The California Constitution (art. I, §§ 11, 21; art. IV, § 16), like the equal protection clause of the Fourteenth Amendment, requires that classifications of those to whom the state accords benefits and those on whom it imposes burdens must be reasonably related to a legitimate public purpose. (In re Gary W. (1971) 5 Cal.3d 296, 303 [96 Cal. Rptr. 1, 486 P.2d 1201]; In re King (1970) 3 Cal.3d 226, 232 [90 Cal. Rptr. 15, 474 P.2d 983].) (4b) An out-of-state prisoner in petitioner's circumstances has the same interest as a California prisoner would have in the final disposition of an outstanding California conviction, and the burdens of the California detainer filed against this petitioner do not differ significantly from those of a detainer filed against one confined in California. Considerations of this state's expense and administrative and judicial convenience in reducing an outstanding conviction to judgment are the same whether the prisoner who asks to be sentenced in his absence is confined in California or in another state.
Also we consider the rights granted by the Legislature to prisoners of other states and federal prisoners who are subject to the burden of outstanding untried California charges and detainers based on such charges. (See People v. Smith (1971) 5 Cal.3d 313, 316 [96 Cal. Rptr. 13, 486 P.2d 1213].) In this regard it has evidenced substantially equal concern for those committed in this state and those committed elsewhere. There are statutory procedures by which untried charges may be reduced to judgment or ordered dismissed not only for inmates of California institutions (Pen. Code, § 1381) but also for those in federal correctional institutions (Pen. Code, § 1381.5) and penal or correctional institutions of other states (Pen. Code, § 1389 et seq.)
Therefore, we conclude that the Legislature, by limiting the availability of section 1203.2a procedures to those "committed to a prison in this State," has made a classification which is not reasonably related to any legitimate public purpose.[3]
*224 (6) A statutory classification which arbitrarily excludes some but not all of those similarly situated in relation to the legitimate purposes of the statute does not necessarily invalidate the entire statute. (Skinner v. Oklahoma (1942) 316 U.S. 535, 543 [86 L.Ed. 1655, 1661, 62 S.Ct. 1110]; In re King (1970) supra, 3 Cal.3d 226, 237.) In light of the purposes and history of a particular statute or an overall statutory scheme a reviewing court may correct a discriminatory classification by invalidating the invidious exemption and thus extending statutory benefits to those whom the Legislature unconstitutionally excluded. (See Baxstrom v. Herold (1966) 383 U.S. 107, 115 [15 L.Ed.2d 620, 625-626, 86 S.Ct. 760]; People v. Smith (1971) supra, 5 Cal.3d 313, 319; Quong Ham Wah Co. v. Industrial Acc. Com. (1920) 184 Cal. 26, 41 [192 P. 1021, 12 A.L.R. 1190]; Developments in the Law  Equal Protection (1969) 82 Harv. L. Rev. 1065, 1136; but see In re Trummer (1964) 60 Cal.2d 658, 664 [36 Cal. Rptr. 281, 388 P.2d 177].)
(4c) As we have seen, the Legislature has evidenced its overall concern that California detainers based on untried charges should be made as certain as possible, whether the prisoner against whom they are filed is an inmate of a California prison, a prison of another state, or a federal prison. It has found that "detainers based on untried indictments ... produce uncertainties which obstruct programs of prisoner treatment and rehabilitation." (Pen. Code, § 1389, art. I.) Moreover, the history of section 1203.2a evidences the Legislature's intent to retain a constitutionally viable procedure designed to effect the purposes of the statute rather than to abandon the procedure entirely because of constitutional defects. Former versions of the statute (Pen. Code, § 1203.2a as enacted in 1941 and amended in 1943) purported to authorize ex parte imposition of sentence in the defendant's absence without notice to him and without his having waived the rights to be present and represented by counsel. That procedure, however, was held to violate due process and the rights "to appear and defend, in person and with counsel" which are guaranteed by section 13 of article I of the California Constitution. (In re Perez (1966) supra, 65 Cal.2d 224, 229; In re Klein (1961) 197 Cal. App.2d 58, 62 [17 Cal. Rptr. 71].) Because of the Klein holding the Legislature in 1963 amended section 1203.2a to its present form.[4] (Sen. Com. Rep., supra, p. 51.)
*225 The foregoing indicia of legislative intent convince us that the Legislature would prefer invalidation of the statute's invidious limitation rather than invalidation of the entire statutory procedure provided by section 1203.2a. (1b) Therefore, we hold that if petitioner makes a request of respondent court in the manner described in section 1203.2a the court shall proceed as provided in that statute.[5]
(7a) Petitioner contends that the statutory procedure is unconstitutional because it is available to him only if he foregoes his right to be present and his right (because he is indigent) to appointed counsel at the time of imposition of sentence. The choice required by the statute is a reasonable method of effectuating proper legislative purposes, not an unconstitutional compulsion which needlessly penalizes the assertion of the rights to be present and represented by counsel. (Cf. Brady v. United States (1970) 397 U.S. 742, 746 [25 L.Ed.2d 747, 755, 90 S.Ct. 1463]; People v. Mason (1971) 5 Cal.3d 759, 764-765 [97 Cal. Rptr. 302, 488 P.2d 630].) (1c) Petitioner's need for final disposition of the San Bernardino case arose only because he was committed for another offense. The fact of his commitment to prison for robbery shows that the committing court determined that he was not a suitable subject for conditional release on probation. Due process does not require that he must now be allowed to appear in person and with counsel in the San Bernardino court for the purpose of collaterally attacking the soundness of that determination.
(7b) We conclude that section 1203.2a affords a constitutionally viable procedure by which a defendant who has accepted probation and then is committed to prison for another offense can obtain prompt final disposition of the case in which probation was granted. Because of that conclusion we do not reach petitioner's further contention that the right to a speedy trial (U.S. Const., Amend. VI; Cal. Const., art. I, § 13) includes the right to speedy imposition of sentence. (Compare People v. Brown (1968) supra, 260 Cal. App.2d 745, 751, with People v. Stokes (1907) 5 Cal. App. 205, 214 [89 P. 997].)
*226 The alternative writ is discharged and the petition for a peremptory writ of mandate is denied.
McComb, J., Peters, J., Tobriner, J., Mosk, J., Burke, J., and Sullivan, J., concurred.
NOTES
[1]  The uniform act is in effect in seven states. (National Conference of Commissioners on Uniform State Laws (1970 Handbook) p. 309.)
[2]  As to a prisoner who has been granted probation without imposition of sentence 1203.2a provides, "If any defendant who has been released on probation is committed to a prison in this State for another offense, the court which released him on probation shall have jurisdiction to impose sentence ... in the absence of the defendant, on the request of the defendant made through his counsel, or by himself in writing, if such writing is signed in the presence of the warden ... and such warden ... attests both that the defendant has made and signed such request and that he states that he wishes the court to impose sentence in the case in which he was released on probation, in his absence and without his being represented by counsel.

"... [T]he court is deprived of jurisdiction over defendant if it does not impose sentence and issue its commitment or make other final order terminating its jurisdiction over defendant in the case within 30 days after defendant has, in the manner prescribed by this section, requested imposition of sentence.
"Upon imposition of sentence hereunder the commitment shall be dated as of the date upon which probation was granted and if the defendant is then in a state prison for an offense committed subsequent to the one upon which he has been on probation, the term of imprisonment of such defendant under a commitment issued hereunder shall commence upon the date upon which defendant was delivered to prison under commitment for his subsequent offense, unless the court shall order that the sentence for the prior offense shall commence upon termination of the sentence for said subsequent offense."
As to a prisoner who has been granted probation with execution of sentence suspended section 1203.2a provides, "Upon being informed by the probation officer of the defendant's confinement, or upon receipt from the warden, superintendent or duly authorized representative of any prison in this State of a certificate showing that the defendant is confined in prison, the court shall issue its commitment if sentence has previously been imposed."
[3]  In People v. Williams (1944) 24 Cal.2d 848, 853 [151 P.2d 244], it is said that section 1203.2a "applies only to a probationer who is subsequently committed in this state." Williams, however, did not consider the equal protection problem. Therefore, the quoted statement is not authority contrary to our present holding. (McDowell & Craig v. City of Santa Fe Springs (1960) 54 Cal.2d 33, 38 [4 Cal. Rptr. 176, 351 P.2d 344].)
[4]  Section 1203.2a now authorizes and requires imposition of sentence only "on the request of the defendant made through his counsel, or by himself in writing ... [stating] that he wishes the court to impose sentence ... in his absence and without his being represented by counsel."
[5]  If petitioner makes such a request and if respondent disposes of the case by imposing a prison sentence concurrent with the sentence which petitioner is now serving, concurrency will be effected under the provision of Penal Code section 2900 that "In any case in which, pursuant to the agreement on detainers or other provision of law, a prisoner of another jurisdiction is, before completion of actual confinement in a penal or correctional institution of a jurisdiction other than the State of California, sentenced by a California court to a term of imprisonment for a violation of California law, and the judge of the California court orders that the California sentence shall run concurrently with the sentence which such person is already serving, the Director of Corrections shall designate the institution of the other jurisdiction as the place for reception of such person" so as to start the running of the California term. (See In re Tomlin (1966) 241 Cal. App.2d 668, 670 [50 Cal. Rptr. 805]; In re Altstatt (1964) 227 Cal. App.2d 305, 307 [38 Cal. Rptr. 616].)
