Two entirely different viewpoints must be reconciled to solve the problem of the illegal emigrants flooding across the border.

Here in Mexico, the movement of the jobless and those barely existing in what passes for agriculture is a "safety valve." With a semi-official unemployment/underemployment rate of 49 per cent, the pressures for jobs are great. And tariffs and other discriminations put a damper on the exports that Mexico might sell to the United States, stifling production. Mexico doesn't want to export people, it wants to export goods, President Jose Lopez Portillo says.

North of the border the view is that the illegals are filling jobs that should go to Americans, and, with the U.S. unemployment figure again rising above 7 per cent, that conviction is intensifying.

In Mexico, the illegals are thought to be doing work that Americans spurn - mostly stoop labor in the fields. And newspapers play up the injustices they allegedly suffer. One report frequently printed is that they are hired for menial work and then, when pay day comes, the authorities are informed and the illegals are deported without pay.

Given the emotions that churn around the issue, a compromise acceptable to both sides will be hard to come by. President Carter has put forward a complicated proposal granting citizenship or legal work permits depending on the length of time the illegals have been in the United States. One result is a thriving market in documents that show time of entry and date of birth. The Carter proposal also calls for greatly beefing up the patrol along the border, which has been a sieve, and provides stiffer penalties for those who knowingly hire illegals.

In theory, an illegal lacking residence qualifications would be sent back across the border. This has become one of the most sensitive points in the controversy: Does it mean a massive enforced movement of, say, 2 million illegals? Or would it be a gradual process of 30,000 a month until the total is greatly reduced?

While the issue of the illegals hardly compares, for the moment at least, to ratification of the Panama Canal treaties, in Latin America it accentuates all the differences between the rich northern neighbor and the southern hemisphere's struggle against poverty and instability. In his recent state-of-the-union message, Lopez Portillo used solemn language to express the Mexican view:

We expect that the measures taken against [the illegals] will not be marked by police methods but by understanding and fair treatment to enable the parties involved to jointly solve this common problem, which stems from a longstanding exchange relationship unfavorable to Mexico. To correct it would be to right many wrongs.

A program of massive American aid for Mexico is the hope of many who feel the problem is insoluble so long as poverty and unemployment are the causes of the migration. An American resident here for nearly 30 years told me he believed that only a Marshall Plan for Mexico would rehabilitate the Mexican economy and end the attraction of U.S. jobs and wages.

But if Mexico were singled out, other Latin American nations facing the same pressures would demand equal consideration. It is hard to imagine that Congress would approve a Latin American Marshall Plan, even if the administration were to advocate it.

One reason is that the Mexicans have failed to put their own economic house in order. The disparity in the distribution of income between the rich and the poor is such that Mexico stands third or fourth from the bottom among nations. Except for those on fixed salaries, tax collection is riddled with corruption and favoritism for the investor seeking a quick return at phenomenally high profits.

But Lopez Portillo is pushing reforms, and anyone devoted to the future of this remarkable country must wish him well.