SANOK, Poland (AP) _ Poland's fast shift to a market economy has shocked the 6,300 workers and managers of the Autosan Bus Factory, long wrapped in the warm cocoon of central planning.

With unsold buses gathering dust on the factory's parking lot, most of the plant is on ''work holiday'' and at least several hundred people are to be laid off permanently.

It is an example of how for the first time in decades in this formerly Communist country, economic failure packs a painful punch.

To make things harder for Sanok, a remote community on the edge of the Carpathian Mountains in the southeast corner of Poland, there are already 1,500 registered job-seekers and no employers large enough to absorb them. In housing-short Poland, relocating is seldom an option.

''Sanok will become a city of the unemployed,'' said metalworker Stanislaw Potoczny ruefully.

''People are depressed by the situation, really depressed,'' said Jan Solar, foreman in charge of the tooling department. ''Everyone is wondering, 'If I am fired, who will employ me?'''

Company Director Jan Wilk, looking glum during a recent interview, complained that he had no time to adjust to the free economic system introduced Jan. 1 by the Solidarity-led government. And the tight-money policies imposed to quench raging inflation have dried up demand, especially for big-ticket items like his $30,000 to $60,000 buses.

''Poland has a market economy, but it has no market,'' Wilk said.

Across Poland, state-owned enterprises like Autosan, which formerly paid only fleeting attention to the balance sheet, suddenly face the profit-or- perish pressure that managers in the West have long known.

The government used to be the financier of last resort, printing money to cover the losses of state-owned enterprises. Businesses were judged by how they fulfilled their plan, not by how much money they made or whether they produced anything anyone wanted to buy.

But no more.

Traditional crutches for East bloc managers - easy credit from the state, government subsidies, cheap access to hard currency, guaranteed customers and lack of competition - no longer function under the government's far-reaching reforms.

Having raised prices all they dare and gone through financial reserves, many companies are now desperately cutting costs to avoid bankruptcy. That includes labor costs in a country where job security was considered a birthright through four decades of communism.

The government has budgeted unemployment benefits for 400,000 people this year but does not dispute a World Bank projection of up to 1.7 million jobless in a work force of 18 million.

On the Autosan plant floor, the threat of layoffs has brought about a new respect for jobs among employees, said foreman Solar.

''An atmosphere of good work has come back because they are afraid of being fired. Before, if I asked people to do something, they might not do it. Now, everyone does.

''It is one of the points of the reform that is positive.''

Wilk said government policy had mandated that Autosan produce for the domestic bus market and for the Soviet Union at prices that were not profitable. Now, he is scrambling to find new markets in Europe and Africa and hoping for a Western company to subcontract work or form a joint venture.

An ''offer for cooperation'' was sent out blindly to Western companies and even to embassies, listing assets and a dozen ideas that might interest foreign partners, ranging from making a complete bus to leasing factory space.

''The scope of our services can be expanded to customer's needs and trend of business. All your suggestions will be welcomed. SO . .. GET YOUR CHANCE,'' the English-language brochure says hopefully.

But Wilk has no illusion that a Western partner will solve his short-term problem, 240 new buses and 1,200 trailers parked at his factory with no customers in sight. He's decided to stop production except for special orders.

''If production is lower, then the number of employees must be lower too,'' he said.

He said he did not know how many people would be let go in all, but criticized as exaggerated a report on the state's PAP news agency that 1,500 workers would get their notices. For one thing, Autosan cannot afford the legally required severance pay of three month's salary.

The plant slowdown started in January and February, when two-week work furloughs were ordered. Another began in April.

Wilk then started trimming about 400 jobs. The first to go, at the end of April, will be 40 soccer players who did no work but were financed from the factory payroll.

Laid off too were 120 draft-age youths who were working at the plant in lieu of serving in the military and about 100 workers who had committed disciplinary infractions in the past, such as theft or drinking. Veteran workers were offered early retirement, and the plant canteen was axed, he said.

The next target may be recently hired employees, those without families, and up to 2,500 workers who on the side operate small farms, Wilk said.

If one would expect Solidarity union local head Henryk Kozik to be demoralized, he quickly sets the record straight.

''I am an optimist,'' says the energetic Kozik, explaining that the union has been working with the management to minimize layoffs while striving to help the plant develop business. He has few qualms about the new government's economic policies.

''We all have to root out the consequences of the system that we had here for 40 years,'' he said. The alternative is ''to fall into the abyss.''