To most new hires, the idea of being eligible for a pension probably seems as far-fetched as being asked to write memos on an IBM Selectric typewriter. But a new study shows that a fair number of companies still offer the traditional retirement plans — and aren’t planning to get rid of them any time soon.

Some 30% of companies surveyed by professional services company Towers Watson this year said they still offer pension plans to new hires, along with other retirement savings options like 401(k) plans. And the vast majority of those firms, more than 70%, said they expect to continue offering the benefit to new workers five years from now. The plans may give them a hiring advantage over competitors at a time when most employers leave the burden of retirement saving to individual workers through 401(k) plans and individual retirement accounts, consultants say. Indeed, while the report didn’t mention specific companies, pharmaceutical firm Eli Lilly says it invests in new workers by offering pensions, along with competitive salaries, training and other perks. “This becomes a very important differentiator for them as they look to attract and retain talent,” says Matt Herrmann, leader of retirement risk management at Towers Watson.

Also see: Robert Powell’s, “Create a ‘what if’ plan that assumes pension is cut by half”

Some companies were able to keep offering the plans to new workers because they didn’t suffer as many losses during the financial crisis thanks to low exposure to the stock market, says Herrmann. Other plans have benefited more recently from the strong market performance seen in recent years. (The S&P 500 stock index is up more than 25% so far this year.) The stronger performance is encouraging some plan sponsors to reduce their risk by cutting down their stock exposure or offering lump sum payments to some participants, a move that reduces the number of people that need to receive payments in the future.

To be sure, the pension is still an increasingly rare perk. Over the past decade, most large employers have moved away from offering pensions to defined contribution plans such as 401(k)s. The share of pension plans still open to new hires is down from about 70% a decade ago, according to Towers Watson. Herrmann says that some sponsors who have closed access to their pensions may decide to freeze them altogether within the next five years. And many current pensions remain vastly underfunded.

Still, the decline in the share of companies looking to keep their pension programs has stabilized, says Herrmann. The report found larger companies with plans that had over $1 billion in assets were more likely than smaller companies to keep offering the perk to new hires. “We think there’s going to be a portion of the market that will remain open for a fairly long period of time,” says Herrmann.