I would reverse the order of the Appellate Division and dismiss the petition solely upon the ground that the determination of the New York City Commissioner of Correction to separate prisoners into two groups, below and above the age of 21, was not contrary to law and that the Appellate Division erred in substituting its judgment for that of the Commissioner of Correction in lowering the age to 19.
The Commissioner of Correction of the City of New York is vested with the (t[s]ole power and authority concerning the care, custody and control of all court pens for the detention of prisoners while in the criminal courts of the city of New York, the family court of the state of New York within the city of New York, the supreme court in the counties of New York, the Bronx, Kings, Queens and Richmond * * * who have been sentenced, are awaiting trial or are held for any other cause.” (New York City Charter, § 623, subd 2; emphasis added.) Consistent with the city charter provision subdivision 1 of section 112 of the Correction Law places all State prisoners under the care, custody and control of the State Commissioner of Correction.
Exercising the power delegated to him, the Commissioner of Correction of the City of New York, seeking to comply with section 88 of the New York City Criminal Court Act, ordered that prisoners detained in the Manhattan Criminal Court building detention facilities be separated at the age of 21.
Where, as in this case, review is sought of the construction of a statute by an agency charged with its administration, the scope of the inquiry is limited. So long as the determination rests on a rational basis, and is not contrary to law, appellate courts must not upset it. (Matter of Pell v Board of Educ., 34 NY2d 222, 230-231; Matter of Howard v Wyman, 28 NY2d 434, 438.) Since the classification established by the New York City Commission of Correction satisfies-the test of rationality, *235and is not contrary to law, I would reverse with prejudice and reinstate the determination of the commissioner.
Chief Judge Breitel and Judges Gabrielli, Jones, Fuchs-berg and Cooke concur with Judge Wachtler; Judge Jasen concurs in part and dissents in part and votes to reverse and dismiss the petition with prejudice in a separate opinion.
Judgment reversed, without costs, and the petition dismissed without prejudice to commencement of a new proceeding.