Samuel H. Armacost's appointment as president and chief executive of BankAmerica Corp. in 1981 culminated a rapid ascension that vaulted him over a layer of more-senior executives.

But his five years at the helm of the nation's second-biggest bank company -- with $118.5 billion in assets -- may seem longer than the 17 years he spent getting there. Just as he arrived, the environment in which the bank had prospered for more than 75 years had changed.

With an ability to garner deposits unmatched in the banking industry (only a few years ago it had more than 1,100 branches), BankAmerica's subsidiary, Bank of America, had only to worry about finding enough borrowers. In the 1960s and 1970s, a time of general economic prosperity, heavy regulation and low-cost deposits, nearly all its business was profitable.

With bank deregulation, however, the ability to raise consumer deposits is not enough to guarantee profitability. Those deposits are no longer low-cost. Bank of America's expensive branch system became a drain on earnings; so did the long-term, fixed-rate loans that made up a sizable portion of its portfolio. Management shortcomings compounded the problems created when an economic downturn struck many of the bank's customers.

Armacost, 46, joined the bank's corporate finance division in 1964 fresh out of Stanford University's business school. He moved quickly through the ranks and caught the eye of senior management. He served in the international division, set up a major operation in Chicago and returned to San Francisco as the bank's chief financial officer in the late 1970s. When President A. W. Clausen left in 1981 to head the World Bank, he appointed Armacost as his successor.

Armacost worried about whether he was prepared to be president at the age of 42. But he was convinced that the Bank of America that had prospered in the previous decade could not survive the 1980s.

Consequently, he set out to remake the bank: to impose sophisticated controls, to make executives accountable for decisions that once were made by committee in Bank of America's oversized bureaucracy, and to force management to think in terms of the costs and profitability of business relationships.

"We've virtually transformed the management structures over the last three years," Armacost said in an interview. "There are different types of people here now than would have been here five or 10 years ago. Times change."

Andrew F. Brimmer, a BankAmerica director and former Federal Reserve Board governor, said that Armacost has done a remarkable job in reworking Bank of America management. But Brimmer said Armacost's successes have been overshadowed by the bank's deteriorating earnings, caused in large part by conditions he inherited.

The bank's bottom-line performance is a sharp contrast to the steady growth in earnings and size during the decade that Clausen headed BankAmerica Corp. But BankAmerica insiders and analysts say that it was the loans and decisions made during Clausen's tenure -- boosting profits then to record levels -- that account for most of the earnings problems that have haunted the bank for the last five years.

Last year, the earnings problem became an earnings crisis. The bank had to write off so many loans as uncollectible that it reported a $337 million loss for 1985. That loss would have been greater had it not been for the $490 million in profits BankAmerica earned on the sale of its headquarters building and its consumer finance subsidiary.

BankAmerica executives said they think they have the loan problems under control. But they admit that a serious crisis in Latin America could force them to change that assessment. Mexico, which owes the bank $2.7 billion, has been hit hard by the decline in oil prices and may not be able to pay its loans on time.

In the last five years, the bank has written off $3.6 billion in loan losses and has taken an additional $1 billion from profits and added it to loan loss reserves. Most of the losses have come from loans to California real estate developers, farmers, private companies in Latin America and ship owners. There are another $4.3 billion of problem loans -- many of them making sporadic interest payments -- on the bank's books.

That the company can absorb loan losses of that magnitude is an indication of the underlying health of the institution, according to James Wiesler, the vice chairman in charge of the bank's California operations. He said the company lost another $3 billion in profits in the last five years because it had to fund low-interest, fixed-rate loans with high-interest, variable-rate deposits.

Although higher-cost consumer deposits may be a source of the bank's earnings woes, they also are a source of its strength. Consumer deposits, most of them insured by the federal government, are less likely to flee a bank during times of trouble than deposits placed by professional investors.

Today, Bank of America still generates more funds than it can use, and regularly sells $7 billion to $9 billion a day to banks that need overnight deposits, according to its new president, Thomas A. Cooper.

Despite that underlying strength, the bank must begin to post profits on a consistent basis to regain its credibility among "employes, customers, shareholders and bond rating services," according to Robert Frick, vice chairman of the bank in charge of world banking.

"It is going to be a long, slow recovery process," Armacost said. He declined to predict the bank company's projected earnings for the three-month period that ends March 31. But sources said he told board members the company had profits of about $40 million in January.

So far, Armacost has retained the support, if not the total confidence, of BankAmerica's board of directors. Last month, and again this month, the board rejected former American Express Co. president Sanford Weill's bid to take Armacost's job in return for a promise to bring $1 billion in new capital investment to BankAmerica.

The board also discouraged an informal merger bid from California's First Interstate Bancorp. First Interstate, less than half the size of BankAmerica, is headed by Joseph Pinola, a former BankAmerica executive who left during the Clausen era.

But at the same time the board turned away Weill, it took steps to strengthen management of the giant Bank of America subsidiary. The board split the roles of chief executive (the policy-making job) and chief operating officer at the troubled bank subsidiary -- roles Armacost had filled simultaneously.

Armacost, who had been president and chief executive of the bank, was named to the newly created position of chairman and chief executive. Cooper, recruited a year ago from Pennsylvania's Mellon Bank to head up the Bank of America payments division -- which handles customer payrolls among other functions -- was named president and chief operating officer, responsible for the day-to-day management of the bank. Until the board move, there had been no formal chief operating position -- its duties went with the chief executive post.

Some analysts said that, by splitting Armacost's bank job in half (he retains the position of chief executive of the parent BankAmerica Corp.) the board appears to be sending a signal that his days are numbered. But bank insiders said that Armacost himself had been pushing since October for creation of a chief operating officer position -- a job that exists at most other corporations.

There is no doubt that trying to revamp BankAmerica during a period of declining earnings is a major policy and operating challenge. At the same time that Armacost has had to spend hundreds of millions of dollars a year on computer systems and training, he has seen earnings drained by bad loans and high costs.

The bank had grown fat and lazy during a period of heavy bank regulation. It collected low-cost consumer deposits -- on which interest rates were set by federal regulation -- with an ease that was the envy of other giant banks, which found themselves scrambling in professional money markets to raise higher-cost, unregulated funds from professional investors.

As the bank grew, so did its work force. Managers were paid on the basis of how many workers they managed, not on their performance -- which the bank largely was incapable of judging anyway. Bad lending decisions, especially in real estate, were saved by inflation.

By the early 1960s, it no longer could find enough lending opportunities in California and moved heavily into national and international lending. Because of its low-cost and large deposit base, the bank did business with everyone, according to Stephen T. McLin, BankAmerica senior vice president for corporate planning. "If it moved, shoot it," was the bank's philosophy, he said.

The bank never should have been doing business with many of those customers, according to Frick. In many cases, the bank was losing money on accounts -- the costs of maintaining a relationship were more than the revenues generated.

In California, Bank of America resembled a savings and loan association as much as it did a bank. Across the country, big commercial banks shunned long-term loans at fixed rates because they were used to raising much of their funds in unregulated markets where rates could, and did, fluctuate. But even into the late 1970s, Bank of America made billions of dollars of fixed-rate mortage loans.

In the short run, those loans generated huge fees and helped the bank show record profits in 1980, but caused problems later when the interest ceilings were largely abandoned and the bank's cost of money rose sharply.

Meanwhile, the bank had grown too big and too bureaucratic. Committees, not managers, made decisions, according to Robert N. Beck, whom Armacost recruited from International Business Machines Corp. four years ago to head Bank of America's personnel department. (Beck was the first personnel professional to hold the position -- even though the company had about 90,000 employes by 1982.)

The vastness of the bank and its inadequate internal controls contributed to bad loan decisions, according to McLin.

Loan-making powers were dispersed throughout the company -- a natural consequence of the bank's "insatiable appetite" for loans that would use the vast quantity of deposits it was generating, according to Cooper. Wiesler, who now controls all the bank's real estate lending, said that until recently there were three different areas of the bank that made real estate loans. "Somebody who wanted to build a hotel could be turned down in two units and get approval in the third," Wiesler said.

The bank also failed to develop management systems that other banks developed, and did not control its overall loan exposure carefully. As a result, the bank made more loans to certain industries than it should have, Cooper said. (Banks must avoid putting too many loans in the same industry so that a reversal doesn't overexpose its portfolio.)

Frick, in charge of Bank of America's banking operations outside of California, said the bank has pruned thousands of customers -- many of them long-term -- on which the bank is not making a profit.

The world banking division is concentrating on the large business customers who have the need for the varieties of services Bank of America can offer -- for a fee. The bank still relies on traditional lending. But it also is looking for customers who can make use of its worldwide network of branches and its ability to deliver investment banking products -- from placing bond issues in Europe to investments that reduce a company's exposure to interest-rate or foreign-exchange-rate risk.

Richard Saalfeld, the executive vice president in charge of the bank's North American division, said, "We are concentrating on industries that need the bank's global resources -- like the oil and chemical industries -- or niche industries like entertainment and airlines." He said that the bank is "disengaging" from middle-sized companies outside California, those with sales of less than $250 million.

"We've disengaged a lot of revenues, but not much profit," he said.

In California, the bank continues to concentrate on the retail and small and middle-sized businesses that have been its bread-and-butter business for years.

But the bank has moved to cut costs in its huge California operations, which account for nearly half its assets. It also has installed more than 1,000 automatic teller machines in the last five years. Technology investments -- whether in computer information systems or teller machines -- were largely neglected until Armacost took over, executives said.

Planning chief McLin said the bank has closed 230 branches in the last three years and consolidated operations like encoding checks and making specialized loans, while eliminating 7,000 jobs in California. The entire company has trimmed its work force by about 11,000 during the last five years.

But some of the toughest personnel cuts have not been made. "We've cut out a lot of privates, but the lieutenants and colonels are still there," McLin said. The line operations are leaner, but the corporate staff supporting them is not. "We've got departments where they write reports that are only read by themselves," he said.

"If there is a rap on Armacost, it's that he may be too nice a guy, that he hasn't moved fast enough to cut personnel and other costs," said a bank analyst.

Director Brimmer, who heads his own Washington consulting firm, said there are more changes to come at BankAmerica, including senior executives. Already, the majority of senior executives at the bank did not hold top jobs in 1981 and many of them were recruited from the outside. But Brimmer said Armacost's job is secure and should be.

But he said the "rap" about Armacost's lack of toughness is unfair. "People confuse a tendency to be civil with a tendency to be soft," Brimmer said. "Sam Armacost is civil, not soft."