In a proceeding pursuant to article 78 of the CPLR, the appeal is from so much of a judgment of the Supreme Court, Suffolk County, entered January 4, 1971, as directed that petitioner Osterberg be granted civil service status as a Deputy Sheriff, Grade III, and that appellant take the necessary steps to approve such classification. Judgment reversed, on the law, with $20 costs and disbursements, and proceeding remitted to the Trial Term for further proceedings consistent herewith. Following the service of the petition, appellant moved to dismiss the proceeding for legal insufficiency. The court decided the merits of the petition in favor of petitioner, without deciding appellant’s motion. That motion should have been decided before the court reached the merits of the petition. *842Further, if that motion is to be denied, appellant will be entitled to a reasonable time to answer the.petition (CPLR 7804, subd. [f]; Matter of Amato v. Barry, 30 A D 2d 699; Matter of Caruso v. Incorporated Vil. of Sloatsburg, 28 A D 2d 679). Hopkins, Acting P. J., Shapiro, Christ, Brennan and Benjamin, JJ., concur.