The shah of Iran's family-controlled Pahlavi foundation owned a pencil company whose profits went to support the family mausoleum.

But the shah and his relatives also were involved in and personally profited from far bigger business as well -- mining and meatpacking, steel and aluminum, textiles and automobiles.

From the frills of the Iranian economy to its most basic industries, the Pahlavis were deeply involved.

"No one would risk capital in Iran without having a member of the royal family involved," said an American who worked in Tehran for many years. "That was the first law of business there."

Nearly a year after the Pahlavi dynasty was overthrown, an exact accounting of the family's wealth and business interests at home and abroad is nowhere near completed.

But hundreds of documents inspected in Tehran, as well as interviews with dozens of Americans and Iranians there and in the United States provide a picture of an Iranian commercial structure dominated by the people who wielded the power of government, decreed the laws and approved the great industrial projects: the Pahlavis.

The family or its foundations owned hotel resorts and casinos on the Caspian Sea and received vast proceeds from the gambling there. They were, moreover, partners in major industrial ventures with such multinational partners as General Motors, John Deere, Fiat and Honda.

The shah's twin sister, Princess Ashraf, a woman so strong-willed that some said she was the only person the shah truly feared, had personal and allegedly lucrative control over a multimillion-dollar social service agency funded by the national lottery.

The shah's half-brother was able to purchase huge tracts of prime farming and timber land from the royal land office at a price described by his former aide as "very favorable." The prince then used the tracts on the Caspian to increase his fortune through cotton plantations and timber concessions.

When the Iranian government issued only one license to operate a duty-free warehouse in Ahwaz through which passed most of the drilling equipment for oil fields there, that license went to a company controlled by the shah's nephew. The same company then became local agent for foreign equipment suppliers.

The shah himself would approve the major industrial projects for his closest relatives, acting as a benefactor for their financial gain. "He was not personally avaricious," said one former senior official in Tehran. "Accumulating money was not his preoccupation."

According to this friendly view, the shah tolerated abuses by his relatives because his eyes were set on a larger vision -- an economically advanced Iran modeled on the United States.

Other Americans are more critical of the family, including the shah. "They were as avaricious as Middle Eastern rug merchants, as venal as they come," said an American businessman with first-hand knowledge of the Pahlavi practices, "not only in what they did but in how they did it."

Today, the financial operations of the Pahlavis have emerged as a major issue between the Carter administration and the revolutionary regime of Ayatollah Ruhollah Khomeini.

The ayatollah and his officials have charged that the Pahlavis plundered the wealth of Iran in collusion with "money-loving Americans."

A legal action filed in a Tehran court 10 days ago by the Khomeini regime accused the deposed shah and his family of stealing $600 million from the country. The ayatollah has repeatedly linked return of the shah and his alleged riches to settlement of the dispute about the 50 Americans held hostage in the U.S. Embassy in Tehran.

U.S. officials strongly reject a linking of the two issues. In a telephone interview earlier this month, national security affairs adviser Zbigniew Brzezinski said that even to discuss the shah's financial activities in the press might give hope to the Tehran militants. Publicity might lead the militants to believe that public pressure was building in the United States for the administration to accede to demands that the shah be returned for trial, Brzezinski suggested.

Nonetheless, the role played by the Pahlavi family's financial manueverings in the shah's downfall has important implications for U.S. foreign policy that go beyond Iran and the hostage question.

In Saudi Arabia, the Philippines, Morocco, Indonesia and other developing countries, U.S. political, economic and strategic fortunes are linked to a handful to wealthy, ruling families presiding over systems that resemble in some ways the one that formerly existed in Iran.

In these countries, U.S. banks and companies function within economies in which payoffs, extortion and bribery are an accepted way of life and the ruler's approval is required for business deals.

As was the case in Iran, these are also countries in which important U.S. security arrangements or access to vital raw materials could be upset by political upheavels similar to those that ousted the shah.

But in Iran, at least, an appraisal of the practices that were widespread under the shah must include historical context.

The intricate system of commissions and bribes that existed under the shah's rule goes back centuries.

A western-style civil service, well paid and insulated from graft, does not exist in Iran or in many countries emerging from traditional village cultures.

Even now, Iranians take for granted that low-paid officials, even at the cabinet level, will supplement their incomes with gifts and commissions. This was the way things were long before British and American oil companies came to Iran.

That the royal family would grow wealthly through its influence was a fact of life accepted by many of the shah's subjects through the early part of his reign.

By law, for instance, members of the royal family did not have to pay taxes. And family members were not required to pay duty on anything they brought into Iran.

However, the enormous growth in Iran's oil revenues, beginning in 1973, created possibilities for personal gain that the Iranians came to view as excessive.

Between 1973 and 1978, Iran's annual oil income rose from $5.6 billion to $21.8 billion. With the shah's agreement, U.S. companies and banks offset the additional billions Americans were paying for oil by stepping up the flow of U.S. equipment, arms, technology, grain, and services to Iran. This program, called "recycling," kept the dollars Iran earned circulating back into American banks and industry.

However, Khomeini officials contend that the dollar recycling program burdened Iran with vast industrial and weapons programs, dependent on the purchase of western technology, that far exceeded the country's needs. They also charge that these giant deals set the stage for giant corruption.

To make their case, officials of the Khomeini regime made available in Tehran documents that provide some insights into the personal wealth of the Pahlavis without fully tracing the funds the regime's court case alleges to be missing.

For example, bank records and computer printouts in the central bank show disbursements from government and nongovernment accounts to Swiss banks and to a Manhattan jeweler. One series of documents from the Imperial land office, Amlak, requests Chase Manhattan Bank to send checks for $100,000, and in some cases $200,000, to New York jeweler Harry Winston. The Amlak letters are signed by Mohammad Jafar Behbehanian, who served as executive director of the land office and as the shah's personal financial adviser.

These letters illustrate one of the central problems in understanding the Pahlavi finances -- determining the dividing line between the Pahlavi private fortune and the government's funds.

The crown on the letters to Chase Manhattan symbolizes the ministry of court, a government body. But Amlak also was considered the land division of the Pahlavi Foundation, a private, family organization controlled by the shah. Behbehanian, who signed the letter, worked for both.

As sole ruler, the shah could draw funds directly from the government treasury. The budget during the 1970s contained an account for his personal use that ranged from $43 million one year to nearly $1 billion in another, according to three separate sources in Tehran.

Another well-endowed agency controlled by the shah was "WAF," a foundation set up many years ago to receive donations of land from Iranians to the Moslem religion and to support mosques and religious activities.

Still another heavily funded institution with quasi-governmental status was the Imperial Organization for Social Services (IOSS), a charitable agency. It was run by the shah's twin sister, Princess Ashraf, and raised money through lotteries and business ventures such as Daru Paksh, its pharmaceutical company.

The new regime has charged that its analysis of the IOSS books found large sums spent for Ashraf's trips abroad and for the purchase of two small jet aircraft that she used. These charges could not be verified during 10 days of inquiries in Tehran.

Finding proof for other Khomeini regime allegations has been hampered by several factors.

Some records have been destroyed or removed, while many sources of information still have not been tapped by investigators. One low-level central bank official told a reporter that for a year he had in his office, unopened, the safe of the shah's head of military procurement. He said he had not asked for or received authority to open the safe. Central bank officials investigating the previous government were unaware the safe existed.

In another case, a bureaucrat appointed by the shah's government and still in charge of a $250 million resort development project refused to provide a copy of a contract for casino management even though his questioner carried a letter from the minister of his department expressly directing that the material be made available.

Complicating the investigation further still is the fact that members of the royal family often were involved in business indirectly, through secret partners or intermediaries.

Members of the shah's most intimate entourage had far-reaching business connections of their own. For example, Asadollah Alam, who served as minister of court for many years and finally as prime minister, had a brother, Madjid, whose construction companies received some of the largest building contracts in Tehran. Whether Asadollah Alam and others in the shah's entourage served as a front for the shah or his relatives is a matter now under investigation in Tehran.

A Houston engineering company has said in documents filed in federal district court there that "all or part" of the $10.1 million it paid Iranian intermediaries to obtain $220 million in contracts "may have gone" to the shah's half-brother, Prince Abdol. A source who was in Iran at the time said that Abdol received more than the amount listed in the court filings as his share for the pulp and paper projects involved.

Despite the murky accounting practices prevalent in Iran, some things are documented.

The base of the Pahlavi family wealth rests on the land originally seized by the dynasty founder -- Reza Shah I, a colonel with little formal education.

By the time Reza Shah I was forced into exile in 1941, he reportedly claimed ownership of 10 percent of the country's land.

His son, recognizing the discontent created by such activity, decided to return some of the royal lands to small farmers. At the same time he required some other large landholders to break up their estates.

In both cases, however, the land was sold rather than given to the people. The bulk of the new shah's initial wealth came from land sales. For the large landholders, the land sale income became the investment funds for their development of industrial empires.

The shah used part of his land money to begin the Pahlavi Foundation in 1958, patterning the institution on The Rockefeller Brothers Fund in the United States.

The foundation had a significant charitable role -- for example, providing Iranian students with scholarships for overseas study. It also printed books, built hospitals and gave scholarships to needy children.

It initially played a role in the development of the country by reinvesting money raised from land sales in business ventures. To accommodate this activity, the foundation established the Bank Omran, "omran" meaning development.

Over the years, however, the foundation's business activities grew, taking a great leap forward in 1973 with the stepped-up flow of funds into Iran that accompanied the oil price increase.

It became a 10 percent shareholder in General Motors (Iran), a major shareholder in General Motors (Iran), a major shareholder in Jeep Iran Co. and a participant in Automobile Chasis & Body Manufacturing Co. as well as in Thyssen, the giant German steel concern.

Land remained an important part of the foundation's activities. Records made available in Tehran show that the foundation acquired land from the Iranian government at no cost and then sold it for cash to GM Iran, the Jeep company and others.

In the case of land sold to Automobile Chassis and Body, the Pahlavi Foundation received company stock as compensation instead of cash.

Amlak, the section of the foundation dealing with the old royal lands, also used its ability to buy and sell land to help the business dealings of family members.

One of the most ambitious foundation and Pahlavi family investments was Tehran's Farazad housing complex, a high-rise apartment and townhouse development costing several hundred million dollars to be designed and built by architects and contractors from different countries. At its heart was the West Tehran Development Co., a foundation enterprise. Building the separate units were joint venture concerns in which the foundation or individual Pahlavi family members served as partners of foreign contractors.

Iranians put millions of dollars down to purchase thousands of luxury apartments in the project. Today, stymied by the revolution, that area of Tehran is marked by some partly built mammoth apartment houses, some steel skeletons of buildings and vast areas still awaiting ground-breaking.

Representatives of the Khomeini government who now run the Pahlavi Foundation -- renamed the Alahvi Foundation -- are attempting to determine what happened to the money taken in by the various Pahlavi family corporations involved in the project.