It’s the department-store mantra of the 1990s: shape up or go bust. With the news last week that legendary retailer R.H. Macy & Co. was in the hands of a bankruptcy judge, the death knell for department stores seemed to be sounding anew. But as Macy’s joined Carter Hawley Hale and Federated/Allied in bankruptcy court, many other department stores were showing signs of becoming powerful retail forces again. Faced with competition from discounters, they are expanding, rejiggering merchandising formulas and becoming more shopper friendly. For example: May Department Stores, owner of Lord & Taylor, has jettisoned designer apparel in favor of more moderately priced goods. Dillard’s has pioneered one of the most sophisticated inventory systems in retailing. Seattle’s Nordstrom is plying shoppers with irrepressively helpful salespeople, live piano concerts and valet parking. “We’ve seen some meteors fall, but department stores have yet to go the way of the dinosaur,” says George Ashur of Chase Securities Inc. “The ones that will survive are the ones that [can] adapt.”

Where did the great American shopping institution go astray? Part of the problem is a retail glut. In the last 15 years, store space in the United States grew at an average annual pace of 5.7 percent, but sales per square foot have declined. Leonard Berry, head of Texas A&M’s Center for Retailing Studies, says department stores are islands surrounded by vicious competitors. On the right, the attackers are specialty retailers like the Gap and J. Crew. On the left are the so-called category killers such as Toys “R” Us and Circuit City. At the bottom are discounters like Wal-Mart. “Everybody’s taking a piece,” he says.

The chains hardest hit are those with the most debt. For instance, B. Altman in New York closed its doors two years ago, thanks to a big debt burden and unimaginative merchandising. Macy’s problems began when it saddled itself with $3.5 billion in debt to take the company private in 1986, and worsened two years later when the retailer borrowed $1.1 billion more to buy Bullock’s and I. Magnin. Macy’s blames most of its troubles on the economy, but many analysts believe Macy’s might have avoided Chapter 11 had it simply curbed its acquisitive appetite. “Macy’s is the victim of foolish financial decisions,” says Kurt Barnard, a retail consultant.

Preoccupied with finances, many department stores forgot about their customers. Shoppers who were once loyal department-store buyers began viewing the big stores as browsing emporiums-good for sizing up merchandise that they planned to purchase elsewhere at a discount. That’s because the stores thoroughly confused shoppers; they held so many sales that consumers seemed to shop only when prices were slashed by 50 percent. Such habits die hard. Houston’s Fan Morris, for example, is the kind of shopper department stores dread. Morris recently canvassed the aisles at Dillard’s only to beat a retreat to a less expensive shop. As she explained: “I’d rather go get some blue jeans at the Gap.”

To help snare customers like Morris, some department stores are accelerating so-called store-within-a-store programs. The idea is to create specialty shops inside the sprawling boundaries of a department store. The objective: to avoid price competition from discounters and bring in exclusive specialty operations that other department stores don’t have. In February, for example, Bloomingdale’s and Giorgio Armani will open an A/X: Armani Exchange store, featuring more moderately priced versions of Armani’s chic designer offerings. The stores will be stocked with such utilitarian items as jeans, skirts, sweaters and jackets, most of them at prices less than $100. Shoppers will enter the boutique through a separate street entrance.

Some department stores are taking the specialty concept outside their walls. With its spinoff of the furniture department, Burdines aims to relieve clutter and win back customers. The furniture department, meanwhile, is now housed in a separate 70,000-square-foot building. Why the move? Marketing vice president Cary Watson reckoned few customers would pick up a sofa while shopping for socks. Burdines, a Florida chain owned by Federated, will use the space to push profitable, high-turnaround merchandise like women’s shoes.

Department stores are also beginning to catch up with their specialty counterparts in cutting-edge technology. And that has resulted in getting more products on the shelves faster. Dillard’s, whose profits rose 25 percent through November of last year, owes much of its success to its computerized inventory tracking system. Called Quick Response, the system allows executives to monitor sales at the push of a button and has reduced the time needed to reorder merchandise from one month to about one week. Federated, which expects to emerge from Chapter 11 this month, has installed a similar system.

Department stores are still often hard pressed to compete on price. But like contestants in the Miss America pageant, they can go a long way on personality. With a mixture of folksiness and honesty, the Birmingham, Ala.-based Parisian stores are attempting to wean customers from the habit of shopping only at sales. Company officials mark down merchandise only once, early in the season; to make sure shoppers don’t wait around for a discount, they guarantee the price won’t get any lower. Parisian tries to make shoppers more comfortable, too. It has few cumbersome anti-shoplifting devices. “We operate our business on the belief that most customers are honest,” says CEO Donald Hess. “You won’t see anything chained down. We feel like that makes it awful hard to try on.”

Can these new tricks really help department stores recapture their past glory.? John Deighton, a University of Chicago marketing professor, says it’s too early to tell. “They’re the beached whales of the retail industry,” he says, “too sick to live, and too big to die.” But if stodginess can be avoided, size has its advantages. Department stores still have a lock on designer goods like fragrances and cosmetics, and they’ve built a large customer base by offering consumers easy credit. What’s more, they provide something specialty stores cannot: one-stop shopping. Valerie Arkin, a mother of three from Clarendon Hills, Ill. so shelter at Marshall Field the other day, while trying to outfit her daughter for an upcoming sock hop. “We figured at a department store we could get the outfit, the shoes and the accessories all in one place,” she says. Good news for department stores. The question is whether there are enough Valerie Arkins to around.

Photos: Trying to make customers more comfortable: Hess (above), a shopper at one of Federated’s A&S branches (MIKE CLEMMER-PICTURE GROUP, JODI BUREN)

Hit by hard times and fierce competition from specialty retailers and discounters, department stores are battling back to attract once loyal customers.

A $3.7 billion debt load and a dismal Christmas forced the legendary retailer to file for bankruptcy protection last week. But the parade is still on.

The chain shines by utilizing complex inventory systems. The result: since buyers can always find those purple sweaters, profits up 25 percent through November.

Hurt by the recession, but still sets the industry standard for service-with eager-to-please sales help, home delivery and piano serenades.

Bloomingdale’s parent should emerge from bankruptcy protection soon, without its coterie of food and discount stores.

Hard times be damned! One of the nation’s best-run merchants, the owner of Lord & Taylor and Filene’s plans to open 85 new stores by 1995.