
384 N.W.2d 666 (1986)
Kirk ANDERSON, Petitioner and Appellee,
v.
CITY OF SIOUX FALLS, MINNEHAHA COUNTY, South Dakota; Joe Cooper, Mayor of the City of Sioux Falls; and Manfred Szameit, City Finance Director of the City of Sioux Falls, Respondents and Appellants.
No. 14928.
Supreme Court of South Dakota.
Argued November 20, 1985.
Decided March 26, 1986.
*667 John Zimmer, of Zimmer, Richter & Duncan, Parker, for petitioner and appellee.
Duane C. Anderson, of Christopherson, Bailin & Anderson, Sioux Falls, for respondents and appellants; Roger A. Schiager, of Schiager & Peters, Sioux Falls, on brief.
MORGAN, Justice.
City of Sioux Falls (City) appeals from a judgment on an alternative writ of mandamus ordering City, Joe Cooper its mayor (Mayor), and Manfred Szameit, its finance director (Szameit), to immediately reinstate petitioner Kirk Anderson (Anderson) to the rank of battalion chief of the Sioux Falls Fire Department. We reverse.
In August of 1984, Mayor appointed a new fire chief. Pursuant to City Ordinance 30-19, the deposed fire chief, Orlan Norgaard, was returned to the position he previously held within the civil service, which was battalion chief. According to City, the return of Norgaard to this position left City with six battalion chiefs, where the fire department's table of organization provided for five. In view of this, Mayor determined that Anderson, who had been the last appointed battalion chief, should be reduced to his previous position of captain. Anderson then filed an appeal with the Civil Service Board (Board) for City as provided in Ordinance 30-47. After a hearing, the Board determined that there was no just cause for the reduction of Anderson and entered an order directing that he should be returned to the rank of battalion chief with pay from date of reduction. City failed to reinstate Anderson as a battalion chief and Anderson filed a petition for an alternative writ of mandamus from which proceedings this appeal arises. The parties stipulated that the trial court would consider the case upon the record made before the Board and not hear the case de novo. The trial court found that there was substantial evidence in the record to support the decision of the Board and concluded that a judgment should be entered ordering immediate reinstatement of Anderson to the rank of battalion chief and pay as of the date of his reduction, which judgment was forthwith entered.
The issues as expressed in City's brief and as realigned in Anderson's brief are so inartfully set out that we will restate the issues that require disposition as we proceed.
We first examine a procedural question. By stipulation, the trial court rendered its determination on the records from the Civil Service Board with no de novo proceedings conducted by the trial court. Anderson argues that this constitutes an *668 appeal by City where no right of appeal is provided by statute. See SDCL ch. 1-26. There is no provision in that chapter for appeal from a decision of the Civil Service Board. SDCL 1-26-1(1) specifically excludes from Chapter 1-26 "any unit of local government or any agency under the jurisdiction of such exempt ... units unless the... unit or agency is specifically made subject to this chapter by statute." City cites only its own ordinance in support of a right to appeal and we find no statutory authorization. We therefore agree with the trial court when it concluded "[t]hat respondents (City) have no right of appeal on the merits from the November 8, 1984 decision and order of the Sioux Falls Civil Service Board." However, the only significance we attach to that conclusion is that it lays to rest any suggestions that City had failed to exhaust its administrative remedies.
In our opinion, the dispositive issue in this case is whether the Board acted in excess of its jurisdiction so that a writ of mandamus will not properly issue to enforce its decision. Mandamus is an extraordinary writ. By statute, its purpose is "to compel the performance of an act which the law specially enjoins as a duty resulting from an office ... or to compel the admission of a party to the use and enjoyment of a right ... to which he is entitled, and from which he is unlawfully precluded[.]" SDCL 21-29-1.
The granting of a writ of mandamus is not a matter of absolute right, but is vested in the sound discretion of the court; and, where there is reason to doubt the necessity or propriety of issuing it, it should be refused. Halverson v. Williams, 38 S.D. 176, 160 N.W. 730 (1916). City, by its answer to the order to show cause raised the issue of the propriety of the Board order which Anderson sought to enforce. We think that the trial court very properly had cause to review the Board proceedings through mandamus.
Furthermore, it appears from the record that the propriety of the Board's determination was tried by consent inasmuch as it was argued by both sides before the trial court. As a result, the trial court concluded, in pertinent part:
That no plain, speedy and adequate remedy at law, or in the ordinary course of the law, exists for the Petitioner (Anderson) to compel the performance of the acts required by law and requested of the Respondents (City) which they have a clear and legal obligation to perform.
That reinstatement and reimbursement by Respondents as ordered by the Civil Service Board is a ministerial action properly subject to Writ of Mandamus and within the jurisdiction of this Court.
That Respondents have no discretion but are required by law to comply with the decision of the Sioux Falls Civil Service Board dated November 8, 1984 and reinstate Petitioner to Battalion Chief and pay as of August 20, 1984.
....
That the November 8, 1984 written decision of the Sioux Falls Civil Service Board is supported by substantial evidence.
We next examine the record to determine whether the Board erred in its determination that City had no just cause for reducing Anderson; and whether the Board had authority to order City to create a new position, that of a Sixth Battalion Chief.
On the first question, we find a maze of city ordinances and civil service rules. City Ordinance 30-45 provides in pertinent part that "[n]o person or employee holding an office or position classified and graded under the provisions of this chapter shall be... reduced from his position except for just cause which shall not be race, creed, color, national origin, political or religious." City Ordinance 30-46, in addition to providing a laundry list of acts of misconduct not applicable to this case, provides that "reductions may be made for other causes[.]" City Ordinance 30-19 provides in pertinent part that "[a]nyone holding an appointive office, who at the time of his appointment thereto, was in the civil service of the city shall, upon his removal from such appointive office, be returned to his former position and pay as an employee of the *669 city...." This latter ordinance mandated the return of the former fire chief to his previous position as battalion chief. Civil Service Rule 10 provides in pertinent part with respect to layoffs that
[w]henever it becomes necessary in any department ... for any proper and legal cause to reduce the force in any classification and grade of position in such department,... the persons service in such classification and grade of position shall be laid off in inverse order of their certification and appointment to such classification and grade of position, the last one so appointed to be the first laid off[.]
In addition to the foregoing, we find Mayor's authority to determine the staffing of the fire department in SDCL 9-9-26, wherein a mayor's responsibility in a three-member commission city includes under his special charge the supervision of the fire department. We also note SDCL 9-9-27, where the commissioners are assigned all matters relating to finances and revenue, assessment and collection of taxes, and the appropriation of all monies. Inasmuch as the civil service system for City was adopted as authorized by SDCL 9-14-14, under settled rules of statutory interpretation, all of these statutes, municipal ordinances and rules "must be construed together, giving effect as far as possible to all parts thereof, so as to harmonize them and effectuate the legislative intentions as therein expressed." Hanley v. Murphy, 40 Cal.2d 572, 576, 255 P.2d 1, 3 (1953).
The Board held an extensive hearing. Testimony and exhibits were received on a wide area of subjects: comparison of the growth of the fire department as opposed to the growth of the City of Sioux Falls; organizational requirements according to the provisions of the National Fire Protection Association Handbook and other publications; extensive discussions of the administrative duties of battalion chiefs and the recommendation of the battalion chiefs that a sixth position be created; availability of funds to pay a sixth battalion chief's salary because of projected surplus. As a result of this hearing the Board found: (1) All of the now existing battalion chiefs recommended that another battalion chief position be created because of the workload presently handled by them. (2) Szameit testified that the funds were available and were budgeted for 1985. (3) As to economy, Board notes that Mayor's salary was raised less than five months previous to Anderson's reduction with the proposal to again raise the salary within eight months of the previous raise. (4) There was no testimony as to any other proper and legal cause. (5) Mayor also cited organization and funding as reasons; funding has previously been discussed. (6) Reorganization of the battalion chief's duties is a matter of administrative responsibility and we heard testimony with regard to that showing how another battalion chief would fit within the fire department organization and what his duties would be. Mayor's only testimony was "it has always been this way and it worked okay." (7) There is no evidence of just cause for the reduction of Anderson; that the grounds stated in Rule 10 for layoff are not justified; and, that organization and fundings were not supported by the evidence. Board then directed that Anderson should be returned to the rank of battalion chief.
The fundamental purpose of civil service laws and rules is to establish a merit system whereby selections for appointments in certain branches of a public service may be made upon the basis of demonstrated relative fitness, without regard to political considerations, and to safeguard appointees against unjust charges of misconduct and inefficiency, and from being unjustly discriminated against for religious or political reasons or affiliations. 15A Am.Jur.2d Civil Service § 1 (1976).
A purpose of civil service legislation is to protect efficient public employees from partisan control; is not designed to prevent reorganization of a department to promote effectiveness and economy. Moreover, civil service laws do not guarantee to officers or employees the tenure of positions which are no longer required. Id. at § 72. In Lyon v. Civil Service Commission, *670 203 Iowa 1203, 1211, 212 N.W. 579, 582 (1927), the Iowa Supreme Court in discussing the civil service laws with respect to cutbacks in number of positions or offices in the Des Moines Fire Department, stated: "The provisions of Chapter 289 of the Code 1924 relating to the civil service are not applicable, where officers or employees are dismissed or discharged from the service to effect a reduction in the number thereof by abolishing the office."
In our opinion, the Civil Service Board of the City of Sioux Falls erred in far overreaching its jurisdiction. The decision was obviously a policy decision impinging on the authority of the mayor to determine the staffing and funding levels of the fire department as authorized in SDCL 9-9-26 and the authority of the city commissioners to act in their duties of funding and budgeting under SDCL 9-9-27. There is no evidence in the record to show that City acted in bad faith. City Ordinance 30-19 forced City to return the previous fire chief to his battalion chief position. Anderson was demoted pursuant to Civil Service Rule 10, which calls for last one hired, first one fired.
If civil service laws do not guarantee to employees the tenure of positions which are no longer required, how then could they possibly guarantee to employees a tenure of positions which are not in existence? City is not required to show cause in the nature of misconduct or ineptitude for Anderson's demotion that would clearly fall within the Board's jurisdiction. We hold that the lack of a position of a Sixth Battalion Chief was indeed just cause for Anderson's demotion.
Finally, we examine whether reinstatement of Anderson to battalion chief was a ministerial act for which mandamus will lie and more pertinently, was mandamus properly granted in this case. The answer to the foregoing issue is simply "no." The battalion chief's position to which Anderson sought restoration did not exist. Therefore, restoration to that position was not a ministerial act; rather, it would call for the city commission and the mayor to amend the Table of Organization of the Sioux Falls Fire Department to create such a position and to budget for such a position. This is a policy decision granted only to the mayor and the city commission, as previously noted.
Relief by mandamus may be refused to one seeking restoration to a position when that position has in good faith been abolished. 52 Am.Jur.2d Mandamus § 289 (1970). That would be no less applicable if a position never existed.
In our opinion the trial court erred in granting the writ of mandamus and we reverse the same and remand the case to the trial court with directions to dismiss.
FOSHEIM, C.J., HENDERSON and WUEST, JJ., and HERTZ, Circuit Judge, acting as a Supreme Court Justice, concur.
SABERS, J., not having been a member of the Court at the time this action was submitted to the Court, did not participate.
