This is an appeal from a judgment denying appellant’s petition for a writ of mandate, dissolving the alternative writ, and adjudging appellant indebted to the retirement fund of the City and County of San Francisco in the amount of $4,708.92.
The facts are not in dispute. Appellant is a cable ear grip-man on the San Francisco Municipal Railway, a civil service position. For a long time prior to the events in this case, his former wife Zereldia McDaniel had ■ regularly attached his earnings pursuant to a judgment for child support. These attachments were made under the procedure described in Code oí Civil Procedure, section 710.
On April 23, 1964, appellant had been employed by the Municipal Railway for 16% years and had accumulated $8,238.86 in the city retirement fund. Beginning with that date, the following events occurred:
(1) April 23, appellant was suspended from his employment for a violation of Municipal Railway rules.
(2) May 26, he requested a refund of his retirement contributions. The form filled out and signed by him stated: “My service with the City and County of San Francisco terminated 4-23-64. I hereby request refund of the accumulated contributions standing to my credit in the retirement fund. ’ ’
(4) June 8, appellant’s former wife filed an abstract of judgment and affidavit with the controller’s office under Code of Civil Procedure, section 710. The affidavit asserted that $4,872.68 was due her under the judgment.
(5) June 19, the city’s Retirement System, pursuant to appellant’s request, submitted to the controller a refund roll for the sum of $8,238.86, payable to appellant.
(6) June 23, appellant’s appeal was filed with the Civil Service Commission.
(7) June 25, the controller, in response to the abstract of judgment and affidavit filed with him, prepared a warrant in the sum of $4,708.92, 1 payable to the superior court, and deposited the warrant with the court. The controller did not notify appellant that a part of the refund of Ms retirement contributions was being paid into court pursuant to the attachment.
(8) June 29, appellant called at the offices of the Retire *360 ment System. There he learned that a portion of his retirement refund had been sent to the superior court. A warrant for the remainder of his contributions was tendered to him, but he refused to accept it. He informed the clerk in the office that he “. . . didn’t want the money, because my case was being appealed, and chances are I would get reinstated by the railway, and I wanted the money -to remain in the Retirement System. ’ ’
(9) June 30, the superior court ordered the funds in its possession paid over to the attaching creditor. This payment was made without appellant’s knowledge.
(10) July 8, appellant’s attorneys notified the Retirement System of the rescission of his request to withdraw his retirement funds. His attorneys requested prompt action and noted that a levy had been made upon the controller, and that there was danger some of the funds might be paid over under the levy unless speedy action was taken. At the same time appellant notified the Retirement System of his appeal.
(11) March 22, 1965, the Civil Service Commission ordered appellant reinstated with back pay from the date of his dismissal, less amounts earned while discharged.
The respondent city did not pay the back wages ordered by the Civil Service Commission. It asserts that appellant is deficient in his retirement fund contributions because of the money withdrawn by appellant and seized by his creditor, and that this amount should be set off against the amount of back wages found due under the Commission’s order.
On the facts recited, the trial court found that appellant was indebted to the city’s retirement fund in the amount of $4,708.92 and that the city was entitled to set off this amount against any back wages due him. Accordingly, the court denied the writ. We conclude that the trial court’s judgment is correct, and therefore affirm.
One of the essential conditions for issuance of the writ of mandate is a showing on the part of the applicant that he has a clear legal right to the performance of the act the writ would compel.
(Consumers Salt Co.
v.
Riggins,
208 Cal.. 537, 543 [
Code of Civil Procedure, section 710 establishes a procedure for enforcing money judgments against a debtor to whom money is owed by the state or a political subdivision thereof.' Insofar as applicable here, the statute allows the judgment' creditor to file an abstract of judgment with the city auditor,together with an affidavit stating the amount due, and thereupon makes it the duty of the auditor to forward to the court which issued the abstract of judgment an amount sufficient to pay the claim, or a part thereof equal to no more than one-half of the debtor’s salary or wages owing by the city to the debtor for personal services rendered within 30 days of the levy.
One of appellant’s prime contentions is that the retirement contributions paid into court by the auditor were not monies “owing and unpaid” to him within the meaning of section 710, because petitioner was not entitled to have his retirement contributions paid to him while the appeal from his discharge was pending. We find no merit in this ground of appeal.
In our opinion, appellant’s retirement contributions were “owing and unpaid” from the time of his discharge on May 21, or, at the very latest, from May 26, when he demanded a refund of his contributions in writing. The city had received his contributions over a period of years and was bound to account to him for them if for any reason his pension rights did not mature. (S.F. Charter § 165.2(F).) This was an existing and unsatisfied legal liability on the part of the city. (See
Department of Water & Power
v.
Inyo Chemical Co.,
Appellant’s reliance upon
Credit Bureau of San Diego, Inc.
v.
Getty,
Nevertheless appellant argues that the city breached a statutory duty to notify him that his wife had levied upon his funds. The sum of his argument is that if he had been notified in time he could have taken steps to revoke his claim for a refund before the auditor sent the money to the court, or claim an exemption under Code of Civil Procedure, section 690. (See, e.g., Code Civ. Proc., § 690.23.) Perhaps appellant could have successfully contested the claims of his wife and the rights of his children if he had been forewarned. But appellant set the machinery in operation to obtain his money. This began on May 26, when he demanded a refund of his contributions. The creditor’s levy arrived on June 8th, but it was not until June 19th, when the Retirement System sub *363 mitted its roll to the auditor, that the latter was aware of the funds due appellant. Two days later, without any word from appellant, the auditor complied with the court’s order and forwarded the funds to the court. The auditor called the court’s attention to possible exemptions appellant might claim, and in this respect went further than the law expressly requires. Thereafter the matter was in the hands of the court. Neither the city nor the auditor can be held liable because the court paid out the funds to the creditor before appellant could assert a claim of exemption.
Although section 710 provides a summary adversary proceeding in the superior court for one whose funds are attached while in the hands of a governmental unit (see Code Civ. Proc., §690.26), it imposes no duty on the auditor or controller to notify the debtor of the garnishment. The Legislature could have inserted such a requirement in the detailed provisions for proceeding under section 710 if it had so desired, and it may do so at any time. As drafted, however, it is significant that the statute merely requires that the controller or auditor forward the funds to the court, withholding only a wage exemption (Code Civ. Proc., §710, subd. 2). The purpose of providing a special garnishment procedure in the superior court where governmental units are involved is clearly to shift to the court the burden of adjudicating any claims of exemption which may arise and to insulate the governmental units from liability for wrongful payments to garnishing creditors. To hold the city and county liable in this case would thus defeat the purpose of section 710. Whether the garnishing judgment creditor or any other person has a duty to notify the judgment debtor of the proceedings in the superior court is a question not properly before us on this appeal.
We recognize that, under some circumstances, it has been held that a garnishee, who knows that the property levied on is subject to a claim of exemption and that the judgment debtor is ignorant of the levy, has a duty, whenever practicable, to notify the debtor of the garnishment, so that the latter may have the opportunity to claim his exemption if he desires.
(Agnew
v.
Cronin,
*364 Appellant argues that the alleged setoff has not been properly pleaded. The essence of his objection is that it should have been presented in a separate pleading, either by cross-complaint or counterclaim. (See 2 Within, Cal. Procedure (1954) Pleading, § 566, p. 1570.) The record shows it was merely included as a part of a paragraph in the answer to the petition for the writ. Perhaps it would have been better to describe respondents’ setoff in a separate pleading, but no harm has been done by that omission. All of the facts surrounding the claim are fully and clearly set forth in the answer. Appellant was fully informed. He knew exactly what to expect at the hearing. He could not have been better informed by a separate pleading. Aside from a brief reference to the subject in his memorandum of points and authorities accompanying his general demurrer to the answer, he made no reference in the trial court to the claimed defect in the answer. The matter was thereafter fully presented on its merits. Whatever objection might have been urged against the pleading of the setoff vanished at the close of the evidence, because the matter was fully heard under the pleadings presented.
Appellant contends further that, in this mandamus proceeding, the city is not entitled to set off the amount of his retirement account deficiency against his claim for back wages, because that matter is purely collateral, unrelated to his right to have the city comply with the order of the Civil Service Commission, and thus may not be considered in this case. We do not agree.
Code of Civil Procedure, section 1109, relating to extraordinary writs, makes the provisions of part 2 of that code applicable to writ proceedings. Part 2 includes provisions relating to pleadings in civil actions, and such provisions are therefore fully applicable to writ proceedings unless other rules are specifically made applicable. A respondent’s answer to a petition for the writ of mandate should set up any matter of defense relied upon as justification for the circumstances which gave rise to the petition for mandate.
{Rittersbacker
v.
Board of Supervisors,
The doctrine of setoff is described in Code of Civil Procedure, section 440, It reads: ‘
1
When cross-demands have
*365
existed between persons under such circumstances that, if one had brought an action against the other, a counterclaim could have been set up, the two demands shall be deemed compensated, so far as they equal each other, and neither can be deprived of the benefit thereof by the assignment or death of the other.” Thus, when cross-demands exist between parties, their claims are paid to the extent they are equal.
(Jones
v.
Mortimer,
The judgment is affirmed.
Draper, P. J., and Bray, J., * concurred.
