538 F.2d 852
Susan RoANE et al., Appellants,v.F. David MATHEWS, Secretary of Health, Education andWelfare, et al., Appellees.
No. 74-2346.
United States Court of Appeals,Ninth Circuit.
July 22, 1976.

F. Bradford Niebling (argued), of Patmont & Meyers, San Francisco, Cal., for appellants.
Robert Leberman, Deputy Atty. Gen.  (argued), San Francisco, Cal., and Paul J. Fitzpatrick, Asst. U. S. Atty.  (argued), San Francisco, Cal., for appellees.
OPINION
Before CHAMBERS, KILKENNY and TRASK, Circuit Judges.
PER CURIAM:


1
Appellants appeal from an order of the district court dismissing their class action seeking declaratory, injunctive, and other relief, including reimbursement for Social Security contributions made since July 1, 1972.

FACTS

2
Appellants are employees of the San Francisco Unified School District, and became so employed between October 16, 1969, and July 1, 1972.  Upon entering employment, each, without affirmative action, became a member of the San Francisco City and County Employees' Retirement System (SFRS).  In conformity with the provisions of 42 U.S.C. § 418, and under the terms of an agreement entitled "Modification No. 296" between the Secretary of Health, Education, and Welfare (Secretary) and the State of California (State) acting through the Board of Administration of the State Employees' Retirement System, appellants either became covered by the provisions of the Social Security Act simultaneously with their employment, or they subsequently elected such coverage.  On July 1, 1972, a recently enacted California statute became effective and required appellants to elect whether to remain in the SFRS, and thereby continue to be covered by the Social Security Act, or to resign from SFRS, join the State Teachers' Retirement System (STRS), and thereby terminate their coverage under the Social Security Act.  Although appellants all chose to join the STRS and to terminate Social Security coverage, since July 1, 1972, Social Security contributions have continued to be deducted from their salaries.  In this lawsuit, appellants and the members of their class seek a declaration that they are not covered by the Social Security Act and, consequently, do not qualify for Social Security benefits, a refund of the contributions already paid, and an injunction against further deductions for Social Security contributions from their salaries.


3
Their second claim is in the nature of a petition for writ of mandamus to compel appellees to return to appellants, and the members of their class, all Social Security contributions made by them from and after July 1, 1972.

DISCUSSION

4
Inasmuch as appellants' claims require construction of the relevant provisions of Title II of the Social Security Act, and the regulations promulgated thereunder, and in view of the admitted fact that appellants did not, prior to the institution of this litigation, seek an exhaustion of their administrative remedies under 42 U.S.C. § 405(g), (h), we agree with the district court that it had no jurisdiction to consider the claims.  The necessity of exhausting administrative remedies under the Act has recently been restated and emphasized in Weinberger v. Salfi, 422 U.S. 749, 95 S.Ct. 2457, 45 L.Ed.2d 522 (1975).


5
Appellants, in a showing outside of the record, call attention to the fact that a number of appellants have now exhausted their administrative remedies by securing a decision of the Secretary on the issues here presented, invite us to disregard the requirements of the Act and proceed to decide their claims on the merits.  We decline the invitation for the following reasons: (1) we seriously question our jurisdiction to proceed; (2) such a procedure would set a harmful precedent; and (3) upon review, the district court is entitled to the benefit of such expertise as the Secretary may employ in deciding the claims and in construing the Act and regulations.


6
The purpose of exhaustion of remedies is to permit the agency to function efficiently, to afford it an opportunity to correct its own errors, to give the court the benefit of agency experience, and to compile a record that is adequate for judicial review.  Weinberger v. Salfi, supra; McKart v. United States, 395 U.S. 185, 193-194, 89 S.Ct. 1657, 23 L.Ed.2d 194 (1969).  The discussions, findings, and conclusions of the Secretary presented to us in connection with the appellants' invitation are precise, detailed, and exhaustive.  On review by the district court, such findings and conclusions would be of unquestionable assistance in construing the relevant legislation and in passing on the validity of the respective claims.  See Salfi, supra.


7
Moreover, we agree with the State appellees that the appellants must exhaust their federal administrative remedies before obtaining a judicial review of their rights, if any, against those appellees growing out of the Social Security Act and the related contract with the State of California.  The claims against State appellees are likewise tied to a construction of the relevant Social Security legislation to which we previously referred.


8
For the reasons just stated, we conclude that the district court had no jurisdiction under 28 U.S.C. § 1331 to entertain a claim against either State or Federal appellees.


9
Similarly, the construction placed on the relevant provisions of the Social Security Act by the Supreme Court in Salfi, supra, lodges exclusive jurisdiction of claims under the Act in the agency, subject only to review by the district court as provided for in the Act.  In these circumstances, the issuance of a writ of mandamus pursuant to 28 U.S.C. § 1361 would be wholly unwarranted.  The recent cases of Kerr v. United States District Court, --- U.S. ----, 96 S.Ct. 2119, 48 L.Ed.2d 725 (1976); Mathews v. Diaz, --- U.S. ----, 96 S.Ct. 1883, 48 L.Ed.2d. 478 (1976), and Mathews v. Eldridge, --- U.S. ----, 96 S.Ct. 893, 47 L.Ed.2d 18 (1976), support the view that mandamus will not lie in these circumstances.

CONCLUSION

10
The judgment of the district court is affirmed.  However, we are aware of no reason why the Secretary should not permit all appellants, if they so desire, to join in the proceedings before him and prosecute their claims before the district court in accordance with the provisions of the Act.  He might even consider the status of the class action plaintiffs.  Jimenez v. Weinberger, 523 F.2d 689 (CA7 1975).


11
JUDGMENT AFFIRMED.

