Our standard of review on appeal from a superior court order affirming or reversing an agency decision is the same as that employed by the superior court. Dorsey v. UNC-Wilmington, 122 N.C. App. 58, 62-63, 468 S.E.2d 557, 560, cert. denied, 344 N.C. 629, 477 S.E.2d 37 (1996); Dockery v. N.C. Dept. of Human Resources, 120 N.C. App. 827, 463 S.E.2d 580 (1995). When the issue on appeal is whether the agency decision is supported by the evidence, the “whole record” test is appropriate. Dorsey, 122 N.C. App. at 62, 468 S.E.2d at 559-60. When the issue is whether the agency erred in interpreting a statutory term, an error of law is asserted, and this Court may substitute its own judgment for that of the agency and exercise de novo review. Id., 468 S.E.2d at 559; Friends of Hatteras Island v. Coastal *158 Resources Comm., 117 N.C. App. 556, 567, 452 S.E.2d 337, 344 (1995). See N.C. Gen. Stat. § 150B-51 (1995).
We therefore exercise de novo review to interpret the statutory provision of the Local Governmental Employees’ Retirement System that allows for payment of a death benefit to the beneficiary of a member who dies while “in service.” N.C. Gen. Stat. § 128-27(1) (1995 & Supp. 1996).
For the purpose of the [Death Benefit] Plan, a member shall be deemed to be in service at the date of his death if his death occurs within 180 days from the last day of his actual service.
In administration of the death benefit the following shall apply:
(2) Last day of actual service shall be:
a. When employment has been terminated, the last day the member actually worked.
b. When employment has not been terminated, the date on which an absent member’s sick and annual leave expire.
Respondent’s position is that when petitioner’s decedent retired on disability, her employment was effectively “terminated” within the plain meaning of this provision. Her “last day of actual service” was therefore 1 June 1990, the last day she actually worked. Under this reading of the statute, adopted by the Board in its Final Agency Decision, her death on 18 October 1991 was more than 180 days after her “last day of actual service,” and the death benefit is not payable to petitioner.
Petitioner contends, on the other hand, that the decedent’s retirement did not “terminate” her employment within the context and purpose of this statute. Her “last day of actual service,” therefore, was on 31 July 1991, the date petitioner argues his wife’s sick and annual leave expired. Under this reading of the statute, adopted by both the ALJ and superior court, the decedent’s death falls within 180 days of her “last day of actual service,” and the death benefit is payable to petitioner.
*159Upon a thorough examination of the statute and the facts of the case, we find neither party entirely correct. While we agree with petitioner that “termination” in the context of the death benefit statute does not encompass “retirement,” we disagree about the date upon which the decedent’s sick leave expired. As a result, we ultimately conclude that petitioner is precluded from recovering the death benefit.
We arrive at this conclusion by first carefully examining the death benefit statute itself. To interpret specific terms in the statute we begin by referring to the definitions explicitly set forth, “unless a different meaning is plainly required by the context.” G.S. § 128-21. The statute explicitly defines “retirement” as “withdrawal from active service with a retirement allowance granted under the provisions of this Article.” G.S. § 128-21(19). It is notable that “retirement” is not described as termination of employment.
The word “termination” is not defined in the statute. Therefore, to determine whether “termination” is intended to include retirement here, we look to the plain meaning required by the context. Because legislative intent “controls the interpretation of a statute, . . . the words and phrases of a statute must be interpreted contextually, in a manner which harmonizes with the other provisions of the statute and which gives effect to the reason and purpose of the statute.” Burgess v. Brewing Co., 298 N.C. 520, 523-24, 259 S.E.2d 248, 251 (1979) (citations omitted).
The death benefit statute at issue does not include an explicit statement of reason and purpose. However, in interpreting the analogous provisions of the North Carolina Teachers’ and State Employees’ Retirement System, N.C. Gen. Stat. § 135-5 (1995), this Court has held that the overall policy and intent of the retirement, disability, and death benefit scheme “is not to exclude, but to include state employees under an umbrella of protections designed to provide maximum security in their work environment and to afford ‘a measure of freedom from apprehension of old age and disability.’” Stanley v. Retirement and Health Benefits Division, 55 N.C. App. 588, 591, 286 S.E.2d 643, 645, disc. review denied, 305 N.C. 587, 292 S.E.2d 571 (1982) (quoting Bridges v. Charlotte, 221 N.C. 472, 477, 20 S.E.2d 825, 829 (1942)); see also Garrett v. Teachers’ & State Employees’ Retirement System, 91 N.C. App. 409, 371 S.E.2d 776, disc. review denied, 323 N.C. 624, 374 S.E.2d 585 (1988).
*160  Considering this policy, along with the statutory formula to determine the “last day of actual service,” we find that an employee’s time “in service” is the time for which salary is earned. The protective umbrella, then, is inclusive only to the extent that a death benefit is available if the member dies within 180 days after she last earned a salary, whether it be earned from time spent actually working or from time credited for sick and annual leave.
In the context of the death benefit statute, it would be unjust to conclude that a member has “terminated” employment by retiring on disability after she exhausts sick and annual leave. The result would be that in calculating the 180-day extension period from the “last day of actual service,” a member who retires after exhausting sick and annual leave, and then dies soon afterwards, having only reaped minimal benefits from the retirement plan, would effectively forfeit credit for the time spent exhausting sick and annual leave, while a member who dies while delaying retirement would be credited with the time spent exhausting sick and annual leave. The effect of this arbitrary distinction would be to discourage retirement, undoubtedly in derogation of the protective purpose of the retirement, disability, and death benefits scheme.
We find support for this position in the North Carolina Administrative Code’s rules for state and eligible local personnel. The Code provides that upon “separation from service” due to resignation, dismissal, reduction in force, or death, accrued vacation leave is paid in a lump sum, and the last day of work is the date of separation. N.C. Admin. Code tit. 25, r. 1E.0210(a) (1995). Upon separation from service due to retirement, however, an' employee “may elect to exhaust vacation leave after the last day of work but prior to the effective date of retirement. ... If leave is exhausted, the last day of leave is the date of separation." Id. (emphasis added). Moreover, when an employee is granted medical leave without pay, but has not yet retired, “[t]he date separated shall be the last day of work or the last day leave is exhausted, whichever is later. Id. r. 1E.0314 (emphasis added). “An employee shall exhaust accumulated sick leave before going on leave without pay.” Id. r. 1E.0314(1).
 These rules clearly indicate that if an employee is separated for reasons other than retirement, the last day of work is the date of separation, with no time credited for accumulated vacation or sick leave. If an employee takes medical leave without pay or retires, the last day of work is dependent upon the time credited for accumulated vaca*161tion and sick leave. The death benefit statute can account for this distinction in credit allowances for accumulated vacation and sick leave only if it is read to distinguish retirement from termination of employment.
 Accordingly, we find that when the decedent retired on disability, she was not “terminated” within the meaning and context of the death benefit statute. Therefore, under the formula set forth in G.S. § 128-27(1), the last day of the decedent’s actual service was the date on which her sick and annual leave expired.
Petitioner argues that 31 July 1991 was the date his wife’s sick and annual leave expired, but upon review of the whole record, we find that although the decedent had .23 of a day of sick leave remaining when she took medical leave without -pay, which she retained until her retirement, her sick and annual leave was in fact exhausted on 12 March 1991, the date on which she was granted medical leave without pay.
If the remaining .23 of a sick day were accounted for, it would at most shift the exhaustion date to 13 March 1991. The fact that the decedent did not actually receive payment for the .23 of a sick day until after her retirement does not have the effect of extending her sick leave beyond the date upon which it truly expired. Because the decedent died on 18 October 1991, more than 180 days after either 12 or 13 March 1991, the death benefit is not available to petitioner.
In sum, while we agree with the Final Agency Decision, we arrive at the result by a very different reading of G.S. § 128-27(1). The order of the superior court is reversed.
Judges MARTIN, John C., and TIMMONS-GOODSON concur.